Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SWConfig Class Reference

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

#include <swconfig.h>

List of all members.

Public Methods

 SWConfig (const char *ifilename)
 Constructor of SWConfig. More...

virtual ~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 SWConfig& operator+= (SWConfig &addFrom)
 Merges the values of addFrom. More...

virtual ConfigEntMap& operator[] (const char *section)
 Get a section This is an easy way to get and store config values. More...


Public Attributes

string filename
 The filename used by this SWConfig object.

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


Private Methods

char getline (FILE *fp, string &line)


Detailed Description

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

Definition at line 56 of file swconfig.h.


Constructor & Destructor Documentation

SWConfig::SWConfig ( const char * ifilename )
 

Constructor of SWConfig.

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


Member Function Documentation

SWConfig & SWConfig::operator+= ( SWConfig & addFrom ) [virtual]
 

Merges the values of addFrom.

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

ConfigEntMap & 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 documentation for this class was generated from the following file:
Generated at Fri Oct 5 22:45:36 2001 for The Sword Project by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001