Compare commits
10 Commits
ae6a5c52a1
...
c31c7dfb63
Author | SHA1 | Date |
---|---|---|
Tomasz Sowa | c31c7dfb63 | |
Tomasz Sowa | 0c058d4313 | |
Tomasz Sowa | d8692f6ed5 | |
Tomasz Sowa | b047a10e8d | |
Tomasz Sowa | a983698e3d | |
Tomasz Sowa | 6a8cb019f5 | |
Tomasz Sowa | b0afdf7f0f | |
Tomasz Sowa | b956f1c401 | |
Tomasz Sowa | 5e47313af8 | |
Tomasz Sowa | 44407c2a4b |
|
@ -30,6 +30,7 @@ patternparser.o: ../../pikotools/src/convert/inttostr.h
|
|||
patternparser.o: ../../pikotools/src/date/date.h
|
||||
patternparser.o: ../../pikotools/src/membuffer/membuffer.h
|
||||
patternparser.o: ../../pikotools/src/textstream/types.h
|
||||
patternparser.o: ../../pikotools/src/utf8/utf8_stream.h
|
||||
patternparser.o: ../../pikotools/src/log/filelog.h
|
||||
patternparser.o: ../../pikotools/src/convert/convert.h
|
||||
patternparser.o: ../../pikotools/src/convert/inttostr.h
|
||||
|
|
638
src/generator.h
638
src/generator.h
File diff suppressed because it is too large
Load Diff
|
@ -100,6 +100,8 @@ struct Item
|
|||
{
|
||||
is_function = f.is_function;
|
||||
name = f.name;
|
||||
fields = f.fields;
|
||||
postfix = f.postfix;
|
||||
fun_cache = f.fun_cache;
|
||||
item_block = f.item_block;
|
||||
base_obj = f.base_obj;
|
||||
|
|
|
@ -125,6 +125,12 @@ morm::Wrapper * Models::Find(const std::wstring & name)
|
|||
}
|
||||
|
||||
|
||||
Models::ModelsMap & Models::GetMap()
|
||||
{
|
||||
return models_map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,8 @@ class Models
|
|||
{
|
||||
public:
|
||||
|
||||
typedef std::map<std::wstring, morm::Wrapper> ModelsMap;
|
||||
|
||||
Models();
|
||||
~Models();
|
||||
|
||||
|
@ -130,12 +132,13 @@ public:
|
|||
}
|
||||
|
||||
morm::Wrapper * Find(const std::wstring & name);
|
||||
ModelsMap & GetMap();
|
||||
void Clear();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
std::map<std::wstring, morm::Wrapper> models_map;
|
||||
ModelsMap models_map;
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2015, Tomasz Sowa
|
||||
* Copyright (c) 2015-2021, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -47,7 +47,7 @@ namespace Ezc
|
|||
{
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
template<class StreamType, bool is_pikotools_stream = false>
|
||||
class OutStreams
|
||||
{
|
||||
public:
|
||||
|
@ -65,36 +65,35 @@ public:
|
|||
|
||||
~OutStreams();
|
||||
OutStreams();
|
||||
OutStreams(const OutStreams<StreamType> & o);
|
||||
OutStreams<StreamType> & operator=(const OutStreams<StreamType> & o);
|
||||
OutStreams(const OutStreams & o);
|
||||
OutStreams & operator=(const OutStreams & o);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
OutStreams<StreamType>::~OutStreams()
|
||||
template<class StreamType, bool is_pikotools_stream>
|
||||
OutStreams<StreamType, is_pikotools_stream>::~OutStreams()
|
||||
{
|
||||
ClearTab();
|
||||
}
|
||||
|
||||
template<class StreamType>
|
||||
OutStreams<StreamType>::OutStreams()
|
||||
template<class StreamType, bool is_pikotools_stream>
|
||||
OutStreams<StreamType, is_pikotools_stream>::OutStreams()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
OutStreams<StreamType>::OutStreams(const OutStreams<StreamType> & o)
|
||||
template<class StreamType, bool is_pikotools_stream>
|
||||
OutStreams<StreamType, is_pikotools_stream>::OutStreams(const OutStreams<StreamType, is_pikotools_stream> & o)
|
||||
{
|
||||
// we do not copy streams but creating new ones
|
||||
ResizeTab(o.streams_tab.size());
|
||||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
OutStreams<StreamType> & OutStreams<StreamType>::operator=(const OutStreams<StreamType> & o)
|
||||
template<class StreamType, bool is_pikotools_stream>
|
||||
OutStreams<StreamType, is_pikotools_stream> & OutStreams<StreamType, is_pikotools_stream>::operator=(const OutStreams<StreamType, is_pikotools_stream> & o)
|
||||
{
|
||||
// we do not copy streams but creating new ones
|
||||
streams_map.clear();
|
||||
|
@ -104,8 +103,8 @@ return *this;
|
|||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void OutStreams<StreamType>::ClearTab()
|
||||
template<class StreamType, bool is_pikotools_stream>
|
||||
void OutStreams<StreamType, is_pikotools_stream>::ClearTab()
|
||||
{
|
||||
for(size_t i=0 ; i<streams_tab.size() ; ++i)
|
||||
delete streams_tab[i];
|
||||
|
@ -115,8 +114,8 @@ void OutStreams<StreamType>::ClearTab()
|
|||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void OutStreams<StreamType>::ResizeTab(size_t len)
|
||||
template<class StreamType, bool is_pikotools_stream>
|
||||
void OutStreams<StreamType, is_pikotools_stream>::ResizeTab(size_t len)
|
||||
{
|
||||
if( streams_tab.size() != len )
|
||||
{
|
||||
|
@ -141,8 +140,8 @@ void OutStreams<StreamType>::ResizeTab(size_t len)
|
|||
}
|
||||
|
||||
|
||||
template<class StreamType>
|
||||
void OutStreams<StreamType>::ClearMap()
|
||||
template<class StreamType, bool is_pikotools_stream>
|
||||
void OutStreams<StreamType, is_pikotools_stream>::ClearMap()
|
||||
{
|
||||
typename StreamsMap::iterator i;
|
||||
|
||||
|
@ -150,12 +149,14 @@ void OutStreams<StreamType>::ClearMap()
|
|||
{
|
||||
StreamType & str = *(i->second);
|
||||
|
||||
#ifdef EZC_GENERATOR_HAS_PT_STREAM
|
||||
if constexpr(is_pikotools_stream)
|
||||
{
|
||||
str.clear();
|
||||
#else
|
||||
}
|
||||
else
|
||||
{
|
||||
str.str(L"");
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
streams_map.clear();
|
||||
|
|
Loading…
Reference in New Issue