 |
PGE Engine
|
4 #define PGEX_FileBegin() int str_count=0; \
7 #define PGEX_FileParseTree(raw) PGEFile pgeX_Data(raw);\
8 if( !pgeX_Data.buildTreeFromRaw() )\
10 errorString = pgeX_Data.lastError();\
13 #define PGEX_FetchSection() for(int section=0; section<(signed)pgeX_Data.dataTree.size(); section++)
14 #define PGEX_FetchSection_begin() PGEFile::PGEX_Entry &f_section = pgeX_Data.dataTree[section];\
15 if(f_section.name=="") continue;
17 #define PGEX_Section(sct) else if(f_section.name==sct)
18 #define PGEX_SectionBegin(stype) if(f_section.type!=stype) \
20 errorString=PGESTRING("Wrong section data syntax:\nSection ["+f_section.name+"]");\
24 #define PGEX_Items() for(int sdata=0;sdata<(signed)f_section.data.size();sdata++)
25 #define PGEX_ItemBegin(stype) if(f_section.data[sdata].type!=stype) \
27 errorString=PGESTRING("Wrong data item syntax:\nSection ["+f_section.name+"]\nData line "+fromNum(sdata));\
30 PGEFile::PGEX_Item x = f_section.data[sdata];
33 #define PGEX_Values() for(int sval=0;sval<(signed)x.values.size();sval++)
34 #define PGEX_ValueBegin() PGEFile::PGEX_Val v = x.values[sval];\
35 errorString=PGESTRING("Wrong value syntax\nSection ["+f_section.name+ \
36 "]\nData line "+fromNum(sdata) \
37 +"\nMarker "+v.marker+"\nValue "+v.value);\
38 if(v.marker=="") continue;
40 #define PGEX_StrVal(Mark, targetValue) else if(v.marker==Mark) { if(PGEFile::IsQStr(v.value)) \
41 targetValue = PGEFile::X2STR(v.value); \
44 #define PGEX_StrArrVal(Mark, targetValue) else if(v.marker==Mark) { if(PGEFile::IsStringArray(v.value)) \
45 targetValue = PGEFile::X2STRArr(v.value); \
48 #define PGEX_BoolVal(Mark, targetValue) if(v.marker==Mark) { if(PGEFile::IsBool(v.value)) \
49 targetValue = (bool)toInt(v.value);\
52 #define PGEX_BoolArrVal(Mark, targetValue) else if(v.marker==Mark) { if(PGEFile::IsBoolArray(v.value)) \
53 targetValue = PGEFile::X2BollArr(v.value); \
56 #define PGEX_UIntVal(Mark, targetValue) if(v.marker==Mark) { if(PGEFile::IsIntU(v.value)) \
57 targetValue = toInt(v.value);\
60 #define PGEX_SIntVal(Mark, targetValue) if(v.marker==Mark) { if(PGEFile::IsIntS(v.value)) \
61 targetValue = toInt(v.value);\
64 #define PGEX_FloatVal(Mark, targetValue) if(v.marker==Mark) { if(PGEFile::IsFloat(v.value)) \
65 targetValue = toDouble(v.value);\
69 #endif // PGE_X_MACRO_H