author | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
commit | 2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975 (patch) (unidiff) | |
tree | eeed16b5f80dd5883991a7a06133f5f7a6936256 /noncore/apps/opie-reader/ZText.h | |
parent | 5a95ed6a000a56849b8f093deea500214856c626 (diff) | |
download | opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.zip opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.gz opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.bz2 |
update by Tim
Diffstat (limited to 'noncore/apps/opie-reader/ZText.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ZText.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/apps/opie-reader/ZText.h b/noncore/apps/opie-reader/ZText.h index 4b1b96e..9e72161 100644 --- a/noncore/apps/opie-reader/ZText.h +++ b/noncore/apps/opie-reader/ZText.h | |||
@@ -1,17 +1,16 @@ | |||
1 | #ifndef __Text_h | 1 | #ifndef __Text_h |
2 | #define __Text_h | 2 | #define __Text_h |
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include "zlib/zlib.h" | 4 | #include <zlib.h> |
5 | //#include <zlib.h> | ||
6 | #include <sys/stat.h> | 5 | #include <sys/stat.h> |
7 | 6 | ||
8 | #include "CExpander.h" | 7 | #include "CExpander.h" |
9 | 8 | ||
10 | class Text: public CExpander { | 9 | class Text: public CExpander { |
11 | gzFile file; | 10 | gzFile file; |
12 | unsigned long fsize; | 11 | unsigned long fsize; |
13 | public: | 12 | public: |
14 | Text() : file(NULL) {}; | 13 | Text() : file(NULL) {}; |
15 | virtual ~Text() | 14 | virtual ~Text() |
16 | { | 15 | { |
17 | if (file != NULL) gzclose(file); | 16 | if (file != NULL) gzclose(file); |
@@ -23,14 +22,18 @@ public: | |||
23 | stat(src,&_stat); | 22 | stat(src,&_stat); |
24 | fsize = _stat.st_size; | 23 | fsize = _stat.st_size; |
25 | return ((file = gzopen(src,"rb")) == NULL); | 24 | return ((file = gzopen(src,"rb")) == NULL); |
26 | } | 25 | } |
27 | virtual int getch() { return gzgetc(file); } | 26 | virtual int getch() { return gzgetc(file); } |
28 | virtual unsigned int locate() { return gztell(file); } | 27 | virtual unsigned int locate() { return gztell(file); } |
29 | virtual void locate(unsigned int n) { gzseek(file,n,SEEK_SET); } | 28 | virtual void locate(unsigned int n) { gzseek(file,n,SEEK_SET); } |
30 | virtual bool hasrandomaccess() { return true; } | 29 | virtual bool hasrandomaccess() { return true; } |
31 | virtual void sizes(unsigned long& _file, unsigned long& _text) | 30 | virtual void sizes(unsigned long& _file, unsigned long& _text) |
32 | { | 31 | { |
33 | _text = _file = fsize; | 32 | _text = _file = fsize; |
34 | } | 33 | } |
34 | virtual MarkupType PreferredMarkup() | ||
35 | { | ||
36 | return cTEXT; | ||
37 | } | ||
35 | }; | 38 | }; |
36 | #endif | 39 | #endif |