Add option to set config values.

This commit is contained in:
2023-10-23 21:09:56 -07:00
parent 28238ba041
commit 9a83cf6c08
3 changed files with 28 additions and 1 deletions

View File

@@ -121,6 +121,10 @@ public:
/// \return The value stored under the key, or the default
/// value.
static std::string GetGlobal(std::string &key, const std::string &defaultValue);
/// \brief Set a configuration value. This will override any
/// value set.
static void PutGlobal(std::string &key, const std::string &value);
#endif
/// \brief The constructor doesn't need any initialisation.
@@ -173,6 +177,15 @@ public:
/// value.
std::string Get(std::string &key, std::string defaultValue);
/// \brief Set a configuration value. This will override any
/// value set.
///
/// \param key The key to look up. See the class documentation
/// for information on how this is used.
/// \param value The value to set.
/// \return
void Put(std::string &key, const std::string value);
private:
std::string envPrefix;
std::map<std::string, std::string> vars;