?? chatlogdb.h
字號(hào):
// ChatLogDB.h: interface for the CChatLogDB class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHATLOGDB_H__3E8521C5_7660_4784_B67B_56C99D5B7512__INCLUDED_)
#define AFX_CHATLOGDB_H__3E8521C5_7660_4784_B67B_56C99D5B7512__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "IChatLogDB.h"
#include "SQLiteDB.h"
using sqlite::SQLiteDB;
using sqlite::CResult;
#ifndef SAFE_DELETE
#ifdef _DEBUG
#define SAFE_DELETE(p) { if(p) delete p; p=NULL; }
#else
#define SAFE_DELETE(p) { if(p){ try{ delete p; } catch(...){} p=NULL; }}
#endif
#endif
class CChatLogDB : public IChatLogDB
{
public:
CChatLogDB();
virtual ~CChatLogDB();
void Connect (const char* pszFullPath, const char* pszKey);
void Close ();
void EnableLog (bool bEnable) { m_bLog = bEnable; }
bool GetEnableLog () { return m_bLog; }
bool GetHeroLogin () { return m_bHeroLogin; }
void SetHeroLogin (bool bLogin) { m_bHeroLogin = bLogin; }
void Commit ();
void Reset ();
int QueryNormalCountByCondition (const char* pszSql);
int QuerySystemCount ();
int QueryNormalCount ();
const VEC_CHAT_CONTACT& QueryContactList ();
const ROW_INFO_VEC& QueryValueUsingBinaryMode (const char* pszSql, bool bSys);
//////////////////////////////////////////////////////////////////////////
//數(shù)據(jù)庫(kù) 2進(jìn)制讀寫
void AddValueUsingBinaryMode (const CHAT_DB_ROW_INFO* pRowInfo, bool bIsSystem);
//////////////////////////////////////////////////////////////////////////
void DelLogByTime (long lTime, bool bIsSystem);
void DelBySql (const char* pszSql);
void DelLogByID (DWORD id, bool bIsSystem);
void DelCurrentLog (bool bIsSystem);
void DelLogByGivenTimeSet (const VEC_CHAT_TIME& vecTime, bool bIsSystem);
//////////////////////////////////////////////////////////////////////////
void SetCurPath (const char* pszText);
void SetCurDate (long lTime) { m_lCurTime = lTime; }
//////////////////////////////////////////////////////////////////////////
private:
bool CreateDir (const char *pszPath);
private:
SQLiteDB m_objDB;
ROW_INFO_VEC m_vecResultSet;
VEC_CHAT_CONTACT m_vecChatContact;
bool m_bLog; //是否記錄到數(shù)據(jù)庫(kù)中
bool m_bConnected; //是否鏈接
bool m_bHeroLogin; //英雄第一次登錄
string m_strCurPath; //當(dāng)前的路徑
long m_lCurTime; //當(dāng)前時(shí)間
int m_nAddLine; //增加行
string m_strDbKey; //密鑰
};
#endif // !defined(AFX_CHATLOGDB_H__3E8521C5_7660_4784_B67B_56C99D5B7512__INCLUDED_)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -