From 2f1b8c756066316c59be907bcd94a73cae5e3a7b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Mar 2015 18:51:51 +0000 Subject: UI Utils classes & templates moved to the core, thus allowing any plugin to use them git-svn-id: http://svn.miranda-ng.org/main/trunk@12492 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_db_utils.h | 98 --------------------------------- 1 file changed, 98 deletions(-) (limited to 'protocols/JabberG/src/jabber_db_utils.h') diff --git a/protocols/JabberG/src/jabber_db_utils.h b/protocols/JabberG/src/jabber_db_utils.h index f171fbc7f5..605cee97c7 100644 --- a/protocols/JabberG/src/jabber_db_utils.h +++ b/protocols/JabberG/src/jabber_db_utils.h @@ -27,104 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __jabber_db_utils_h__ #define __jabber_db_utils_h__ -template struct CMIntTraits { static __forceinline bool IsSigned() { return false; } }; -template<> struct CMIntTraits { static __forceinline bool IsSigned() { return true; } }; -template<> struct CMIntTraits { static __forceinline bool IsSigned() { return true; } }; -template<> struct CMIntTraits { static __forceinline bool IsSigned() { return true; } }; - -template -struct CMDBTraits -{ -}; - -template<> -struct CMDBTraits<1> -{ - typedef BYTE DBType; - enum { DBTypeId = DBVT_BYTE }; - static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value) - { - return pPro->getByte(szSetting, value); - } - static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value) - { - pPro->setByte(szSetting, value); - } -}; - -template<> -struct CMDBTraits<2> -{ - typedef WORD DBType; - enum { DBTypeId = DBVT_WORD }; - static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value) - { - pPro->getWord(szSetting, value); - } - static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value) - { - pPro->setWord(szSetting, value); - } -}; - -template<> -struct CMDBTraits<4> -{ - typedef DWORD DBType; - enum { DBTypeId = DBVT_DWORD }; - static __forceinline DBType Get(PROTO_INTERFACE *pPro, char *szSetting, DBType value) - { - return pPro->getDword(szSetting, value); - } - static __forceinline void Set(PROTO_INTERFACE *pPro, char *szSetting, DBType value) - { - pPro->setDword(szSetting, value); - } -}; - -class CMOptionBase -{ -public: - char* GetDBModuleName() const { return m_proto->m_szModuleName; } - char* GetDBSettingName() const { return m_szSetting; } - -protected: - CMOptionBase(PROTO_INTERFACE *proto, char *szSetting): m_proto(proto), m_szSetting(szSetting) {} - - PROTO_INTERFACE *m_proto; - char *m_szSetting; - -private: - CMOptionBase(const CMOptionBase &) {} - void operator= (const CMOptionBase &) {} -}; - -template -class CMOption: public CMOptionBase -{ -public: - typedef T Type; - - __forceinline CMOption(PROTO_INTERFACE *proto, char *szSetting, Type defValue): - CMOptionBase(proto, szSetting), m_default(defValue) {} - - __forceinline operator Type() - { - return (Type)CMDBTraits::Get(m_proto, m_szSetting, m_default); - } - __forceinline Type operator= (Type value) - { - CMDBTraits::Set(m_proto, m_szSetting, (CMDBTraits::DBType)value); - return value; - } - -private: - Type m_default; - - CMOption(const CMOption &): CMOptionBase(NULL, NULL, DBVT_DELETED) {} - void operator= (const CMOption &) {} -}; - struct CJabberOptions { CMOption AllowVersionRequests; -- cgit v1.2.3