00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _WUTIL_CONFIG_STORE_H_
00026 #define _WUTIL_CONFIG_STORE_H_
00027
00028 #include <string>
00029 #include <map>
00030
00031
00032 namespace wUtil
00033 {
00034
00036
00038
00039 class CConfigStore
00040 {
00041 public:
00043 CConfigStore(void) { }
00044
00046 virtual ~CConfigStore(void) { }
00047
00051 std::pair<bool, std::wstring> GetStringEntry(std::wstring sKey) const;
00052
00056 std::pair<bool, long int> GetLongIntEntry(std::wstring sKey) const;
00057
00061 std::pair<bool, double> GetDoubleEntry(std::wstring sKey) const;
00062
00066 void SetStringEntry(std::wstring sKey, std::wstring sValue);
00067
00071 void SetLongIntEntry(std::wstring sKey, long int lValue);
00072
00076 void SetDoubleEntry(std::wstring sKey, double dValue);
00077
00080 void RemoveEntry(std::wstring sKey);
00081
00085 bool EntryExists(std::wstring sKey) const;
00086
00089 void StoreToFile(std::wstring sFilename) const;
00090
00095 bool ReadFromFile(std::wstring sFilename);
00096
00098 void Clear(void);
00099
00100
00101 protected:
00102 typedef std::map<std::wstring, std::wstring> t_SettingsMap;
00103 t_SettingsMap m_SettingsMap;
00104 };
00105
00106 };
00107
00108
00109 #include "unit_tests/wutil_config_store_unittests.h"
00110
00111 #endif // _WUTIL_CONFIG_STORE_H_
00112