19 #include <boost/algorithm/string.hpp>
32 LOG(
DEBUG) <<
"WsGlobalProperties :: Created instance";
42 cerr <<
"ERROR: WsGlobalProperties :: Could not parse main wittyshare-global.json file... Exiting application" << endl;
47 if (val == Value::null)
49 else return val.asString();
56 cerr <<
"ERROR: WsGlobalProperties :: Could not parse main wittyshare-global.json file... Exiting application";
61 if (val == Value::null)
64 string r = val.asString();
65 boost::replace_all(r,
"$1", newVal);
74 cerr <<
"ERROR: WsGlobalProperties :: Could not parse main wittyshare-global.json file... Exiting application";
77 m_root[section][key] = value;
int parse(const std::string &path)
parse the Json config file
const std::string GlobalPropertiesPath
static WsGlobalProperties * m_instance
WsGlobalProperties()
Constructor.
Abstract Properties class.
std::string get(const std::string §ion, const std::string &id, const std::string &def)
static WsGlobalProperties * instance()
void set(const std::string §ion, std::string key, std::string value)
Changes or sets the propety with key 'key' to value 'value' If the property already exist...
std::string getAndReplace(const std::string §ion, const std::string &id, const std::string &newVal, const std::string &def)
Search for property id and replaces the $1 in the string with newVal. If the property is not found...