added to Generator:

void RecognizeSpecialChars(bool spec);
  recognizing some special characters in text patterns (item_text in Patterns)
  \r will be a carriage return (13)
  \n will be a new line (10)
  \t will be a tabulator (9)
  \s will be a space
  \\ will be one '\'
  default: false

void TrimWhite(bool trim);
  trimming white characters (at the beginning and at the end of an item_text)
  (special char \s if enabled is not treated as a white character here)
  default: false 

void SkipNewLine(bool skip);
  skipping new line characters (from the whole string in an item_text)
  but you can use a new line character written as "\n" (if special chars are turn on)
  default: false
						       


git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@305 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
tomasz.sowa committed 2010-09-07 23:52:41 +00:00
1 parent 376fe414f8
commit b5ea2514e2
2 files changed
+146 -4

No files matched your search

+32 -1
View File
@@ -84,6 +84,9 @@ public:
void CreateMsg(std::ostringstream & o, const char * type, const char * arg = 0);
std::string CreateMsg(const char * type, const char * arg = 0);
bool IsWhite(int c);
struct Item
{
@@ -158,7 +161,6 @@ private:
bool ReadFileFromDir(const std::string & dir, const char * name, std::string & result);
int ReadCharInText();
bool IsWhite(int c);
void SkipWhite();
void CheckWhiteAndDelete(std::string & s);
@@ -287,6 +289,26 @@ public:
void Set(Functions & f);
void SetMax(int max_items_, int max_for_items_);
// recognizing some special characters in text patterns (item_text in Patterns)
// \r will be a carriage return (13)
// \n will be a new line (10)
// \t will be a tabulator (9)
// \s will be a space
// \\ will be one '\'
// default: false
void RecognizeSpecialChars(bool spec);
// trimming white characters (at the beginning and at the end of an item_text)
// (special char \s if enabled is not treated as a white character here)
// default: false
void TrimWhite(bool trim);
// skipping new line characters (from the whole string in an item_text)
// but you can use a new line character written as "\n" (if special chars are turn on)
// default: false
void SkipNewLine(bool skip);
void Generate();
private:
@@ -299,6 +321,9 @@ private:
int current_item;
int max_items;
int max_for_items;
bool special_chars;
bool trim_white;
bool skip_new_line;
// an empty string for info objects
const std::string empty;
@@ -312,6 +337,11 @@ private:
void CallUserFunction(Functions::Function * function, Info & info);
void CallVariable(Functions::Function * function, Info & info);
char CreateSpecialChar(char c);
void PrintSpecialText(const char * start, const char * end);
void PrintNormalText(const char * start, const char * end);
void TrimWhite(const char *& start, const char *& end);
void MakeTextIf_go(Pattern::Item & item, bool result);
bool MakeTextIfindexnumber(Pattern::Item & item, Functions::Function * function, bool & result);
void MakeTextIf(Pattern::Item & item);
@@ -323,6 +353,7 @@ private:
void MakeTextIfindex(Pattern::Item & item);
void MakeTextForLoop(Pattern::Item & item, Functions::Function * function);
void MakeTextFor(Pattern::Item & item);
void MakeItemText(Pattern::Item & item);
void MakeTextContainer(Pattern::Item & item);
void MakeTextNormal(Pattern::Item & item);
void MakeTextIs(Pattern::Item & item);