summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Bkmks.h
authorllornkcor <llornkcor>2002-09-14 02:19:09 (UTC)
committer llornkcor <llornkcor>2002-09-14 02:19:09 (UTC)
commit2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975 (patch) (unidiff)
treeeeed16b5f80dd5883991a7a06133f5f7a6936256 /noncore/apps/opie-reader/Bkmks.h
parent5a95ed6a000a56849b8f093deea500214856c626 (diff)
downloadopie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.zip
opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.gz
opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.bz2
update by Tim
Diffstat (limited to 'noncore/apps/opie-reader/Bkmks.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Bkmks.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/Bkmks.h b/noncore/apps/opie-reader/Bkmks.h
new file mode 100644
index 0000000..b38184a
--- a/dev/null
+++ b/noncore/apps/opie-reader/Bkmks.h
@@ -0,0 +1,53 @@
1#ifndef __Bkmks_h
2#define __Bkmks_h
3
4#include "config.h"
5#include <stdio.h>
6
7template<class T>
8class CList;
9
10class Bkmk
11{
12 friend class BkmkFile;
13 tchar* m_name;
14 tchar* m_anno;
15 unsigned int m_position;
16 public:
17 Bkmk() : m_name(NULL), m_anno(NULL), m_position(0) {};
18 Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p);
19 Bkmk(const Bkmk& rhs) : m_name(NULL), m_anno(NULL)
20 {
21 *this = rhs;
22 }
23 ~Bkmk();
24 unsigned int value() const { return m_position; }
25 tchar *name() const { return m_name; }
26 tchar *anno() const { return m_anno; }
27 bool operator<(const Bkmk& rhs) { return (m_position < rhs.m_position); }
28 Bkmk& operator=(const Bkmk& rhs);
29 bool operator==(const Bkmk& rhs);
30 void setAnno(tchar* t);
31};
32
33class BkmkFile
34{
35 FILE* f;
36 bool wt;
37 bool isUpgraded;
38 static const unsigned long magic;
39 private:
40 Bkmk* read();
41 Bkmk* read03();
42 CList<Bkmk>* readall03();
43 CList<Bkmk>* readall04();
44 void write(tchar* nm, tchar* an, const unsigned int& pos);
45 void write(const Bkmk& b);
46 public:
47 bool upgraded() { return isUpgraded; }
48 BkmkFile(const char *fnm, bool w = false);
49 ~BkmkFile();
50 void write(CList<Bkmk>& bl);
51 CList<Bkmk>* readall();
52};
53#endif