otr: removed TLV parsing code (i still has to fix SMP queries in callback)
[dyskinesia.git] / src / k8ldbhistory / k8ldbhistory.h
blobeb0c9f3031711463fd9a65d9f1bf11cd85696b4a
1 /* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
2 * Understanding is not required. Only obedience.
4 * This program is free software. It comes without any warranty, to
5 * the extent permitted by applicable law. You can redistribute it
6 * and/or modify it under the terms of the Do What The Fuck You Want
7 * To Public License, Version 2, as published by Sam Hocevar. See
8 * http://sam.zoy.org/wtfpl/COPYING for more details.
9 */
10 #ifdef K8HISTORY_H
11 #ifndef K8LDBHISTORY_H
12 #define K8LDBHISTORY_H
14 #include <QDateTime>
15 #include <QFile>
16 #include <QString>
17 #include <QList>
19 #include "leveldb/db.h"
22 ///////////////////////////////////////////////////////////////////////////////
23 class HistoryFile : public HistoryFileBase {
24 public:
25 HistoryFile (const QString &fname, const QString &myUni);
26 virtual ~HistoryFile ();
28 virtual bool open (OpenMode newmode);
29 virtual bool isOpen () const;
30 virtual void close ();
31 virtual void remove ();
33 virtual int count ();
35 virtual bool append (const HistoryMessage &msg);
37 virtual bool read (int idx, HistoryMessage &msg);
39 private:
40 bool initialize ();
42 private:
43 HistoryFile::OpenMode mMode;
44 QString mName;
45 QString mMyUni;
46 int mCount; // -1: not counted yet
47 leveldb::DB *mDb;
51 #endif
52 #endif