#ifndef WXHELPER_DB_H_ #define WXHELPER_DB_H_ #include #include #include "base_mgr.h" #include "wechat_function.h" #include "windows.h" #include "singleton.h" namespace wxhelper { class DB :public Singleton{ public: void init(DWORD base); int ExecuteSQL(DWORD db, const char *sql, DWORD callback, void *data); int Select(DWORD db_hanle, const char *sql, std::vector> &query_result); std::vector GetDbHandles(); DWORD GetDbHandleByDbName(wchar_t *dbname); unsigned int GetLocalIdByMsgId(ULONG64 msgid, int &dbIndex); std::vector GetChatMsgByMsgId(ULONG64 msgid); std::string GetVoiceBuffByMsgId(ULONG64 msgid); private: int SelectDataInner(DWORD db, const char *sql, std::vector> &data); private: std::map dbmap_; std::vector dbs_; DWORD base_addr_; }; } // namespace wxhelper #endif