27 #ifndef SCSL_SIMPLECONFIG_H
28 #define SCSL_SIMPLECONFIG_H
69 #if defined(SCSL_DESKTOP_BUILD)
76 static int LoadGlobal(
const char *path);
84 static int LoadGlobal(std::string &path);
92 static void SetPrefixGlobal(
const std::string &prefix);
102 static std::vector<std::string> KeyListGlobal();
111 static std::string GetGlobal(std::string &key);
120 static std::string GetGlobal(
const char *key);
132 static std::string GetGlobal(
const char *key,
const std::string &defaultValue);
144 static std::string GetGlobal(std::string &key,
const std::string &defaultValue);
148 static void PutGlobal(std::string &key,
const std::string &value);
152 static void PutGlobal(
const char *key,
const std::string &value);
193 std::string
Get(std::string &key);
200 std::string
Get(
const char *key);
210 std::string
Get(std::string &key, std::string defaultValue);
220 std::string
Get(
const char *key, std::string defaultValue);
228 void Put(std::string &key,
const std::string value);
236 void Put(
const char *key,
const std::string value);
238 std::string envPrefix;
239 std::map<std::string, std::string> vars;
SimpleConfig is a basic configuration for projects.
Definition: SimpleConfig.h:67
void Put(const char *key, const std::string value)
Set a configuration value. This will override any value set.
void Put(std::string &key, const std::string value)
Set a configuration value. This will override any value set.
std::string Get(const char *key)
Get the value stored for the key from the config.
std::string Get(std::string &key, std::string defaultValue)
Get the value stored for the key from the config.
int Load(std::string &path)
Load key-value pairs from a file.
std::string Get(std::string &key)
Get the value stored for the key from the config.
std::vector< std::string > KeyList()
Return the keys cached in the config.
std::string Get(const char *key, std::string defaultValue)
Get the value stored for the key from the config.
int Load(const char *path)
Load key-value pairs from a file.
SimpleConfig()
The constructor doesn't need any initialisation.
void SetPrefix(const std::string &prefix)
Set the prefix in use by the config.
SimpleConfig(std::string &prefix)
The constructor can explicitly set the environment prefix.
scsl is the top-level namespace containing all the code in this library.
Definition: scsl.h:43