[8645] Cleanup code for config loading/store/access.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
XTZGZoReX 2009-10-14 20:46:22 +04:00 committed by VladimirMangos
parent 4d3e43e814
commit aff1a3e59f
9 changed files with 532 additions and 474 deletions

View file

@ -27,27 +27,22 @@ class DOTCONFDocument;
class MANGOS_DLL_SPEC Config
{
public:
Config();
~Config();
bool SetSource(const char *file, bool ignorecase = true);
bool Reload();
bool GetString(const char* name, std::string *value);
bool GetString(const char* name, char const **value);
std::string GetStringDefault(const char* name, const char* def);
bool GetBool(const char* name, bool *value);
bool GetBoolDefault(const char* name, const bool def = false);
bool GetInt(const char* name, int *value);
int GetIntDefault(const char* name, const int def);
bool GetFloat(const char* name, float *value);
int32 GetIntDefault(const char* name, const int32 def);
float GetFloatDefault(const char* name, const float def);
std::string GetFilename() const { return mFilename; }
private:
std::string mFilename;
bool mIgnoreCase;
DOTCONFDocument *mConf;