1 #ifndef CONFIGSETTINGS_H
3 #define CONFIGSETTINGS_H
30 bool load(
const std::string &fileName);
36 void getKeys(std::vector<std::string> &keys)
const;
40 bool getKeyValue(
const std::string &key, std::string &value,
const std::vector<std::string> &allowedValues = std::vector<std::string>() );
45 bool getKeyValue(
const std::string &key,
double &value,
double minValue = -std::numeric_limits<double>::max(),
46 double maxValue = std::numeric_limits<double>::max());
50 bool getKeyValue(
const std::string &key,
int &value,
int minValue = std::numeric_limits<int>::min(),
51 int maxValue = std::numeric_limits<int>::max());
53 bool getStringKeyValue(
const std::string &key, std::string &value,
bool &used)
const;
65 std::map<std::string, std::pair<std::string, bool> > m_keyValues;
68 #endif // CONFIGSETTINGS_H
void getUnusedKeys(std::vector< std::string > &keys) const
Stores a list of keys that have not been read by any of the getKeyValue functions into keys (allows y...
Definition: configsettings.cpp:114
Base class which allows an error message to be set.
Definition: errorbase.h:49
void clear()
Clears the loaded key/value pairs.
Definition: configsettings.cpp:46
Helper class to read configuration settings, more advanced than ConfigReader.
Definition: configsettings.h:20
void getKeys(std::vector< std::string > &keys) const
Returns a list of all the keys in the read config file.
Definition: configsettings.cpp:51
void clearUsageFlags()
Resets the markers that keep track of wether or not a key has been read.
Definition: configsettings.cpp:177
bool load(const std::string &fileName)
Loads the key/value pairs from the config file specified by fileName.
Definition: configsettings.cpp:15
void merge(const ConfigSettings &src)
Merges the specified config settings object into the current one.
Definition: configsettings.cpp:188
bool getKeyValue(const std::string &key, std::string &value, const std::vector< std::string > &allowedValues=std::vector< std::string >())
Stores the string value for key parameter key into argument value, checking if the value is one of th...