[Auth\Worldserver] Use boost to load console arguments. (Added a few style changes and cmake fix)

Conflicts:
	src/server/worldserver/Main.cpp
This commit is contained in:
Chaplain
2014-07-15 17:46:09 +02:00
committed by leak
parent ecde28d1c1
commit 68398a559e
6 changed files with 102 additions and 108 deletions

View File

@@ -25,10 +25,8 @@
using namespace boost::property_tree;
bool ConfigMgr::LoadInitial(char const* file)
bool ConfigMgr::LoadInitial(std::string const& file)
{
ASSERT(file);
std::lock_guard<std::mutex> lock(_configLock);
_filename = file;
@@ -57,7 +55,7 @@ bool ConfigMgr::Reload()
return LoadInitial(_filename.c_str());
}
std::string ConfigMgr::GetStringDefault(const char* name, const std::string& def)
std::string ConfigMgr::GetStringDefault(std::string const& name, const std::string& def)
{
std::string value = _config.get<std::string>(ptree::path_type(name, '/'), def);
@@ -66,7 +64,7 @@ std::string ConfigMgr::GetStringDefault(const char* name, const std::string& def
return value;
}
bool ConfigMgr::GetBoolDefault(const char* name, bool def)
bool ConfigMgr::GetBoolDefault(std::string const& name, bool def)
{
try
{
@@ -80,12 +78,12 @@ bool ConfigMgr::GetBoolDefault(const char* name, bool def)
}
}
int ConfigMgr::GetIntDefault(const char* name, int def)
int ConfigMgr::GetIntDefault(std::string const& name, int def)
{
return _config.get<int>(ptree::path_type(name, '/'), def);
}
float ConfigMgr::GetFloatDefault(const char* name, float def)
float ConfigMgr::GetFloatDefault(std::string const& name, float def)
{
return _config.get<float>(ptree::path_type(name, '/'), def);
}