TrinityCore
Loading...
Searching...
No Matches
ConfigMgr Class Reference

#include <Config.h>

Public Member Functions

 ConfigMgr (ConfigMgr const &)=delete
 
 ConfigMgr (ConfigMgr &&)=delete
 
ConfigMgroperator= (ConfigMgr const &)=delete
 
ConfigMgroperator= (ConfigMgr &&)=delete
 
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)
 
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.
 
bool Reload (std::vector< std::string > &errors)
 
std::string GetStringDefault (std::string_view name, std::string_view def, bool quiet=false) const
 
bool GetBoolDefault (std::string_view name, bool def, bool quiet=false) const
 
int32 GetIntDefault (std::string_view name, int32 def, bool quiet=false) const
 
int64 GetInt64Default (std::string_view name, int64 def, bool quiet=false) const
 
float GetFloatDefault (std::string_view 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 ()=default
 
template<class T , class R = T>
GetValueDefault (std::string_view const &name, T def, bool quiet) const
 

Detailed Description

Definition at line 26 of file Config.h.

Constructor & Destructor Documentation

◆ ConfigMgr() [1/3]

ConfigMgr::ConfigMgr ( )
privatedefault

◆ ~ConfigMgr()

ConfigMgr::~ConfigMgr ( )
privatedefault

◆ ConfigMgr() [2/3]

ConfigMgr::ConfigMgr ( ConfigMgr const &  )
delete

◆ ConfigMgr() [3/3]

ConfigMgr::ConfigMgr ( ConfigMgr &&  )
delete

Member Function Documentation

◆ GetArguments()

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

Definition at line 353 of file Config.cpp.

◆ GetBoolDefault()

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

Definition at line 318 of file Config.cpp.

◆ GetFilename()

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

Definition at line 347 of file Config.cpp.

◆ GetFloatDefault()

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

Definition at line 342 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetInt64Default()

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

Definition at line 337 of file Config.cpp.

+ Here is the call graph for this function:

◆ GetIntDefault()

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

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

◆ GetStringDefault()

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

Definition at line 311 of file Config.cpp.

◆ GetValueDefault()

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

Definition at line 243 of file Config.cpp.

+ Here is the caller graph for this function:

◆ instance()

ConfigMgr * ConfigMgr::instance ( )
static

Definition at line 221 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 172 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 155 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 137 of file Config.cpp.

+ Here is the caller graph for this function:

◆ operator=() [1/2]

ConfigMgr & ConfigMgr::operator= ( ConfigMgr &&  )
delete

◆ operator=() [2/2]

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

◆ OverrideWithEnvVariablesIfAny()

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

Overrides configuration with environment variables and returns overridden keys.

Definition at line 198 of file Config.cpp.

+ Here is the caller graph for this function:

◆ Reload()

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

Definition at line 227 of file Config.cpp.

+ Here is the call graph for this function:

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