/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #pragma once #include #include struct sqlite3; namespace Swift { class SQLiteHistoryManager : public HistoryManager { public: SQLiteHistoryManager(const std::string& file); ~SQLiteHistoryManager(); void addMessage(const HistoryMessage& message); std::vector getMessages(const JID&) const; std::vector getAllContacts() const; private: int getIDForJID(const JID&); int addJID(const JID&); void updateConversation(const HistoryMessage& message); boost::optional getJIDFromID(int id) const; boost::optional getIDFromJID(const JID& jid) const; sqlite3* db_; }; }