Config Class Reference
Handle configuration files.
More...
#include <config.h>
List of all members.
Public Member Functions |
template<typename T > |
bool | add (const std::string §ion, const std::string ¶meter, const T &value) |
| Added the value(string) of the parameter in the section in the configuration data. The functions will added the parameter and the section if it does not already exist.
|
void | clear () |
| Clear the data buffer.
|
| Config (const bool bPrintErrorMessages=true) |
| Constructor.
|
bool | parameter_exists (const std::string §ion, const std::string ¶meter) const |
void | print () |
| Print the configuration data.
|
short | read_conf (std::ifstream &inconffile) |
bool | section_exists (const std::string §ion) const |
template<typename T > |
bool | select (const std::string §ion, const std::string ¶meter, T &value) const |
| Get a parameter data, of a certain section, into the string value.
|
short | write_conf (std::ofstream &outconffile, const std::string &file_title, const int space_between_column) |
Private Attributes |
bool | bPrintErrorMessages |
| Print error messages on stderr.
|
Conf_data | conf |
| Data store from/to configuration file.
|
Detailed Description
Handle configuration files.
Definition at line 97 of file config.h.
Constructor & Destructor Documentation
Config::Config |
( |
const bool |
bPrintErrorMessages = true |
) |
|
Member Function Documentation
template<typename T >
bool Config::add |
( |
const std::string & |
section, |
|
|
const std::string & |
parameter, |
|
|
const T & |
value | |
|
) |
| | [inline] |
Added the value(string) of the parameter in the section in the configuration data. The functions will added the parameter and the section if it does not already exist.
Definition at line 137 of file config.h.
Clear the data buffer.
Definition at line 178 of file config.cpp.
bool Config::parameter_exists |
( |
const std::string & |
section, |
|
|
const std::string & |
parameter | |
|
) |
| | const |
Print the configuration data.
Definition at line 184 of file config.cpp.
short Config::read_conf |
( |
std::ifstream & |
inconffile |
) |
|
bool Config::section_exists |
( |
const std::string & |
section |
) |
const |
template<typename T >
bool Config::select |
( |
const std::string & |
section, |
|
|
const std::string & |
parameter, |
|
|
T & |
value | |
|
) |
| | const [inline] |
Get a parameter data, of a certain section, into the string value.
- Returns:
- false if the data can not be found and true otherwise.
Definition at line 109 of file config.h.
short Config::write_conf |
( |
std::ofstream & |
outconffile, |
|
|
const std::string & |
file_title, |
|
|
const int |
space_between_column | |
|
) |
| | |
Member Data Documentation
Print error messages on stderr.
Definition at line 190 of file config.h.
Data store from/to configuration file.
Definition at line 189 of file config.h.
The documentation for this class was generated from the following files: