$search
Handle configuration files. More...
#include <config.h>
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. |
Handle configuration files.
Definition at line 97 of file config.h.
Constructor.
Definition at line 66 of file config.cpp.
bool Config::add | ( | const std::string & | section, | |
const std::string & | parameter, | |||
const T & | value | |||
) | [inline] |
void Config::clear | ( | ) |
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 |
void Config::print | ( | ) |
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 |
bool Config::select | ( | const std::string & | section, | |
const std::string & | parameter, | |||
T & | value | |||
) | const [inline] |
short Config::write_conf | ( | std::ofstream & | outconffile, | |
const std::string & | file_title, | |||
const int | space_between_column | |||
) |
bool Config::bPrintErrorMessages [private] |
Conf_data Config::conf [private] |