1 #ifndef CONFIGSETTINGS_H
3 #define CONFIGSETTINGS_H
37 void getKeys(std::vector<std::string> &keys)
const;
41 bool_t getKeyValue(
const std::string &key, std::string &value,
const std::vector<std::string> &allowedValues = std::vector<std::string>() );
46 bool_t getKeyValue(
const std::string &key,
double &value,
double minValue = -std::numeric_limits<double>::infinity(),
47 double maxValue = std::numeric_limits<double>::infinity());
53 double minValue = -std::numeric_limits<double>::infinity(),
54 double maxValue = std::numeric_limits<double>::infinity());
58 bool_t getKeyValue(
const std::string &key,
int &value,
int minValue = std::numeric_limits<int>::min(),
59 int maxValue = std::numeric_limits<int>::max());
63 bool_t getKeyValue(
const std::string &key, int64_t &value, int64_t minValue = std::numeric_limits<int64_t>::min(),
64 int64_t maxValue = std::numeric_limits<int64_t>::max());
83 std::map<std::string, std::pair<std::string, bool> > m_keyValues;
86 #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:113
bool_t load(const std::string &fileName)
Loads the key/value pairs from the config file specified by fileName.
Definition: configsettings.cpp:19
Type to return true/false with error description.
Definition: booltype.h:25
bool_t 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...
void clear()
Clears the loaded key/value pairs.
Definition: configsettings.cpp:45
Helper class to read configuration settings, more advanced than ConfigReader.
Definition: configsettings.h:21
void getKeys(std::vector< std::string > &keys) const
Returns a list of all the keys in the read config file.
Definition: configsettings.cpp:50
void clearUsageFlags()
Resets the markers that keep track of wether or not a key has been read.
Definition: configsettings.cpp:177
bool_t getStringKeyValue(const std::string &key, std::string &value, bool &used) const
Obtains the value for the specified key, not marking the key as used, but instead storing information...
Definition: configsettings.cpp:62
void merge(const ConfigSettings &src)
Merges the specified config settings object into the current one.
Definition: configsettings.cpp:188