mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 04:37:02 +00:00
[8645] Cleanup code for config loading/store/access.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
4d3e43e814
commit
aff1a3e59f
9 changed files with 532 additions and 474 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue