A Singleton class that handles configuration options for the application. All configuration options are stored in an OS-specific format, handled transparently by wxWidgets. ConfigDatabase is a layer on top of wxWidgets that stores retrieved options in a local cache so that the OS is only pinged for previously unqueried values or when a configuration option changes.
ConfigDatabase.h
A Singleton class that handles configuration options for the application. | |
Reads a configuration option from the cache or OS. | |
Writes a configuration option to the cache and OS. | |
The ConfigDatabase constructor. | |
Reads a configuration key from the OS. | |
Writes a configuration key to the OS. | |
The hash of configuration options. |
|
Reads a configuration option from the cache or OS. The cache is first checked for the option. If it does not exist, the OS is checked for the option. If it does not exist there, the default value is returned. Only integer, float, and wxString values can be returned as configuration options.
| section | The configuration section to search. |
| option | The configuration option to look for. |
| defaultValue | A default value for the option if it does not exist in the OS repository. |
The value of the configuration option.
|
Writes a configuration option to the cache and OS. The write happens immediately. Only integer, float, and wxString values can be written as configuration options.
| section | The configuration section to write to. |
| option | The configuration option to write. |
| value | The value of the configuration option. |
| ConfigDatabase() |
The ConfigDatabase constructor. Eeven though this constructor does nothing, it still needs to exist and be instantiated in ConfigDatabase.cpp or else there is nothing to link to in the .DLL for the ConfigDatabase class and external link errors will result in other modules.
|
Reads a configuration key from the OS.
| key | The key path to search in the OS repository. |
| defaultValue | The default value if the key does not exist. Returns: The value of the the configuration option. |
|
|
| ConfigDatabase() |
|
|
| StringHash mCache |