fixed: when Pattern::allow_include was false then nothing was read
added: ezc can use the logger from winix
added: we check how many [include] directive was called
(if more than 100 then we break - supposing infinite loop)
added: in Pattern we read from two directories
if a file is not in the first directory then we try to read
from the other one
git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@292 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
1 parent
bb00f23f29
commit
f65178dd0e
4 files changed
+92
-25
No files matched your search
@@ -69,8 +69,14 @@ public:
|
||||
void ParseFile(const char * file_name);
|
||||
void ParseString(const std::string & str);
|
||||
void ParseString(const char * str);
|
||||
void Directory(const char * d);
|
||||
void Directory(const std::string & d);
|
||||
|
||||
// first we're trying to read a file from directory dir
|
||||
// if there is no such a file there then we try read from dir2
|
||||
// (the second dir2 can be empty - it will not be used)
|
||||
void Directory(const char * dir, const char * dir2 = 0);
|
||||
void Directory(const std::string & dir);
|
||||
void Directory(const std::string & dir, const std::string & dir2);
|
||||
|
||||
void Clear();
|
||||
|
||||
struct Item
|
||||
@@ -124,12 +130,18 @@ public:
|
||||
|
||||
private:
|
||||
const char * itext;
|
||||
std::string directory;
|
||||
|
||||
// first we're trying to read a file from 'directory'
|
||||
// if there is no such a file there then we try read from 'directory2'
|
||||
// we read from these directories only if they are not empty
|
||||
std::string directory, directory2;
|
||||
|
||||
int include_level;
|
||||
|
||||
bool CheckFileName(const char * name);
|
||||
std::string ReadFile(const std::string & name);
|
||||
std::string ReadFile(const char * name);
|
||||
bool ReadFileFromDir(const std::string & dir, const char * name, std::string & result);
|
||||
|
||||
int ReadCharInText();
|
||||
bool IsWhite(int c);
|
||||
@@ -163,6 +175,7 @@ private:
|
||||
void CreateTree(Item & item);
|
||||
|
||||
void CreateTreeReadInclude(Item & item);
|
||||
void CreateTreeReadIncludeSkipAllowFlag(Item & item);
|
||||
|
||||
}; // Pattern
|
||||
|
||||
|
||||
Reference in new issue
Block a user