TrinityCore
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 (bnetserver.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
 
int32 GetIntDefault (std::string const &name, int32 def, bool quiet=false) const
 
int64 GetInt64Default (std::string const &name, int64 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 358 of file Config.cpp.

◆ GetBoolDefault()

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

Definition at line 322 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetFilename()

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

Definition at line 352 of file Config.cpp.

◆ GetFloatDefault()

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

Definition at line 347 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetInt64Default()

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

Definition at line 342 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetIntDefault()

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

Definition at line 337 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 363 of file Config.cpp.

◆ GetStringDefault()

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

Definition at line 315 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 245 of file Config.cpp.

+ Here is the caller graph for this function:

◆ instance()

ConfigMgr * ConfigMgr::instance ( )
static

Definition at line 223 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 174 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 157 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 (bnetserver.conf and worldserver.conf)

Definition at line 139 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 200 of file Config.cpp.

+ Here is the caller graph for this function:

◆ Reload()

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

Definition at line 229 of file Config.cpp.

+ Here is the call graph for this function:

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