PWToolBox::Configuration::INIConfigurationReader Class Reference

Loads a configuration in INI format. More...

#include <INIConfigurationReader.h>

Inheritance diagram for PWToolBox::Configuration::INIConfigurationReader:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 INIConfigurationReader (std::istream &inputStream)
virtual ~INIConfigurationReader ()
virtual void read (ConfigurationSection &configuration)
 Reads a configuration file from the input stream and puts the parsed file into configuration.

Protected Member Functions

virtual void readSection (std::string::value_type const *first, std::string::value_type const *last)
 Called when reading a section name.
virtual void readKey (std::string::value_type const *first, std::string::value_type const *last)
 Called when reading a setting name.
virtual void readValue (std::string::value_type const *first, std::string::value_type const *last)
 Called when reading a value.
virtual void readComment (std::string::value_type const *first, std::string::value_type const *last)
 Called when reading a comment.

Protected Attributes

ConfigurationSectionm_configuration
 The configuration we're reading into.
ConfigurationSetting::SharedPtr m_currentSetting
 The current setting we're working with.
std::string m_currentSection
 The name of the current section.

Detailed Description

Loads a configuration in INI format.

In this implementation, both ';' and '#' can be used for comments. Comments may be specified either on a line of their own, or following a setting or section.

Both '=' and ':' can be used for assigning values.

The hierarchy is represented by separating sections with the '.' character when specifying the section name.


Constructor & Destructor Documentation

PWToolBox::Configuration::INIConfigurationReader::INIConfigurationReader ( std::istream &  inputStream  )  [inline]

Constructs a new ConfigurationReader, which will read its input from inputStream.

Parameters:
inputStream The input stream to read from

virtual PWToolBox::Configuration::INIConfigurationReader::~INIConfigurationReader (  )  [inline, virtual]


Member Function Documentation

virtual void PWToolBox::Configuration::INIConfigurationReader::read ( ConfigurationSection configuration  )  [virtual]

Reads a configuration file from the input stream and puts the parsed file into configuration.

Parameters:
configuration The configuration section into which the settings will be placed
Exceptions:
IllegalOperationException Thrown if there was a problem parsing the stream

Implements PWToolBox::Configuration::ConfigurationReader.

virtual void PWToolBox::Configuration::INIConfigurationReader::readSection ( std::string::value_type const *  first,
std::string::value_type const *  last 
) [protected, virtual]

Called when reading a section name.

Parameters:
first A pointer to the first character in the string
last A pointer to the last character in the string

virtual void PWToolBox::Configuration::INIConfigurationReader::readKey ( std::string::value_type const *  first,
std::string::value_type const *  last 
) [protected, virtual]

Called when reading a setting name.

Parameters:
first A pointer to the first character in the string
last A pointer to the last character in the string

virtual void PWToolBox::Configuration::INIConfigurationReader::readValue ( std::string::value_type const *  first,
std::string::value_type const *  last 
) [protected, virtual]

Called when reading a value.

Parameters:
first A pointer to the first character in the string
last A pointer to the last character in the string

virtual void PWToolBox::Configuration::INIConfigurationReader::readComment ( std::string::value_type const *  first,
std::string::value_type const *  last 
) [protected, virtual]

Called when reading a comment.

Parameters:
first A pointer to the first character in the string
last A pointer to the last character in the string


Member Data Documentation

ConfigurationSection* PWToolBox::Configuration::INIConfigurationReader::m_configuration [protected]

The configuration we're reading into.

ConfigurationSetting::SharedPtr PWToolBox::Configuration::INIConfigurationReader::m_currentSetting [protected]

The current setting we're working with.

std::string PWToolBox::Configuration::INIConfigurationReader::m_currentSection [protected]

The name of the current section.


The documentation for this class was generated from the following file:
Generated on Sun Jul 13 14:18:28 2008 for PWToolBox by  doxygen 1.5.1