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.
18 //#include "k8history.h"
24 class HistoryMessage
: public HistoryMessageBase
{
25 friend class HistoryFile
;
28 HistoryMessage () : HistoryMessageBase() {}
29 virtual ~HistoryMessage () {}
32 const uchar
*parse (const uchar
*ptr
, int *maxleft
, const QString
&myUni
);
36 class HistoryFile
: public HistoryFileBase
{
37 friend class HistoryMessage
;
40 HistoryFile (const QString
&fname
, const QString
&myUni
);
41 virtual ~HistoryFile ();
43 virtual bool open (OpenMode newmode
);
44 //virtual bool open (bool allowCreate);
45 virtual bool isOpen () const;
46 //virtual bool exists () const;
47 virtual void close ();
48 virtual void remove ();
52 virtual bool append (const HistoryMessage
&msg
);
54 /* idx: 0..count-1; idx<0: idx += count; */
55 virtual bool read (int idx
, HistoryMessage
&msg
);
61 int mCount
; // -1: not counted yet
66 QList
<uint
> mMsgOfs
; // [0..mCount] (the last one marks position for adding new message)