sword::SWConfig Class Reference

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

#include <swconfig.h>

Collaboration diagram for sword::SWConfig:

Collaboration graph
[legend]
List of all members.

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 SWConfigoperator+= (SWConfig &addFrom)
virtual ConfigEntMapoperator[] (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)

Detailed Description

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

Definition at line 40 of file swconfig.h.


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

virtual 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.

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 documentation for this class was generated from the following file: