Commit Graph

6 Commits

Author SHA1 Message Date
Tomasz Sowa 861269383e changed: [is...] statements use only the output string now (when comparing)
previously they used FunInfo::res, now they use FunInfo::out
         and the out string is not put to the main output stream
added:   FunInfo<>::case_sensitive (default true)
         when false then [is] statement is comparing in case insensitive manner
changed: the out stream in [if...] [for] statements
         the output text is ingored now



git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@344 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-04-26 17:17:06 +00:00
Tomasz Sowa 542e50d757 added filters:
a new statement [filter]
 syntax:
 [filter funcion_name]....[end]
 everything which is between [filter] and [end] is processed normally and
 at the end it is passed to the function (function_name)
 FunInfo struct has 'in' input stream now



git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@333 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-01-26 12:42:49 +00:00
Tomasz Sowa fd2194623a changed: now [for] statements with the same function can be nested
sample:
[for my_function]
 [for my_function]
   foo
 [end]
[end]

changed: FunInfo::iter has a value from the last [for] statement now
sample:
[for my_function]
 [other_function]
[end]

void other_function(Info &i)
{
// here i.iter is the number of iteration
// previously was always zero
}

changed: small optimization in [for]
the proper function is being looking for only once at the beginning
previously it was searched in each iteration



git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@331 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-01-14 23:59:30 +00:00
Tomasz Sowa 0b09b5454f added: Pattern::CacheFunctions(Functions<StreamType> & fun)
you can cache all functions (their addresses) in the pattern

changed: now we have two methods for generating content:
       Generator<>::Generate(StreamType & o, Pattern & p, Functions<StreamType> & f);
       similar like previous -- Set(...) methods were removed as well as the second ctor 

       and a second one:
       Generate(StreamType & o, Pattern & p);
       without functions, the functions should be cached beforehand in the pattern
       by calling CacheFunctions() method on the pattern
       this gives O(1) complexity when looking for a specific function
       previously was O(log n) 
       


git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@329 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-11-25 22:39:58 +00:00
Tomasz Sowa 5108495540 changed in Generator<>:
StreamType
 we use method write where the content should not be escaped (html escaping)
 we use operator<< where the content can be escaped (such as error messages)

PrintSpecialText() and PrintNormalText() are a little faster now
we use 'write' for a whole text instead of printing each character



git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@328 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-11-25 01:55:32 +00:00
Tomasz Sowa 8f94937ed1 added: support for UTF-8 (files utf8.h utf8.cpp)
they can be even used without the rest library
         as only a library for converting between wide characters and UTF-8
changed: everywhere we use std::wstring instead of std::string
changed: Generator and Functions are templates now
         they take a stream type
renamed: Info to FunInfo and it is a template too
         taking a stream type

now you can use other kind of streams with the library
previous was only std::ostringstream



git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@326 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-11-22 01:23:32 +00:00