Polycode::Config Class Reference

Saves and loads simple config files. More...

List of all members.

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 StringgetStringValue (const String &configNamespace, const String &key)
 Returns a string value by a string key.

Detailed Description

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.


Member Function Documentation

Number Config::getNumericValue ( const String configNamespace,
const String key 
)

Returns a numeric value by a string key.

Parameters:
configNamespace Namespace to get the value from.
key String key of the value.
const String & Config::getStringValue ( const String configNamespace,
const String key 
)

Returns a string value by a string key.

Parameters:
configNamespace Namespace to get the value from.
key String key of the value.
void Config::loadConfig ( const String configNamespace,
const String fileName 
)

Load config from a specified file into the specified namespace.

Parameters:
configNamespace Namespace of the config to load data into.
fileName Path to the file to load.
void Config::saveConfig ( const String configNamespace,
const String fileName 
)

Save config to a specified file from the specified namespace.

Parameters:
configNamespace Namespace of the config to save data from.
fileName Path to the file to save data to.
void Config::setNumericValue ( const String configNamespace,
const String key,
Number  value 
)

Sets a numeric value into the specified config namespace.

Parameters:
configNamespace Namespace to set value in.
key String key of the value.
value The numeric value to save.
void Config::setStringValue ( const String configNamespace,
const String key,
const String value 
)

Sets a string value into the specified config namespace.

Parameters:
configNamespace Namespace to set value in.
key String key of the value.
value The string value to save.
Generated on Sat Aug 11 18:04:10 2012 for Polycode by  doxygen 1.6.3