Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
ConfigMgr Class Reference

#include <Config.h>

Public Member Functions

bool GetBoolDefault (const char *name, bool def)
std::string const & GetFilename ()
float GetFloatDefault (const char *name, float def)
int GetIntDefault (const char *name, int def)
std::list< std::string > GetKeysByString (std::string const &name)
std::string GetStringDefault (const char *name, const std::string &def)
bool LoadInitial (char const *file)
 Method used only for loading main configuration files (authserver.conf and worldserver.conf).
bool LoadMore (char const *file)
bool Reload ()

Private Types

typedef std::lock_guard< std::mutex > GuardType
typedef std::mutex LockType

Private Member Functions

 ConfigMgr ()
 ConfigMgr (ConfigMgr const &)
bool GetValueHelper (const char *name, std::string &result)
bool LoadData (char const *file)
ConfigMgroperator= (ConfigMgr const &)
 ~ConfigMgr ()

Private Attributes

Config _config
bool _configLoaded
LockType _configLock
std::string _filename

Friends

class ConfigLoader
class Skyfire::Singleton< ConfigMgr, Skyfire::NullMutex >

Detailed Description

Definition at line 18 of file Config.h.

Member Typedef Documentation

◆ GuardType

typedef std::lock_guard<std::mutex> ConfigMgr::GuardType
private

Definition at line 53 of file Config.h.

◆ LockType

typedef std::mutex ConfigMgr::LockType
private

Definition at line 52 of file Config.h.

Constructor & Destructor Documentation

◆ ConfigMgr() [1/2]

ConfigMgr::ConfigMgr ( )
inlineprivate

Definition at line 23 of file Config.h.

References _configLoaded, and ConfigMgr().

Referenced by ConfigMgr(), ConfigMgr(), and operator=().

◆ ~ConfigMgr()

ConfigMgr::~ConfigMgr ( )
inlineprivate

Definition at line 24 of file Config.h.

◆ ConfigMgr() [2/2]

ConfigMgr::ConfigMgr ( ConfigMgr const & )
private

References ConfigMgr().

Member Function Documentation

◆ GetBoolDefault()

bool ConfigMgr::GetBoolDefault ( const char * name,
bool def )

Definition at line 166 of file Config.cpp.

References GetValueHelper().

◆ GetFilename()

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

Definition at line 189 of file Config.cpp.

References _configLock, and _filename.

◆ GetFloatDefault()

float ConfigMgr::GetFloatDefault ( const char * name,
float def )

Definition at line 183 of file Config.cpp.

References GetValueHelper().

◆ GetIntDefault()

int ConfigMgr::GetIntDefault ( const char * name,
int def )

Definition at line 177 of file Config.cpp.

References GetValueHelper().

◆ GetKeysByString()

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

Definition at line 195 of file Config.cpp.

References _config, _configLoaded, and _configLock.

◆ GetStringDefault()

std::string ConfigMgr::GetStringDefault ( const char * name,
const std::string & def )

Definition at line 160 of file Config.cpp.

References GetValueHelper().

◆ GetValueHelper()

bool ConfigMgr::GetValueHelper ( const char * name,
std::string & result )
private

Definition at line 68 of file Config.cpp.

References _config, _configLoaded, and _configLock.

Referenced by GetBoolDefault(), GetFloatDefault(), GetIntDefault(), and GetStringDefault().

◆ LoadData()

bool ConfigMgr::LoadData ( char const * file)
private

Definition at line 123 of file Config.cpp.

References _config.

Referenced by LoadInitial(), and LoadMore().

◆ LoadInitial()

bool ConfigMgr::LoadInitial ( char const * file)

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

Definition at line 88 of file Config.cpp.

References _config, _configLoaded, _configLock, _filename, ASSERT, and LoadData().

Referenced by Reload().

◆ LoadMore()

bool ConfigMgr::LoadMore ( char const * file)

This method loads additional configuration files It is recommended to use this method in WorldScript::OnConfigLoad hooks

Returns
true if loading was successful

Definition at line 108 of file Config.cpp.

References _configLoaded, _configLock, ASSERT, and LoadData().

◆ operator=()

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

References ConfigMgr().

◆ Reload()

bool ConfigMgr::Reload ( )

Definition at line 118 of file Config.cpp.

References _filename, and LoadInitial().

◆ ConfigLoader

friend class ConfigLoader
friend

Definition at line 21 of file Config.h.

References ConfigLoader.

Referenced by ConfigLoader.

◆ Skyfire::Singleton< ConfigMgr, Skyfire::NullMutex >

Definition at line 16 of file Config.h.

Member Data Documentation

◆ _config

Config ConfigMgr::_config
private

Definition at line 56 of file Config.h.

Referenced by GetKeysByString(), GetValueHelper(), LoadData(), and LoadInitial().

◆ _configLoaded

bool ConfigMgr::_configLoaded
private

Definition at line 57 of file Config.h.

Referenced by ConfigMgr(), GetKeysByString(), GetValueHelper(), LoadInitial(), and LoadMore().

◆ _configLock

LockType ConfigMgr::_configLock
private

Definition at line 58 of file Config.h.

Referenced by GetFilename(), GetKeysByString(), GetValueHelper(), LoadInitial(), and LoadMore().

◆ _filename

std::string ConfigMgr::_filename
private

Definition at line 55 of file Config.h.

Referenced by GetFilename(), LoadInitial(), and Reload().


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