7 |
#include <vector> |
#include <vector> |
8 |
#include <map> |
#include <map> |
9 |
|
|
|
struct EzcInfo |
|
|
{ |
|
|
std::string text; |
|
|
bool result; |
|
10 |
|
|
|
EzcInfo() |
|
|
{ |
|
|
result = false; |
|
|
} |
|
|
}; |
|
|
|
|
11 |
class Ezc |
class Ezc |
12 |
{ |
{ |
13 |
public: |
public: |
14 |
typedef void (*UserFunction)(EzcInfo &); |
struct Info |
15 |
typedef std::map<std::string, UserFunction> UserFunctions; |
{ |
16 |
|
std::string text; |
17 |
|
bool result; |
18 |
|
int iter; |
19 |
|
}; |
20 |
|
|
21 |
UserFunctions user_functions; |
typedef void (*UserFunction)(Info &); |
22 |
|
|
23 |
|
struct UserInfo |
24 |
|
{ |
25 |
|
UserFunction user_function; |
26 |
|
int iter; |
27 |
|
}; |
28 |
|
|
29 |
|
typedef std::map<std::string, UserInfo> UserInfoTable; |
30 |
|
|
31 |
|
UserInfoTable user_info_table; |
32 |
|
|
33 |
Ezc(); |
Ezc(); |
34 |
void Init(); |
void Init(); |
35 |
bool ReadFile(const char * name); |
bool ReadFile(const char * name); |
66 |
bool CreateTreeReadItem(const char * & itext); |
bool CreateTreeReadItem(const char * & itext); |
67 |
void CreateTreeReadAll(const char * & itext); |
void CreateTreeReadAll(const char * & itext); |
68 |
void CreateTreeReadIfany(const char * & itext); |
void CreateTreeReadIfany(const char * & itext); |
69 |
|
void CreateTreeReadFor(const char * & itext); |
70 |
|
bool CreateTreeReadDeleteLastEndItem(); |
71 |
void CreateTree(const char * & itext); |
void CreateTree(const char * & itext); |
72 |
|
|
73 |
void MakeTextIfany(std::string & otext, UserFunctions & user_functions); |
void MakeTextIfany(std::string & otext, UserInfoTable & user_info_table); |
74 |
void MakeTextContainer(std::string & otext, UserFunctions & user_functions); |
void MakeTextFor(std::string & otext, UserInfoTable & user_info_table); |
75 |
|
void MakeTextContainer(std::string & otext, UserInfoTable & user_info_table); |
76 |
void MakeTextMsgCantFind(std::string & otext, std::string & key); |
void MakeTextMsgCantFind(std::string & otext, std::string & key); |
77 |
void MakeTextNormal(std::string & otext, UserFunctions & user_functions); |
void MakeTextNormal(std::string & otext, UserInfoTable & user_info_table); |
78 |
|
|
79 |
void MakeText(std::string & otext,UserFunctions & user_functions); |
void MakeText(std::string & otext,UserInfoTable & user_info_table); |
80 |
}; |
}; |
81 |
|
|
82 |
Item item_root; |
Item item_root; |