Public Member Functions | |
void | add (const std::string ¶m, const std::string &value) |
Adds new parameter and its value to the section. | |
ConfigFileSection (const std::string &name) | |
The constructor with configuration file section name specification. | |
ConfigFileSection () | |
The default constructor. | |
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. |
ConfigFileSection::ConfigFileSection | ( | const std::string & | name | ) | [inline] |
[in] | name | The name of new configuration file section |
void ConfigFileSection::add | ( | const std::string & | param, | |
const std::string & | value | |||
) | [inline] |
Use this method to add new value to the section map.
[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.
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.
[in] | name | The name of parameter to check |
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.
[in] | name | The name of an existing parameter to get value of |
void ConfigFileSection::setName | ( | const std::string & | name | ) | [inline] |
Use this method to set new configuration file name.
[in] | name | The name to set |