StConfigFile Class Reference

This class allows creation and management of config files. More...

#include <stconfigfile.h>

List of all members.

Public Member Functions

 StConfigFile ()
bool load (const StFile &file)
bool save (const StFile &file)
StString get (const StString &section, const StString &key)
void set (const StString &section, const StString &key, const StString &value)

Private Member Functions

int findSection (const StString &name)
int findKey (const StString &name, int sectionIndex)

Private Attributes

StValueList< Sectionsections

Classes

struct  Key
struct  Section


Detailed Description

This class allows creation and management of config files.

You can load a config file, change or add sections or key values, and save it.


Constructor & Destructor Documentation

StConfigFile::StConfigFile (  )  [inline]


Member Function Documentation

int StConfigFile::findKey ( const StString name,
int  sectionIndex 
) [private]

int StConfigFile::findSection ( const StString name  )  [private]

StString StConfigFile::get ( const StString section,
const StString key 
)

Parameters:
section the section which includes the key
key the key whose value you want to read.
Returns:
value of the key

bool StConfigFile::load ( const StFile file  ) 

Load a file to the list.

bool StConfigFile::save ( const StFile file  ) 

Save a list to the file.

void StConfigFile::set ( const StString section,
const StString key,
const StString value 
)

Set the key's value in a given section to the list.

Parameters:
section the section where you want to set the key's value.
key the name of the key.
value the key's value.


Member Data Documentation

StValueList<Section> StConfigFile::sections [private]

List of sections which include list of keys.


The documentation for this class was generated from the following files:
Generated on Tue Nov 14 21:15:09 2006 for Smart Tools Library by  doxygen 1.4.7