The Sword Project: sword::SWConfig Class Reference |
#include <swconfig.h>
Collaboration diagram for sword::SWConfig:
Public Member Functions | |
SWConfig (const char *ifilename) | |
Constructor of SWConfig. | |
virtual void | Load () |
Load from disk Load the content from disk. | |
virtual void | Save () |
Save to disk Save the content of this config object to disk. | |
virtual void | augment (SWConfig &addFrom) |
Merges the values of addFrom. | |
virtual SWConfig & | operator+= (SWConfig &addFrom) |
virtual ConfigEntMap & | operator[] (const char *section) |
Get a section This is an easy way to get and store config values. | |
Public Attributes | |
SWBuf | filename |
The filename used by this SWConfig object. | |
SectionMap | Sections |
Map of available sections The map of available sections. | |
Private Member Functions | |
char | getline (int fd, SWBuf &line) |
Definition at line 40 of file swconfig.h.
sword::SWConfig::SWConfig | ( | const char * | ifilename | ) |
virtual void sword::SWConfig::augment | ( | SWConfig & | addFrom | ) | [virtual] |
Merges the values of addFrom.
addFrom | The config which values should be merged to this config object. Already existing values will be overwritten. |
virtual ConfigEntMap& sword::SWConfig::operator[] | ( | const char * | section | ) | [virtual] |
Get a section This is an easy way to get and store config values.
The following will work:
SWConfig config("/home/user/.setttings"); config["Colors"]["Background"] = "red";
The SWORD Project; P. O. Box 2528; Tempe, AZ 85280-2528 USA |