8 #ifndef CONFIGURATION_H
9 #define CONFIGURATION_H
30 #include <libconfig.h++>
58 friend class std::auto_ptr<Configuration>;
68 void readFile(std::string configFile);
82 bool exists(std::string path);
104 bool getBool(std::string path);
136 void addSetting(std::string path, std::string name, std::string value);
146 void editSetting(std::string path, std::string name,
double value);
157 inline libconfig::Setting&
lookup(
const std::string path)
const {
158 return m_configuration.lookup(path);
161 std::string getName()
const {
162 return "Configuration";
168 virtual ~Configuration();
170 static std::auto_ptr<Configuration> m_instancePtr;
173 libconfig::Config m_configuration;
void readFile(std::string configFile)
parses configuration file configFile and loads the data into object. The configuration file needs to ...
Definition: configuration.cpp:34
bool getBool(std::string path)
retrieves the configuration value found at a given configuration path.
Definition: configuration.cpp:58
libconfig::Setting & lookup(const std::string path) const
retrieves the configuration value found at a given configuration path as a reference to a libconfig::...
Definition: configuration.h:157
void addSetting(std::string path, std::string name, std::string value)
adds the string setting named name to the configuration tree at path with the value value ...
Definition: configuration.cpp:38
double getDouble(std::string path)
retrieves the configuration value found at a given configuration path.
Definition: configuration.cpp:54
bool exists(std::string path)
determines whether a given configuration value exists.
Definition: configuration.cpp:29
void editSetting(std::string path, std::string name, double value)
modifies the string setting named name to the configuration tree at path with the value value ...
Definition: configuration.cpp:44
std::string getString(std::string path)
retrieves the configuration value found at a given configuration path.
Definition: configuration.cpp:66
int getInteger(std::string path)
retrieves the configuration value found at a given configuration path.
Definition: configuration.cpp:62
A configuration object which is populated from a configuration file and allows to query and modify co...
Definition: configuration.h:46
static Configuration & getInstance()
returns a reference to the only configuration instance
Definition: configuration.cpp:18