4 #include <unordered_map>
10 using std::unordered_map;
40 inline const string&
get(
const string& key,
const string& defaultValue)
const {
42 if (it ==
properties.end())
return defaultValue;
52 inline void put(
const string& key,
const string& value) {
62 void load(
const string& pathName,
const string& fileName);
70 void store(
const string& pathName,
const string& fileName)
const;
Properties class, which helps out with storeing or loading key value pairs from/to property files.
void put(const string &key, const string &value)
Add property.
const string & get(const string &key, const string &defaultValue) const
Get property value by key.
void store(const string &pathName, const string &fileName) const
Store property file.
const unordered_map< string, string > & getProperties()
void load(const string &pathName, const string &fileName)
Load property file.
unordered_map< string, string > properties
Properties()
Public constructor.