mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Core/Common: Add a generic config helper to access built-in overwriteable paths.
* Adds CMAKE_COMMAND and CMAKE_BINARY_DIR to revision_data.h * Move the source and mysql exe path handling out of the DBUpdater. * Make some Config methods const for correctness. * Remove C & CXX flags from revision_data.h (was unused and didn't capture all cxx vars) * Reorder the link order to prevent `ld` from ignoring the file * Ref #15671
This commit is contained in:
@@ -62,7 +62,7 @@ bool ConfigMgr::Reload(std::string& error)
|
||||
return LoadInitial(_filename, error);
|
||||
}
|
||||
|
||||
std::string ConfigMgr::GetStringDefault(std::string const& name, const std::string& def)
|
||||
std::string ConfigMgr::GetStringDefault(std::string const& name, const std::string& def) const
|
||||
{
|
||||
std::string value = _config.get<std::string>(ptree::path_type(name, '/'), def);
|
||||
|
||||
@@ -71,7 +71,7 @@ std::string ConfigMgr::GetStringDefault(std::string const& name, const std::stri
|
||||
return value;
|
||||
}
|
||||
|
||||
bool ConfigMgr::GetBoolDefault(std::string const& name, bool def)
|
||||
bool ConfigMgr::GetBoolDefault(std::string const& name, bool def) const
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -85,12 +85,12 @@ bool ConfigMgr::GetBoolDefault(std::string const& name, bool def)
|
||||
}
|
||||
}
|
||||
|
||||
int ConfigMgr::GetIntDefault(std::string const& name, int def)
|
||||
int ConfigMgr::GetIntDefault(std::string const& name, int def) const
|
||||
{
|
||||
return _config.get<int>(ptree::path_type(name, '/'), def);
|
||||
}
|
||||
|
||||
float ConfigMgr::GetFloatDefault(std::string const& name, float def)
|
||||
float ConfigMgr::GetFloatDefault(std::string const& name, float def) const
|
||||
{
|
||||
return _config.get<float>(ptree::path_type(name, '/'), def);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user