added: two options to the config:
ezc_error_prefix (string) ezc_error_postfix (string) // prefix and postfix used when there is an error in Ezc patterns // default: // prefix: "<!-- " // postfix: " -->" added: Ezc::Blocks to templates added: although patterns have pointers to functions and blocks cached the Ezc::Generator should use SetFunctions() and SetBlocks() method in order to correctly recognize variables (aliases) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@978 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -61,12 +61,29 @@ public:
|
||||
void SetLocaleFilter(LocaleFilter * plocale_filter);
|
||||
|
||||
/*
|
||||
setting ezc functions
|
||||
you don't have to call this method
|
||||
(in such a case functions will be search with O(log) by the Generator)
|
||||
remembering a pointer to ezc functions
|
||||
this functions (pointers to them) will be cached in patterns
|
||||
|
||||
this caching will be done when a pattern is read from the hard drive
|
||||
so you have to call this method before
|
||||
*/
|
||||
void SetEzcFunctions(TemplatesFunctions::EzcFun * fun);
|
||||
|
||||
/*
|
||||
remembering a pointer to ezc blocks
|
||||
this blocks (pointers to them) will be cached in patterns
|
||||
|
||||
this caching will be done when a pattern is read from the hard drive
|
||||
so you have to call this method before
|
||||
*/
|
||||
void SetEzcBlocks(Ezc::Blocks * blocks);
|
||||
|
||||
|
||||
/*
|
||||
commentary prefix/postfix used in pattern_parser
|
||||
(when there is an error)
|
||||
*/
|
||||
void SetEzcCommentary(const std::wstring & start, const std::wstring & end);
|
||||
|
||||
/*
|
||||
adding a new pattern and returning its index
|
||||
@@ -75,8 +92,10 @@ public:
|
||||
|
||||
if read_pattern is false then the pattern is not read,
|
||||
it will be read when you call Reload() method
|
||||
|
||||
after adding some new patterns you have to call RebuildCache() method
|
||||
*/
|
||||
size_t Add(const wchar_t * file_name, bool read_pattern = true);
|
||||
size_t Add(const wchar_t * file_name, bool read_pattern = true);
|
||||
size_t Add(const std::wstring & file_name, bool read_pattern = true);
|
||||
|
||||
|
||||
@@ -107,7 +126,7 @@ public:
|
||||
|
||||
|
||||
/*
|
||||
reloading all patterns
|
||||
reloading all patterns and rebuilding cache
|
||||
*/
|
||||
void Reload();
|
||||
|
||||
@@ -120,6 +139,13 @@ public:
|
||||
size_t Size();
|
||||
|
||||
|
||||
/*
|
||||
* rebuilding the cache for functions and blocks
|
||||
* you should call this method when you Add() new patterns
|
||||
*/
|
||||
void RebuildCache();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
bool del_white_items;
|
||||
@@ -130,6 +156,9 @@ private:
|
||||
// can be null (not set directly)
|
||||
TemplatesFunctions::EzcFun * ezc_fun;
|
||||
|
||||
// can be null
|
||||
Ezc::Blocks * ezc_blocks;
|
||||
|
||||
struct Template
|
||||
{
|
||||
bool to_delete;
|
||||
|
Reference in New Issue
Block a user