summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/ZText.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/ZText.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/ZText.h7
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
10class Text: public CExpander { 9class Text: public CExpander {
11 gzFile file; 10 gzFile file;
12 unsigned long fsize; 11 unsigned long fsize;
13public: 12public:
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