58class Configurator :
public Class
69 size_t GetLine(
char *dest,
const char *data,
size_t size);
70 str GetValue(
const char *section,
const char *key,
str defaultValue,
int index = -1);
71 configKey_t *GetKey(
const char *section,
const char *key,
int index = -1);
73 int CutLine(
char *data);
74 bool SetupLine(
char *line,
int& lineno,
size_t& len,
size_t& last);
75 bool FindData(
int type,
const char *section,
const char *key,
size_t *offset,
const char *data,
size_t size);
76 void ParseData(
const char *data,
size_t size);
77 void WriteData(
char **data,
size_t *size);
78 void WriteData2(
char **data,
size_t *size);
79 int ParseLine(
char *line,
char *section,
char *key,
char *value);
81 configSection_t *CreateSection(
const char *section);
82 configSection_t *FindSection(
const char *section);
83 int GetKeyArray(
char *key);
84 int GetKeyArray(
str& key);
85 configKey_t *CreateKey(configSection_t *section,
const char *key,
unsigned int *index);
86 configKey_t *FindKey(configSection_t *section,
const char *key);
87 void RemoveSection(configSection_t *section);
88 void RemoveKey(configSection_t *section, configKey_t *key);
91 CLASS_PROTOTYPE(Configurator);
93 Configurator(
const char *filename);
97 void Parse(
const char *filename);
99 void SetWrite(
bool bWrite);
101 str GetString(
const char *section,
const char *key,
str defaultValue,
int index = -1);
102 int GetInteger(
const char *section,
const char *key,
int defaultValue,
int index = -1);
103 float GetFloat(
const char *section,
const char *key,
float defaultValue,
int index = -1);
104 void SetString(
const char *section,
const char *key,
str value,
int index = -1);
105 void SetInteger(
const char *section,
const char *key,
int value,
int index = -1);
106 void SetFloat(
const char *section,
const char *key,
float value,
int index = -1);