00001
00002
00004
00005
00006
00008
00009
00010
00011 #ifndef __SettingsStore_h__
00012 #define __SettingsStore_h__
00013
00014
00015 #include "MSVC_Unannoy.h"
00016 #include <string>
00017 #include <map>
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 class CSettingsStore
00028 {
00029 public:
00030 virtual ~CSettingsStore();
00031 bool GetBoolOption(const std::string& Key);
00032 long GetLongOption(const std::string& Key);
00033 std::string& GetStringOption(const std::string& Key);
00034
00035 void SetBoolOption(const std::string& Key, bool Value);
00036 void SetLongOption(const std::string& Key, long Value);
00037 void SetStringOption(const std::string& Key, const std::string& Value);
00038
00039 void SetBoolDefault(const std::string& Key, bool Value);
00040 void SetLongDefault(const std::string& Key, long Value);
00041 void SetStringDefault(const std::string& Key, const std::string& Value);
00042 private:
00043
00044
00045
00046
00048
00052 virtual bool LoadSetting(const std::string& Key, bool* Value);
00053
00055
00059 virtual bool LoadSetting(const std::string& Key, long* Value);
00060
00062
00066 virtual bool LoadSetting(const std::string& Key, std::string* Value);
00067
00069
00072 virtual void SaveSetting(const std::string& Key, bool Value);
00073
00075
00078 virtual void SaveSetting(const std::string& Key, long Value);
00079
00081
00084 virtual void SaveSetting(const std::string& Key, const std::string& Value);
00085
00086
00087 std::map<std::string, bool> BoolMap;
00088 std::map<std::string, long> LongMap;
00089 std::map<std::string, std::string> StringMap;
00090 };
00091
00092
00093 #endif