TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ConfigMgr Class Reference

#include <Config.h>

Public Member Functions

bool LoadInitial (std::string file, std::vector< std::string > args, std::string &error)
 Method used only for loading main configuration files (authserver.conf and worldserver.conf) More...
 
bool LoadAdditionalFile (std::string file, bool keepOnReload, std::string &error)
 
bool LoadAdditionalDir (std::string const &dir, bool keepOnReload, std::vector< std::string > &loadedFiles, std::vector< std::string > &errors)
 
std::vector< std::string > OverrideWithEnvVariablesIfAny ()
 Overrides configuration with environment variables and returns overridden keys. More...
 
bool Reload (std::vector< std::string > &errors)
 
std::string GetStringDefault (std::string const &name, const std::string &def, bool quiet=false) const
 
bool GetBoolDefault (std::string const &name, bool def, bool quiet=false) const
 
int GetIntDefault (std::string const &name, int def, bool quiet=false) const
 
float GetFloatDefault (std::string const &name, float def, bool quiet=false) const
 
std::string const & GetFilename ()
 
std::vector< std::string > const & GetArguments () const
 
std::vector< std::string > GetKeysByString (std::string const &name)
 

Static Public Member Functions

static ConfigMgrinstance ()
 

Private Member Functions

 ConfigMgr ()=default
 
 ConfigMgr (ConfigMgr const &)=delete
 
ConfigMgroperator= (ConfigMgr const &)=delete
 
 ~ConfigMgr ()=default
 
template<class T >
GetValueDefault (std::string const &name, T def, bool quiet) const
 

Detailed Description

Definition at line 26 of file Config.h.

Constructor & Destructor Documentation

◆ ConfigMgr() [1/2]

ConfigMgr::ConfigMgr ( )
privatedefault

◆ ConfigMgr() [2/2]

ConfigMgr::ConfigMgr ( ConfigMgr const &  )
privatedelete

◆ ~ConfigMgr()

ConfigMgr::~ConfigMgr ( )
privatedefault

Member Function Documentation

◆ GetArguments()

std::vector< std::string > const & ConfigMgr::GetArguments ( ) const

Definition at line 354 of file Config.cpp.

◆ GetBoolDefault()

bool ConfigMgr::GetBoolDefault ( std::string const &  name,
bool  def,
bool  quiet = false 
) const

Definition at line 323 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetFilename()

std::string const & ConfigMgr::GetFilename ( )

Definition at line 348 of file Config.cpp.

◆ GetFloatDefault()

float ConfigMgr::GetFloatDefault ( std::string const &  name,
float  def,
bool  quiet = false 
) const

Definition at line 343 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetIntDefault()

int ConfigMgr::GetIntDefault ( std::string const &  name,
int  def,
bool  quiet = false 
) const

Definition at line 338 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetKeysByString()

std::vector< std::string > ConfigMgr::GetKeysByString ( std::string const &  name)

Definition at line 359 of file Config.cpp.

◆ GetStringDefault()

std::string ConfigMgr::GetStringDefault ( std::string const &  name,
const std::string &  def,
bool  quiet = false 
) const

Definition at line 316 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetValueDefault()

template<class T >
T ConfigMgr::GetValueDefault ( std::string const &  name,
def,
bool  quiet 
) const
private

Definition at line 246 of file Config.cpp.

+ Here is the caller graph for this function:

◆ instance()

ConfigMgr * ConfigMgr::instance ( )
static

Definition at line 224 of file Config.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadAdditionalDir()

bool ConfigMgr::LoadAdditionalDir ( std::string const &  dir,
bool  keepOnReload,
std::vector< std::string > &  loadedFiles,
std::vector< std::string > &  errors 
)

Definition at line 175 of file Config.cpp.

+ Here is the call graph for this function:

◆ LoadAdditionalFile()

bool ConfigMgr::LoadAdditionalFile ( std::string  file,
bool  keepOnReload,
std::string &  error 
)

Definition at line 158 of file Config.cpp.

+ Here is the caller graph for this function:

◆ LoadInitial()

bool ConfigMgr::LoadInitial ( std::string  file,
std::vector< std::string >  args,
std::string &  error 
)

Method used only for loading main configuration files (authserver.conf and worldserver.conf)

Definition at line 140 of file Config.cpp.

+ Here is the caller graph for this function:

◆ operator=()

ConfigMgr & ConfigMgr::operator= ( ConfigMgr const &  )
privatedelete

◆ OverrideWithEnvVariablesIfAny()

std::vector< std::string > ConfigMgr::OverrideWithEnvVariablesIfAny ( )

Overrides configuration with environment variables and returns overridden keys.

Definition at line 201 of file Config.cpp.

+ Here is the caller graph for this function:

◆ Reload()

bool ConfigMgr::Reload ( std::vector< std::string > &  errors)

Definition at line 230 of file Config.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: