12345678910111213141516171819202122232425262728293031323334353637 |
- #pragma once
- #include <boost/unordered_map.hpp>
- #include <vector>
- struct M_Global_ConfigData
- {
- //Key
- std::string mKey;
- //备注
- std::string mDesc;
- //数值
- int mIntValue;
- //数值列表
- std::vector<int> mIntListValue;
- //字符串
- std::string mStrValue;
- //字符串列表
- std::vector<std::string> mStrListValue;
- //布尔值参数
- bool mBoolValue;
- };
- class M_Global_Config
- {
- public:
- private:
- static std::auto_ptr<M_Global_Config> msSingleton;
- public:
- int GetCount();
- const M_Global_ConfigData* GetData(std::string Key);
- boost::unordered_map<std::string, M_Global_ConfigData>& GetMapData();
- void Reload();
- void Load(const std::string& path);
- void Load();
- static M_Global_Config* GetSingleton();
- private:
- boost::unordered_map<std::string, M_Global_ConfigData> mMapData;
- };
|