#include <INIConfigurationReader.h>
Inheritance diagram for PWToolBox::Configuration::INIConfigurationReader:
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 | |
| ConfigurationSection * | m_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. | |
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.
| PWToolBox::Configuration::INIConfigurationReader::INIConfigurationReader | ( | std::istream & | inputStream | ) | [inline] |
Constructs a new ConfigurationReader, which will read its input from inputStream.
| inputStream | The input stream to read from |
| virtual PWToolBox::Configuration::INIConfigurationReader::~INIConfigurationReader | ( | ) | [inline, virtual] |
| virtual void PWToolBox::Configuration::INIConfigurationReader::read | ( | ConfigurationSection & | configuration | ) | [virtual] |
Reads a configuration file from the input stream and puts the parsed file into configuration.
| configuration | The configuration section into which the settings will be placed |
| 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.
| 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.
| 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.
| 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.
| first | A pointer to the first character in the string | |
| last | A pointer to the last character in the string |
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.
1.5.1