The SWORD Project
1.9.0.svnversion
|
#include <swconfig.h>
Public Member Functions | |
virtual void | augment (const SWConfig &addFrom) |
SWBuf | getFileName () const |
ConfigEntMap & | getSection (const char *section) |
virtual SectionMap & | getSections () |
const SectionMap & | getSections () const |
SWBuf | getValue (const char *section, const char *key) |
virtual void | load () |
SWDEPRECATED void | Load () |
SWConfig & | operator+= (const SWConfig &addFrom) |
ConfigEntMap & | operator[] (const char *section) |
virtual void | save () const |
SWDEPRECATED void | Save () |
void | setValue (const char *section, const char *key, const char *value) |
SWConfig (const char *fileName) | |
SWConfig () | |
virtual | ~SWConfig () |
Public Attributes | |
SWDEPRECATED SWBuf | filename |
SWDEPRECATED SectionMap | Sections |
The class to read and save settings using a file on disk.
Definition at line 41 of file swconfig.h.
SWConfig::SWConfig | ( | const char * | fileName | ) |
Map of available sections The map of available sections. Constructor of SWConfig
fileName | The storage path for this config. |
Definition at line 41 of file swconfig.cpp.
SWORD_NAMESPACE_START SWConfig::SWConfig | ( | ) |
Definition at line 37 of file swconfig.cpp.
|
virtual |
Definition at line 47 of file swconfig.cpp.
Merges into this config the values from addFrom
addFrom | The config which values should be merged to this config object. Already existing values will be overwritten. |
Definition at line 148 of file swconfig.cpp.
SWBuf SWConfig::getFileName | ( | ) | const |
|
inline |
Get a specified section from config, creating the section if needed There is no const version of this method because it returns a ConfigEntMap reference, creating the requested section if it doesn't exist.
section | section name to retrieve |
Definition at line 76 of file swconfig.h.
|
virtual |
|
inline |
Definition at line 57 of file swconfig.h.
get a value from a [section] key=value
section | the section name containing the key |
key | the key to which the value is associated |
Definition at line 102 of file swconfig.h.
|
virtual |
Load the content from datastore
Definition at line 55 of file swconfig.cpp.
|
inline |
|
inline |
This operator provides a conventient syntax to get and store config values
config[section][key] = value; value = config[section][key];
The following will work:
Definition at line 91 of file swconfig.h.
|
virtual |
Save the content of this config object to the datastore
Definition at line 115 of file swconfig.cpp.
|
inline |
set a value for a specified key in a [section]
section | the section name to contain the key |
key | the key to which to associate the value |
value | the value to associated with the key |
Definition at line 111 of file swconfig.h.
SWDEPRECATED SWBuf SWConfig::filename |
Definition at line 130 of file swconfig.h.
SWDEPRECATED SectionMap SWConfig::Sections |
Definition at line 125 of file swconfig.h.