diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-26 12:38:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-26 12:38:05 +0000 |
commit | 7969931ecab74a0d251de7613a8427f2a9a5c86c (patch) | |
tree | dbf064e60b0720b299ae92b34285d018bd8b21b4 /plugins/UserInfoEx/src/mir_db.h | |
parent | 5eda5b13296dd4e56717948d0aecc5e0f8a0d84e (diff) |
various code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@7382 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/mir_db.h')
-rw-r--r-- | plugins/UserInfoEx/src/mir_db.h | 128 |
1 files changed, 65 insertions, 63 deletions
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index ed60f07b90..471d0db5d4 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -24,13 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace DB {
namespace MetaContact{
- INT_PTR SubCount (HANDLE hMetaContact);
- INT_PTR SubDefNum (HANDLE hMetaContact);
- HANDLE Sub (HANDLE hMetaContact, int idx);
-
- BYTE IsSub (HANDLE hContact);
- HANDLE GetMeta (HANDLE hContact);
+ INT_PTR SubCount(HANDLE hMetaContact);
+ INT_PTR SubDefNum(HANDLE hMetaContact);
+ HANDLE Sub(HANDLE hMetaContact, int idx);
+ bool IsSub(HANDLE hContact);
+ HANDLE GetMeta(HANDLE hContact);
} /* namespace MetaContact */
/**
@@ -38,23 +37,23 @@ namespace MetaContact{ * or modify contacts in the database.
**/
namespace Contact {
- LPTSTR DisplayName (HANDLE hContact);
- LPSTR Proto (HANDLE hContact);
+ LPTSTR DisplayName(HANDLE hContact);
+ LPSTR Proto(HANDLE hContact);
- INT_PTR GetCount ();
+ INT_PTR GetCount();
- HANDLE Add();
- BYTE Delete (HANDLE hContact);
+ HANDLE Add();
+ BYTE Delete(HANDLE hContact);
- DWORD WhenAdded (DWORD dwUIN, LPCSTR szBaseProto);
+ DWORD WhenAdded(DWORD dwUIN, LPCSTR szBaseProto);
} /* namespace Contact */
namespace Module {
- void Delete (HANDLE hContact, LPCSTR pszModule);
- BYTE IsEmpty (HANDLE hContact, LPCSTR pszModule);
- BYTE IsMeta (LPCSTR pszModule);
- BYTE IsMetaAndScan (LPCSTR pszModule);
+ void Delete(HANDLE hContact, LPCSTR pszModule);
+ bool IsEmpty(HANDLE hContact, LPCSTR pszModule);
+ bool IsMeta(LPCSTR pszModule);
+ bool IsMetaAndScan(LPCSTR pszModule);
} /* namespace Module */
@@ -63,69 +62,72 @@ namespace Module { **/
namespace Setting {
- BYTE Get (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE
- BYTE GetAsIs (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv) {return Get(hContact, pszModule, pszSetting, dbv, 0); }
- static FORCEINLINE
- BYTE GetAString (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv) {return Get(hContact, pszModule, pszSetting, dbv, DBVT_ASCIIZ); }
- LPSTR GetAString (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE
- BYTE GetWString (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv) {return Get(hContact, pszModule, pszSetting, dbv, DBVT_WCHAR); }
- LPWSTR GetWString (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE
- BYTE GetUString (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv) {return Get(hContact, pszModule, pszSetting, dbv, DBVT_UTF8); }
-
- BYTE GetEx (HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE
- BYTE GetAsIsEx (HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetEx(hContact, pszModule, szProto, pszSetting, dbv, 0); }
- static FORCEINLINE
- LPSTR GetAStringEx (HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting) { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : NULL; }
- static FORCEINLINE
- LPWSTR GetWStringEx (HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting) { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_WCHAR) && dbv.type == DBVT_WCHAR) ? dbv.pwszVal : NULL; }
- static FORCEINLINE
- LPSTR GetUStringEx (HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting) { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : NULL; }
-
- WORD GetCtrl (HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE
- WORD GetAsIsCtrl (HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, 0); }
- static FORCEINLINE
- WORD GetAStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_ASCIIZ); }
- static FORCEINLINE
- WORD GetWStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_WCHAR); }
- static FORCEINLINE
- WORD GetUStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv) { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_UTF8); }
-
- BYTE GetStatic (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, LPSTR szValue, int cchValue);
-
- #define GetTString GetWString
- #define GetTStringEx GetWStringEx
- #define GetTStringCtrl GetWStringCtrl
- #define WriteTString WriteWString
+ BYTE Get(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ static FORCEINLINE BYTE GetAsIs(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return Get(hContact, pszModule, pszSetting, dbv, 0); }
+ static FORCEINLINE BYTE GetAString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return Get(hContact, pszModule, pszSetting, dbv, DBVT_ASCIIZ); }
+
+ LPSTR GetAString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ static FORCEINLINE BYTE GetWString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return Get(hContact, pszModule, pszSetting, dbv, DBVT_WCHAR); }
+
+ LPWSTR GetWString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ static FORCEINLINE BYTE GetUString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return Get(hContact, pszModule, pszSetting, dbv, DBVT_UTF8); }
+
+ BYTE GetEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ static FORCEINLINE BYTE GetAsIsEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return GetEx(hContact, pszModule, szProto, pszSetting, dbv, 0); }
+ static FORCEINLINE LPSTR GetAStringEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : NULL; }
+ static FORCEINLINE LPWSTR GetWStringEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_WCHAR) && dbv.type == DBVT_WCHAR) ? dbv.pwszVal : NULL; }
+ static FORCEINLINE LPSTR GetUStringEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ { DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : NULL; }
+
+ WORD GetCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ static FORCEINLINE WORD GetAsIsCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, 0); }
+ static FORCEINLINE WORD GetAStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_ASCIIZ); }
+ static FORCEINLINE WORD GetWStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_WCHAR); }
+ static FORCEINLINE WORD GetUStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ { return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_UTF8); }
+
+ BYTE GetStatic(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, LPSTR szValue, int cchValue);
+
+ #define GetTString GetWString
+ #define GetTStringEx GetWStringEx
+ #define GetTStringCtrl GetWStringCtrl
+ #define WriteTString WriteWString
/**
* misc operations
**/
- BYTE Exists (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- void DeleteArray (HANDLE hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart);
+ BYTE Exists(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ void DeleteArray(HANDLE hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart);
} /* namespace Setting */
namespace Variant {
- BYTE ConvertString (DBVARIANT* dbv, const BYTE destType);
- BYTE dbv2String (DBVARIANT* dbv, const BYTE destType);
+ BYTE ConvertString(DBVARIANT* dbv, const BYTE destType);
+ BYTE dbv2String(DBVARIANT* dbv, const BYTE destType);
} /* namespace Variant */
namespace Event {
- HANDLE FindLast (HANDLE hContact);
- BYTE GetInfo (HANDLE hEvent, DBEVENTINFO *dbei);
- BYTE GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei);
- DWORD GetTime (HANDLE hEvent);
- BYTE Exists (HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei);
+ HANDLE FindLast(HANDLE hContact);
+ bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei);
+ bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei);
+ DWORD GetTime(HANDLE hEvent);
+ bool Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei);
} /* namespace Events */
/**
* enumerating
**/
+
class CEnumList : public ::LIST<CHAR>
{
static int EnumProc (LPCSTR pszName, DWORD ofsModuleName, LPARAM lParam);
|