summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-10 00:37:26 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-10 00:37:34 +0300
commit002c6191a3cda8db182f2ca26bb182d3274ab960 (patch)
treece9eecbddddf5f028dc1c4f562278be9423f6c70 /include
parent6d27acd0a57bc6a228f1b6dd2ce451c02cc7419c (diff)
CMOption::Default() - returns the default option's value
Diffstat (limited to 'include')
-rw-r--r--include/m_gui.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/m_gui.h b/include/m_gui.h
index d2cadc420e..06643dd1ab 100644
--- a/include/m_gui.h
+++ b/include/m_gui.h
@@ -141,10 +141,16 @@ public:
CMOptionBase(szModule, szSetting), m_default(defValue)
{}
+ __forceinline Type Default() const
+ {
+ return m_default;
+ }
+
__forceinline operator Type()
{
return (Type)CMDBTraits<sizeof(Type)>::Get(m_szModuleName, m_szSetting, m_default);
}
+
__forceinline Type operator= (Type value)
{
CMDBTraits<sizeof(Type)>::Set(m_szModuleName, m_szSetting, (CMDBTraits<sizeof(Type)>::DBType)value);
@@ -175,12 +181,18 @@ public:
CMOptionBase(szModule, szSetting), m_default(defValue)
{}
+ __forceinline const Type* Default() const
+ {
+ return m_default;
+ }
+
__forceinline operator Type*()
{
m_value = db_get_sa(0, m_szModuleName, m_szSetting);
if (!m_value) m_value = mir_strdup(m_default);
return m_value;
}
+
__forceinline Type* operator= (Type *value)
{
db_set_s(0, m_szModuleName, m_szSetting, value);
@@ -210,6 +222,11 @@ public:
CMOptionBase(szModule, szSetting), m_default(defValue)
{}
+ __forceinline const Type* Default() const
+ {
+ return m_default;
+ }
+
__forceinline operator Type*()
{
m_value = db_get_wsa(0, m_szModuleName, m_szSetting);