#include <IniFile.h>
Public Member Functions | |
IniFile () | |
Construct an empty IniFile. | |
IniFile (const char *filename) | |
Construct an IniFile and load settings. | |
bool | load (const char *filename) |
Load settings from an .ini file. | |
bool | save (const char *filename) const |
Save setting to an .ini-File. | |
void | removeKey (const char *section, const char *key) |
Remove a key from a section. | |
const char * | getString (const char *section, const char *key, const char *def="") const |
Get value of key. | |
int | getInt (const char *section, const char *key, int def=0) const |
double | getDouble (const char *section, const char *key, double def=0) const |
bool | getBool (const char *section, const char *key, bool def=false) const |
void | setString (const char *section, const char *key, const char *val) |
Set value of key. | |
void | setInt (const char *section, const char *key, int val) |
void | setDouble (const char *section, const char *key, double val) |
void | setBool (const char *section, const char *key, bool val) |
Private Types | |
typedef map< string, string, lt_nocase > | Keys |
typedef map< string, Keys, lt_nocase > | Sections |
Private Attributes | |
Sections | sections |
The values are stored in a double layered map. The first layer contains the section names, the second layer contains the actual key/value pairs. All names are case-insensitive, and are kept in sorted order. Insertion, lookup and removal of keys should take logarithmic time.
Definition at line 18 of file IniFile.h.
|
|
|
|
|
Construct an empty IniFile.
Definition at line 22 of file IniFile.cpp. |
|
Construct an IniFile and load settings.
Definition at line 32 of file IniFile.cpp. References load(). |
Here is the call graph for this function:
|
Load settings from an .ini file. Lines can be arbitrarily long and may use \-escaping and quoted whitespace. Comments must start with an ';'.
Definition at line 67 of file IniFile.cpp. References InFile::exists(), InFile::getEof(), InStream< InFile, InBinary >::read(), and sections. Referenced by IniFile(). |
Here is the call graph for this function:
|
Save setting to an .ini-File.
Definition at line 218 of file IniFile.cpp. References esc(), OutFile::exists(), and sections. |
Here is the call graph for this function:
|
Remove a key from a section.
Definition at line 45 of file IniFile.cpp. References sections. |
|
Get value of key.
Definition at line 263 of file IniFile.cpp. References sections. Referenced by getBool(), getDouble(), and getInt(). |
|
Definition at line 275 of file IniFile.cpp. References getString(). |
Here is the call graph for this function:
|
Definition at line 282 of file IniFile.cpp. References getString(). |
Here is the call graph for this function:
|
Definition at line 289 of file IniFile.cpp. References getString(). |
Here is the call graph for this function:
|
Set value of key.
Definition at line 247 of file IniFile.cpp. References sections. Referenced by setBool(), setDouble(), and setInt(). |
|
Definition at line 303 of file IniFile.cpp. References setString(). |
Here is the call graph for this function:
|
Definition at line 310 of file IniFile.cpp. References setString(). |
Here is the call graph for this function:
|
Definition at line 317 of file IniFile.cpp. References setString(). |
Here is the call graph for this function:
|
Definition at line 30 of file IniFile.h. Referenced by getString(), load(), removeKey(), save(), and setString(). |