50enum { LINE_EMPTY, LINE_COMMENT, LINE_SECTION, LINE_VALUE, LINE_ERROR };
52class Configurator :
public Class
63 size_t GetLine(
char* dest,
const char* data,
size_t size);
64 str GetValue(
const char* section,
const char* key,
str defaultValue,
66 configKey_t* GetKey(
const char* section,
const char* key,
int index = -1);
68 int CutLine(
char* data);
69 bool SetupLine(
char* line,
int& lineno,
size_t& len,
size_t& last);
70 bool FindData(
int type,
const char* section,
const char* key,
71 size_t* offset,
const char* data,
size_t size);
72 void ParseData(
const char* data,
size_t size);
73 void WriteData(
char** data,
size_t* size);
74 void WriteData2(
char** data,
size_t* size);
75 int ParseLine(
char* line,
char* section,
char* key,
char* value);
77 configSection_t* CreateSection(
const char* section);
78 configSection_t* FindSection(
const char* section);
79 int GetKeyArray(
char* key);
80 int GetKeyArray(
str& key);
81 configKey_t* CreateKey(configSection_t* section,
const char* key,
83 configKey_t* FindKey(configSection_t* section,
const char* key);
84 void RemoveSection(configSection_t* section);
85 void RemoveKey(configSection_t* section, configKey_t* key);
88 CLASS_PROTOTYPE(Configurator);
90 Configurator(
const char* filename);
94 void Parse(
const char* filename);
96 void SetWrite(
bool bWrite);
98 str GetString(
const char* section,
const char* key,
str defaultValue,
100 int GetInteger(
const char* section,
const char* key,
int defaultValue,
102 float GetFloat(
const char* section,
const char* key,
float defaultValue,
104 void SetString(
const char* section,
const char* key,
str value,
106 void SetInteger(
const char* section,
const char* key,
int value,
108 void SetFloat(
const char* section,
const char* key,
float value,