diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-04 23:23:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-04 23:23:45 +0000 |
commit | 15855fa84a09fd1fd486d357c38db0f2bd181e74 (patch) | |
tree | c98d1ae74abca41c776522059343eda13a7e0a31 /plugins/HistoryStats/src/mirandasettings.h | |
parent | 819f8efabea6b0d7d971f9e6e4b21bbc18838874 (diff) |
HistoryStats compiles ok now
git-svn-id: http://svn.miranda-ng.org/main/trunk@8399 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryStats/src/mirandasettings.h')
-rw-r--r-- | plugins/HistoryStats/src/mirandasettings.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/plugins/HistoryStats/src/mirandasettings.h b/plugins/HistoryStats/src/mirandasettings.h new file mode 100644 index 0000000000..827c9f4ac5 --- /dev/null +++ b/plugins/HistoryStats/src/mirandasettings.h @@ -0,0 +1,63 @@ +#if !defined(HISTORYSTATS_GUARD_MIRANDASETTINGS_H)
+#define HISTORYSTATS_GUARD_MIRANDASETTINGS_H
+
+#include "_globals.h"
+#include "_consts.h"
+
+#include "utils.h"
+#include "settingstree.h"
+
+#include <set>
+#include <iterator>
+
+class MirandaSettings
+ : private pattern::NotCopyable<MirandaSettings>
+{
+public:
+ typedef std::set<ext::a::string> SettingsSet;
+ typedef std::insert_iterator<SettingsSet> SetInserter;
+
+private:
+ MCONTACT m_hContact;
+ ext::a::string m_strModule;
+
+private:
+ static int enumSettingsProc(const mu_ansi* szSetting, LPARAM lParam);
+
+public:
+ // constructor
+ explicit MirandaSettings();
+
+ // contact/module management
+ MCONTACT getContact() const { return m_hContact; }
+ void setContact(MCONTACT hContact) { m_hContact = hContact; }
+ const ext::a::string& getModule() const { return m_strModule; }
+ void setModule(const mu_ansi* module) { m_strModule = module; }
+
+ // reading
+ bool readBool(const mu_ansi* szSetting, bool bDefault) const;
+ int readByte(const mu_ansi* szSetting, int bDefault) const;
+ int readWord(const mu_ansi* szSetting, int wDefault) const;
+ int readDWord(const mu_ansi* szSetting, int dwDeault) const;
+ ext::string readStr(const mu_ansi* szSetting, const mu_text* szDefault) const;
+ ext::string readStrDirect(const mu_ansi* szSetting, const mu_text* szDefault) const;
+ void readTree(const mu_ansi* szSetting, const mu_text* szDefault, SettingsTree& value) const;
+
+ // writing
+ void writeBool(const mu_ansi* szSetting, bool bValue) const;
+ void writeByte(const mu_ansi* szSetting, int bValue) const;
+ void writeWord(const mu_ansi* szSetting, int wValue) const;
+ void writeDWord(const mu_ansi* szSetting, int dwValue) const;
+ void writeStr(const mu_ansi* szSetting, const mu_text* szValue) const;
+ void writeStrDirect(const mu_ansi* szSetting, const mu_text* szValue) const;
+ void writeTree(const mu_ansi* szSetting, const SettingsTree& value) const;
+
+ // misc functions
+ bool settingExists(const mu_ansi* szSetting) const;
+ bool delSetting(const mu_ansi* szSetting);
+
+ // enumeration
+ void enumSettings(SetInserter& insertIterator);
+};
+
+#endif // HISTORYSTATS_GUARD_MIRANDASETTINGS_H
|