Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

sword::SWConfig Class Reference

The class to read and save settings using a file on disk. More...

#include <swconfig.h>

List of all members.

Public Member Functions

 SWConfig (const char *ifilename)
 Constructor of SWConfig.

virtual void Load ()
 Load from disk Load the contzent 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

std::string filename
 The filename used by this SWConfig object.

SectionMap Sections
 Map of available sections The map of available sections.


Private Member Functions

char getline (FILE *fp, std::string &line)


Detailed Description

The class to read and save settings using a file on disk.


Constructor & Destructor Documentation

sword::SWConfig::SWConfig const char *    ifilename
 

Constructor of SWConfig.

Parameters:
ifilename The file, which should be used for this config.


Member Function Documentation

void sword::SWConfig::augment SWConfig &    addFrom [virtual]
 

Merges the values of addFrom.

Parameters:
addFrom The config which values should be merged to this config object. Already existing values will be overwritten.

void sword::SWConfig::Load   [virtual]
 

Load from disk Load the contzent from disk.

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";
 

void sword::SWConfig::Save   [virtual]
 

Save to disk Save the content of this config object to disk.


Member Data Documentation

std::string sword::SWConfig::filename
 

The filename used by this SWConfig object.

SectionMap sword::SWConfig::Sections
 

Map of available sections The map of available sections.


The documentation for this class was generated from the following files:
Generated on Fri Feb 28 22:01:43 2003 for The Sword Project by doxygen1.3-rc3