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);
123 static std::string GetGlobal(std::string &key,
const std::string &defaultValue);
164 std::string
Get(std::string &key);
174 std::string
Get(std::string &key, std::string defaultValue);
177 std::string envPrefix;
178 std::map<std::string, std::string> vars;
SimpleConfig is a basic configuration for projects.
Definition SimpleConfig.h:67
std::vector< std::string > KeyList()
Return the keys cached in 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.
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