Polycode
|
Saves and loads simple config files. More...
Public Member Functions | |
Config () | |
Default constructor. | |
void | loadConfig (const String &configNamespace, const String &fileName) |
Load config from a specified file into the specified namespace. | |
void | saveConfig (const String &configNamespace, const String &fileName) |
Save config to a specified file from the specified namespace. | |
void | setStringValue (const String &configNamespace, const String &key, const String &value) |
Sets a string value into the specified config namespace. | |
void | setNumericValue (const String &configNamespace, const String &key, Number value) |
Sets a numeric value into the specified config namespace. | |
Number | getNumericValue (const String &configNamespace, const String &key) |
Returns a numeric value by a string key. | |
const String & | getStringValue (const String &configNamespace, const String &key) |
Returns a string value by a string key. |
Saves and loads simple config files.
Config stores, loads and saves string and number values associated by string keys. You can use to easily save and load settings and preferences and other data. Configs are separated by namespaces, so you can have multiple configs with the same keys.
Returns a numeric value by a string key.
configNamespace | Namespace to get the value from. |
key | String key of the value. |
Returns a string value by a string key.
configNamespace | Namespace to get the value from. |
key | String key of the value. |
Load config from a specified file into the specified namespace.
configNamespace | Namespace of the config to load data into. |
fileName | Path to the file to load. |
Save config to a specified file from the specified namespace.
configNamespace | Namespace of the config to save data from. |
fileName | Path to the file to save data to. |
Sets a numeric value into the specified config namespace.
configNamespace | Namespace to set value in. |
key | String key of the value. |
value | The numeric value to save. |