diff options
author | George Hazan <george.hazan@gmail.com> | 2015-03-24 18:51:51 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-03-24 18:51:51 +0000 |
commit | 2f1b8c756066316c59be907bcd94a73cae5e3a7b (patch) | |
tree | 1c43a7e356602938748aa9f09ebbc7a187ae280b /protocols/JabberG/src/jabber_db_utils.h | |
parent | a3e37eef935765e0a53b1e84d2e3b22f9e475637 (diff) |
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
Diffstat (limited to 'protocols/JabberG/src/jabber_db_utils.h')
-rw-r--r-- | protocols/JabberG/src/jabber_db_utils.h | 98 |
1 files changed, 0 insertions, 98 deletions
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<typename Int> struct CMIntTraits { static __forceinline bool IsSigned() { return false; } };
-template<> struct CMIntTraits<signed char> { static __forceinline bool IsSigned() { return true; } };
-template<> struct CMIntTraits<signed short> { static __forceinline bool IsSigned() { return true; } };
-template<> struct CMIntTraits<signed long> { static __forceinline bool IsSigned() { return true; } };
-
-template<int Size>
-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 T>
-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<sizeof(Type)>::Get(m_proto, m_szSetting, m_default);
- }
- __forceinline Type operator= (Type value)
- {
- CMDBTraits<sizeof(Type)>::Set(m_proto, m_szSetting, (CMDBTraits<sizeof(Type)>::DBType)value);
- return value;
- }
-
-private:
- Type m_default;
-
- CMOption(const CMOption &): CMOptionBase(NULL, NULL, DBVT_DELETED) {}
- void operator= (const CMOption &) {}
-};
-
struct CJabberOptions
{
CMOption<BYTE> AllowVersionRequests;
|