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

MCIniSection Class Reference

Implementation of an initialization section (ini section for short). More...

#include <mcllib/MCIniSection.h>

Inheritance diagram for MCIniSection:

MCBase List of all members.

Public Member Functions

bool exists (const MCString &key) const
 Return true if key exists in the ini section.
const MCStringget (const MCString &key) const
 Get a value for given a key.
 MCIniSection (const MCString &sectionName)
 Construct an ini section named sectionName.
 MCIniSection ()
 Construct an empty unnamed ini section.
MCStringoperator[] (const MCString &key)
 Get a reference to the current value for a key.
void set (const MCString &key, const MCString &value)
 Set a key/value pair in the ini section.

Detailed Description

Implementation of an initialization section (ini section for short).

Objects of this class are intended to be constructed by ini files rather than directly by the application.

Refer to MCIniFile for further information.

This class is intentionally not thread safe for performance reasons. To be thread safe, lock a mutex before accessing its member functions.


Member Function Documentation

const MCString& get const MCString key  )  const
 

Get a value for given a key.

If the key does not exist in the ini section then an exception is thrown.

MCString& operator[] const MCString key  ) 
 

Get a reference to the current value for a key.

If the key does not already exist in the ini section it will be created and a reference to the new (empty) value will be returned. This allows array-like access to the ini section to both get and set values.

void set const MCString key,
const MCString value
 

Set a key/value pair in the ini section.

If key already exists in the ini section its current value (if any) is discarded and replaced with the new value.


Generated on Wed Jan 12 19:05:49 2005 for MCLLIB by  doxygen 1.3.9.1