diff options
author | Kitzunu <24550914+Kitzunu@users.noreply.github.com> | 2021-05-31 14:21:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 14:21:54 +0200 |
commit | 897a02bb75ec759f1052fc54332441c12da83cb8 (patch) | |
tree | 64c766466f94f050cf32e7fee1c2f7d6834362d5 /src/common/Configuration/Config.cpp | |
parent | 7eeae6866e70456b6d4806d62fac4d27fbf5c3c7 (diff) |
refactor(Core/Misc): acore to Acore (#6043)
Diffstat (limited to 'src/common/Configuration/Config.cpp')
-rw-r--r-- | src/common/Configuration/Config.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp index a7aa1ccb78..6bfc88e259 100644 --- a/src/common/Configuration/Config.cpp +++ b/src/common/Configuration/Config.cpp @@ -41,7 +41,7 @@ namespace template<typename Format, typename... Args> inline void PrintError(std::string_view filename, Format&& fmt, Args&& ... args) { - std::string message = acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...); + std::string message = Acore::StringFormat(std::forward<Format>(fmt), std::forward<Args>(args)...); if (IsAppConfig(filename)) { @@ -76,7 +76,7 @@ namespace if (in.fail()) { - throw ConfigException(acore::StringFormat("Config::LoadFile: Failed open file '%s'", file.c_str())); + throw ConfigException(Acore::StringFormat("Config::LoadFile: Failed open file '%s'", file.c_str())); } uint32 count = 0; @@ -104,11 +104,11 @@ namespace // read line error if (!in.good() && !in.eof()) { - throw ConfigException(acore::StringFormat("> Config::LoadFile: Failure to read line number %u in file '%s'", lineNumber, file.c_str())); + throw ConfigException(Acore::StringFormat("> Config::LoadFile: Failure to read line number %u in file '%s'", lineNumber, file.c_str())); } // remove whitespace in line - line = acore::String::Trim(line, in.getloc()); + line = Acore::String::Trim(line, in.getloc()); if (line.empty()) { @@ -135,8 +135,8 @@ namespace continue; } - auto entry = acore::String::Trim(line.substr(0, equal_pos), in.getloc()); - auto value = acore::String::Trim(line.substr(equal_pos + 1, std::string::npos), in.getloc()); + auto entry = Acore::String::Trim(line.substr(0, equal_pos), in.getloc()); + auto value = Acore::String::Trim(line.substr(equal_pos + 1, std::string::npos), in.getloc()); value.erase(std::remove(value.begin(), value.end(), '"'), value.end()); @@ -153,7 +153,7 @@ namespace // No lines read if (!count) - throw ConfigException(acore::StringFormat("Config::LoadFile: Empty file '%s'", file.c_str())); + throw ConfigException(Acore::StringFormat("Config::LoadFile: Empty file '%s'", file.c_str())); // Add correct keys if file load without errors for (auto const& [entry, key] : fileConfigs) @@ -214,19 +214,19 @@ T ConfigMgr::GetValueDefault(std::string const& name, T const& def, bool showLog if (showLogs) { LOG_ERROR("server", "> Config: Missing name %s in config, add \"%s = %s\"", - name.c_str(), name.c_str(), acore::ToString(def).c_str()); + name.c_str(), name.c_str(), Acore::ToString(def).c_str()); } return def; } - auto value = acore::StringTo<T>(itr->second); + auto value = Acore::StringTo<T>(itr->second); if (!value) { if (showLogs) { LOG_ERROR("server", "> Config: Bad value defined for name '%s', going to use '%s' instead", - name.c_str(), acore::ToString(def).c_str()); + name.c_str(), Acore::ToString(def).c_str()); } return def; @@ -264,7 +264,7 @@ bool ConfigMgr::GetOption<bool>(std::string const& name, bool const& def, bool s { std::string val = GetValueDefault(name, std::string(def ? "1" : "0"), showLogs); - auto boolVal = acore::StringTo<bool>(val); + auto boolVal = Acore::StringTo<bool>(val); if (!boolVal) { if (showLogs) |