From 002c6191a3cda8db182f2ca26bb182d3274ab960 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 10 Dec 2017 00:37:26 +0300 Subject: CMOption::Default() - returns the default option's value --- include/m_gui.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/m_gui.h') 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::Get(m_szModuleName, m_szSetting, m_default); } + __forceinline Type operator= (Type value) { CMDBTraits::Set(m_szModuleName, m_szSetting, (CMDBTraits::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); -- cgit v1.2.3