diff options
Diffstat (limited to 'src/server/shared/Configuration/Config.h')
-rwxr-xr-x | src/server/shared/Configuration/Config.h | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h index fa42bdcfc6c..46d019fd800 100755 --- a/src/server/shared/Configuration/Config.h +++ b/src/server/shared/Configuration/Config.h @@ -19,37 +19,19 @@ #ifndef CONFIG_H #define CONFIG_H -#include "Common.h" -#include <ace/Singleton.h> -#include "Define.h" +#include <string> -class ACE_Configuration_Heap; - -class Config +namespace ConfigMgr { - friend class ACE_Singleton<Config, ACE_Null_Mutex>; - Config(); - public: - ~Config(); - - bool SetSource(const char *file); - bool Reload(); - - std::string GetStringDefault(const char * name, std::string def); - bool GetBoolDefault(const char * name, const bool def); - int32 GetIntDefault(const char * name, const int32 def); - float GetFloatDefault(const char * name, const float def); - - std::string GetFilename() const { return mFilename; } - - ACE_Thread_Mutex mMtx; + bool Load(const char *file = NULL); - private: - std::string mFilename; - ACE_Configuration_Heap* mConf; -}; + std::string GetStringDefault(const char* name, const std::string& def); + bool GetBoolDefault(const char* name, bool def); + int GetIntDefault(const char* name, int def); + float GetFloatDefault(const char* name, float def); -#define sConfig ACE_Singleton<Config, ACE_Null_Mutex>::instance() + const std::string & GetFilename(); +} #endif |