TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Config.cpp File Reference
#include <algorithm>
#include <mutex>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include "Config.h"
#include "Errors.h"
#include "Log.h"
+ Include dependency graph for Config.cpp:

Functions

template<>
std::string ConfigMgr::GetValueDefault< std::string > (std::string const &name, std::string def) const
 

Function Documentation

template<>
std::string ConfigMgr::GetValueDefault< std::string > ( std::string const name,
std::string  def 
) const
95 {
96  try
97  {
98  return _config.get<std::string>(ptree::path_type(name, '/'));
99  }
100  catch (boost::property_tree::ptree_bad_path)
101  {
102  TC_LOG_WARN("server.loading", "Missing name %s in config file %s, add \"%s = %s\" to this file",
103  name.c_str(), _filename.c_str(), name.c_str(), def.c_str());
104  }
105  catch (boost::property_tree::ptree_bad_data)
106  {
107  TC_LOG_ERROR("server.loading", "Bad value defined for name %s in config file %s, going to use %s instead",
108  name.c_str(), _filename.c_str(), def.c_str());
109  }
110 
111  return def;
112 }
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:204
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207