AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Config.cpp File Reference
#include "Config.h"
#include "Log.h"
#include "StringConvert.h"
#include "StringFormat.h"
#include "Tokenize.h"
#include "Util.h"
#include <fstream>
#include <mutex>
#include <unordered_map>

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{Config.cpp}
 

Macros

#define TEMPLATE_CONFIG_OPTION(__typename)    template __typename ConfigMgr::GetOption<__typename>(std::string const& name, __typename const& def, bool showLogs /*= true*/) const;
 

Functions

bool anonymous_namespace{Config.cpp}::IsAppConfig (std::string_view fileName)
 
bool anonymous_namespace{Config.cpp}::IsLoggingSystemOptions (std::string_view optionName)
 
template<typename Format , typename... Args>
void anonymous_namespace{Config.cpp}::PrintError (std::string_view filename, Format &&fmt, Args &&... args)
 
void anonymous_namespace{Config.cpp}::AddKey (std::string const &optionName, std::string const &optionKey, std::string_view fileName, bool isOptional, bool isReload)
 
bool anonymous_namespace{Config.cpp}::ParseFile (std::string const &file, bool isOptional, bool isReload)
 
bool anonymous_namespace{Config.cpp}::LoadFile (std::string const &file, bool isOptional, bool isReload)
 
template<>
std::string ConfigMgr::GetValueDefault< std::string > (std::string const &name, std::string const &def, bool showLogs) const
 

Variables

std::string anonymous_namespace{Config.cpp}::_filename
 
std::vector< std::string > anonymous_namespace{Config.cpp}::_additonalFiles
 
std::vector< std::string > anonymous_namespace{Config.cpp}::_args
 
std::unordered_map< std::string, std::string > anonymous_namespace{Config.cpp}::_configOptions
 
std::mutex anonymous_namespace{Config.cpp}::_configLock
 

Macro Definition Documentation

◆ TEMPLATE_CONFIG_OPTION

#define TEMPLATE_CONFIG_OPTION (   __typename)     template __typename ConfigMgr::GetOption<__typename>(std::string const& name, __typename const& def, bool showLogs /*= true*/) const;

Function Documentation

◆ ConfigMgr::GetValueDefault< std::string >()

template<>
std::string ConfigMgr::GetValueDefault< std::string > ( std::string const &  name,
std::string const &  def,
bool  showLogs 
) const
281{
282 auto const& itr = _configOptions.find(name);
283 if (itr == _configOptions.end())
284 {
285 if (showLogs)
286 {
287 LOG_ERROR("server.loading", "> Config: Missing property {} in config file {}, add \"{} = {}\" to this file.",
288 name, _filename, name, def);
289 }
290
291 return def;
292 }
293
294 return itr->second;
295}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
std::unordered_map< std::string, std::string > _configOptions
Definition: Config.cpp:33
std::string _filename
Definition: Config.cpp:30

References anonymous_namespace{Config.cpp}::_configOptions, anonymous_namespace{Config.cpp}::_filename, and LOG_ERROR.