#include <Config.h>
Public Methods | |
| Config () | |
| Default Constructor. | |
| Config (const string file) | |
| Constructor. | |
| ~Config () | |
| Destructor. | |
| bool | has_key (const string key) |
| A function to find if a setting name exists. | |
| bool | set (const string key, string value) |
| Insert or modify an existing setting. | |
| bool | get (const string key, string &value) |
| Retrieve an existing setting, should it exist. | |
| bool | store_settings () |
| Store all settings to the backing file. | |
| bool | load_settings () |
| Load settins from a stored file. | |
This class should be used to fetch/store any configuration settings used by the client (or the server). There are no groups for the settings, so the preferred convention for naming settings is: (client/server).(module).(setting). Thus, for a client's audio setting, client.audio.setting would be appropriate. This allows for clear distinction among settings and where they come from.
Each configuration class must be backed by a file, which it will load from and write to both explicitly, and upon construction and destruction.
Definition at line 38 of file Config.h.
|
|
Default Constructor. Initializes the internal data for storing the settings and uses the default configuaration file. Definition at line 7 of file Config.cpp. References load_settings(). |
|
|
Constructor. Initializes the internal data for storing these settings and uses the specified file name to store these settings.
Definition at line 12 of file Config.cpp. References load_settings(). |
|
|
Destructor. Deletes all internal data after storing settings to the backing file. Definition at line 17 of file Config.cpp. References store_settings(). |
|
||||||||||||
|
Retrieve an existing setting, should it exist.
Definition at line 96 of file Config.cpp. |
|
|
A function to find if a setting name exists.
Definition at line 80 of file Config.cpp. |
|
|
Load settins from a stored file.
Definition at line 22 of file Config.cpp. Referenced by Config(). |
|
||||||||||||
|
Insert or modify an existing setting. This function will insert a setting and its associated value into the list of settings. Keys cannot contain spaces. NOTE: This will overwrite any existing setting by that name.
Definition at line 84 of file Config.cpp. |
|
|
Store all settings to the backing file.
Definition at line 51 of file Config.cpp. Referenced by ~Config(). |
1.2.18