changed: SetCommentary() methods from Pattern were moved to PatternParser and Generator
added: caching functions and blocks
caching is added into Pattern and Blocks
methods: CacheFunctions() and CacheBlocks()
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@975 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
+2
-50
@@ -45,9 +45,6 @@ namespace Ezc
|
||||
|
||||
Pattern::Pattern()
|
||||
{
|
||||
// !!!!! IMPROVE ME as default there can be empty strings
|
||||
commentary_start = L"<!-- ";
|
||||
commentary_stop = L" -->";
|
||||
Clear();
|
||||
}
|
||||
|
||||
@@ -61,57 +58,12 @@ void Pattern::Clear()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Pattern::SetCommentary(const char * com_start, const char * com_stop)
|
||||
void Pattern::CacheBlocks(Blocks & blocks)
|
||||
{
|
||||
PT::UTF8ToWide(com_start, commentary_start);
|
||||
PT::UTF8ToWide(com_stop, commentary_stop);
|
||||
Cache(blocks, item_root);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Pattern::SetCommentary(const std::string & com_start, const std::string & com_stop)
|
||||
{
|
||||
PT::UTF8ToWide(com_start, commentary_start);
|
||||
PT::UTF8ToWide(com_stop, commentary_stop);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Pattern::SetCommentary(const wchar_t * com_start, const wchar_t * com_stop)
|
||||
{
|
||||
commentary_start = com_start;
|
||||
commentary_stop = com_stop;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Pattern::SetCommentary(const std::wstring & com_start, const std::wstring & com_stop)
|
||||
{
|
||||
commentary_start = com_start;
|
||||
commentary_stop = com_stop;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Pattern::CreateMsg(std::wstring & out, const wchar_t * type, const wchar_t * arg)
|
||||
{
|
||||
out = commentary_start;
|
||||
out += L"Ezc: ";
|
||||
out += type;
|
||||
|
||||
if( arg )
|
||||
{
|
||||
out += ' ';
|
||||
out += arg;
|
||||
}
|
||||
|
||||
out += commentary_stop;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Pattern::ClearCache()
|
||||
{
|
||||
item_root.ClearCache();
|
||||
|
||||
Reference in New Issue
Block a user