The configuration file section information.
More...
List of all members.
Public Member Functions |
void | add (const std::string ¶m, const std::string &value) |
| Adds new parameter and its value to the section.
|
| ConfigFileSection () |
| The default constructor.
|
| ConfigFileSection (const std::string &name) |
| The constructor with configuration file section name specification.
|
std::string | getName () const |
| Returns configuration file section name.
|
bool | has (const std::string &name) const |
| Checks if the section has specified parameter.
|
std::string | operator[] (const std::string &name) const |
| Returns parameter value.
|
void | setName (const std::string &name) |
| Sets new configuration file section name.
|
virtual | ~ConfigFileSection () |
| The destructor.
|
Detailed Description
This class stores everything about one configuration file section. It consists of section name and the map from parameter key to parameter value.
- See also:
- ConfigFile
Constructor & Destructor Documentation
ConfigFileSection::ConfigFileSection |
( |
const std::string & |
name | ) |
[inline] |
- Parameters:
-
[in] | name | The name of new configuration file section |
Member Function Documentation
void ConfigFileSection::add |
( |
const std::string & |
param, |
|
|
const std::string & |
value |
|
) |
| [inline] |
Use this method to add new value to the section map.
- Parameters:
-
[in] | param | The name of the parameter to add |
[in] | value | The value of the parameter to add |
std::string ConfigFileSection::getName |
( |
| ) |
const [inline] |
Use this method to get name of this section.
- Returns:
- The string with section name
bool ConfigFileSection::has |
( |
const std::string & |
name | ) |
const [inline] |
This method allows you be sure the specified parameter is present in this section and its value is accessible.
- Parameters:
-
[in] | name | The name of parameter to check |
- Returns:
- Non-zero if specified parameter is present in this section
std::string ConfigFileSection::operator[] |
( |
const std::string & |
name | ) |
const [inline] |
Use this method to get parameter value, but be careful, this method does not have any special value to notify about an error. If there is no such value it returns an empty string. But it can happen either in case of value exists and is empty or in case of there is no such value at all.
- Parameters:
-
[in] | name | The name of an existing parameter to get value of |
- Returns:
- The string with requested value
void ConfigFileSection::setName |
( |
const std::string & |
name | ) |
[inline] |
Use this method to set new configuration file name.
- Parameters:
-