|
| Conf (const Conf &) |
| Declared to avoid using of default copy constructor. More...
|
|
| Conf (string filename="") |
| Constructor, parse a configuration file. More...
|
|
int | ival (string section, string key) |
| Search for the specified section/key value and return it as an integer. More...
|
|
int | ival (string section, string key, int defval) |
| Search for the specified section/key value and return it as an integer. More...
|
|
long long int | lval (string section, string key) |
| Search for the specified section/key value and return it as a long integer. More...
|
|
long long int | lval (string section, string key, int defval) |
| Search for the specified section/key value and return it as a long integer. More...
|
|
void | open (string filename) |
|
Conf & | operator= (const Conf &) |
| Declared to avoid using of default assignment operator. More...
|
|
void | save (string filename="") |
| Save all the values in a configuration file. More...
|
|
bool | search (string section, string key, enum ThrowExceptions throwexc=DONT_THROW) |
| Search for the specified section/key value. More...
|
|
void | setval (string section, string key, string val, string comment="") |
| Set a new value for the specified section/key pair. More...
|
|
void | setval (string section, string key, long long int val, string comment="") |
| Set a new value for the specified section/key pair. More...
|
|
void | setval (string section, string key, int val, string comment="") |
| Set a new value for the specified section/key pair. More...
|
|
void | setval (string section, string key, Data *val, string comment="") |
| Set a new value for the specified section/key pair. More...
|
|
string | sval (string section, string key) |
| Search for the specified section/key value and return it as a string. More...
|
|
string | sval (string section, string key, string defval) |
| Search for the specified section/key value and return it as a string. More...
|
|
Data & | val (string section="", string key="") |
| Return a Data object containing the last value found. More...
|
|
| ~Conf () |
| Destructor. More...
|
|
Read and write configuration files.
This class can be used to read and write configuration files like those known as INI files in the Windows world.
Supported files can have sections (using the "[]" characters) and comments (from the "#" character to the new line).
Once the file have been parsed (by the constructor) values can be retrieved as STRING Data objects, as well as string or integers.
Definition at line 4843 of file mcs.hh.
void mcs::Conf::setval |
( |
string |
section, |
|
|
string |
key, |
|
|
string |
val, |
|
|
string |
comment = "" |
|
) |
| |
Set a new value for the specified section/key pair.
If the section/key pair was already present its value will be substituted with the new one, otherwise it will be created.
The changes you made to the values won't be written to the configuration file until you call the save() method.
- Parameters
-
section | Section you wish to write to; |
key | Key you wish to write to; |
val | New value for the section/key pair; |
comment | Optional comment to the value. |
Definition at line 191 of file Conf.cc.
void mcs::Conf::setval |
( |
string |
section, |
|
|
string |
key, |
|
|
long long int |
val, |
|
|
string |
comment = "" |
|
) |
| |
Set a new value for the specified section/key pair.
If the section/key pair was already present its value will be substituted with the new one, otherwise it will be created.
The changes you made to the values won't be written to the configuration file until you call the save() method.
- Parameters
-
section | Section you wish to write to; |
key | Key you wish to write to; |
val | New value for the section/key pair; |
comment | Optional comment to the value. |
Definition at line 221 of file Conf.cc.
void mcs::Conf::setval |
( |
string |
section, |
|
|
string |
key, |
|
|
int |
val, |
|
|
string |
comment = "" |
|
) |
| |
Set a new value for the specified section/key pair.
If the section/key pair was already present its value will be substituted with the new one, otherwise it will be created.
The changes you made to the values won't be written to the configuration file until you call the save() method.
- Parameters
-
section | Section you wish to write to; |
key | Key you wish to write to; |
val | New value for the section/key pair; |
comment | Optional comment to the value. |
Definition at line 215 of file Conf.cc.
void mcs::Conf::setval |
( |
string |
section, |
|
|
string |
key, |
|
|
Data * |
val, |
|
|
string |
comment = "" |
|
) |
| |
Set a new value for the specified section/key pair.
If the section/key pair was already present its value will be substituted with the new one, otherwise it will be created.
The changes you made to the values won't be written to the configuration file until you call the save() method.
- Parameters
-
section | Section you wish to write to; |
key | Key you wish to write to; |
val | New value for the section/key pair; |
comment | Optional comment to the value. |
Definition at line 209 of file Conf.cc.