diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-07-31 17:12:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 17:12:09 +0200 |
commit | 5ad064976edfc931cdda6faffe723d7c3dfb0ae4 (patch) | |
tree | dbd0570b7bd6dcc9f6f4e80ad940acbe7c86c567 /src/common/Configuration/Config.h | |
parent | e3aa87641f08ecaa42ebef1915d7de88dc73ef25 (diff) |
Core/Common: Allow config settings to be loaded as optional (PR #25137)
If the config setting is not present, returns the default without issuing a warning.
Diffstat (limited to 'src/common/Configuration/Config.h')
-rw-r--r-- | src/common/Configuration/Config.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/Configuration/Config.h b/src/common/Configuration/Config.h index fc39d9c97b2..9f348f063ee 100644 --- a/src/common/Configuration/Config.h +++ b/src/common/Configuration/Config.h @@ -37,10 +37,10 @@ public: bool Reload(std::string& error); - std::string GetStringDefault(std::string const& name, const std::string& def) const; - bool GetBoolDefault(std::string const& name, bool def) const; - int GetIntDefault(std::string const& name, int def) const; - float GetFloatDefault(std::string const& name, float def) const; + std::string GetStringDefault(std::string const& name, const std::string& def, bool quiet = false) const; + bool GetBoolDefault(std::string const& name, bool def, bool quiet = false) const; + int GetIntDefault(std::string const& name, int def, bool quiet = false) const; + float GetFloatDefault(std::string const& name, float def, bool quiet = false) const; std::string const& GetFilename(); std::vector<std::string> const& GetArguments() const; @@ -48,7 +48,7 @@ public: private: template<class T> - T GetValueDefault(std::string const& name, T def) const; + T GetValueDefault(std::string const& name, T def, bool quiet) const; }; #define sConfigMgr ConfigMgr::instance() |