Global properties class.
More...
#include <WsGlobalProperties.h>
|
std::string | get (const std::string §ion, const std::string &id, const std::string &def) |
|
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, it will be overriden This method does not however, update the config file. More...
|
|
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, def will be returned. More...
|
|
Global properties class.
Contains settings for running wittyshare
Definition at line 26 of file WsGlobalProperties.h.
WsGlobalProperties::WsGlobalProperties |
( |
| ) |
|
|
protected |
std::string WsGlobalProperties::get |
( |
const std::string & |
section, |
|
|
const std::string & |
id, |
|
|
const std::string & |
def |
|
) |
| |
|
virtual |
std::string WsGlobalProperties::getAndReplace |
( |
const std::string & |
section, |
|
|
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, def will be returned.
- Parameters
-
section | the section in the Json file |
id | the key in the Json file |
newVal | the value that will replace the $1 |
def | the default value returned if not found |
- Returns
- the value with $1 replaced with newVal or def otherwise
Definition at line 52 of file WsGlobalProperties.cpp.
int WsAbstractProperties::parse |
( |
const std::string & |
path | ) |
|
|
protectedinherited |
parse the Json config file
- Parameters
-
path | the path to the configuration file |
- Returns
- SUCCESS if file is ok, FAILURE otherwise
Definition at line 28 of file WsAbstractProperties.cpp.
void WsGlobalProperties::set |
( |
const std::string & |
section, |
|
|
std::string |
key, |
|
|
std::string |
value |
|
) |
| |
Changes or sets the propety with key 'key' to value 'value' If the property already exist, it will be overriden This method does not however, update the config file.
- Parameters
-
key | the key in the Json file |
value | the value assigned to the key |
Definition at line 70 of file WsGlobalProperties.cpp.
bool WsAbstractProperties::m_parsed |
|
protectedinherited |
Json::Value WsAbstractProperties::m_root |
|
protectedinherited |
Root of the Json tree where. This is where the contents of Json parsed file is stored
Definition at line 60 of file WsAbstractProperties.h.
The documentation for this class was generated from the following files: