00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CHMINPUTSTREAM_H_
00023 #define __CHMINPUTSTREAM_H_
00024
00025 #include <wx/stream.h>
00026 #include <chmfile.h>
00027
00028
00035
00036 class CHMInputStream : public wxInputStream
00037 {
00038 public:
00046 CHMInputStream(const wxString& archive, const wxString& file);
00047
00049 virtual size_t GetSize() const;
00050
00052 virtual bool Eof() const;
00053
00061 static CHMFile* GetCache() { return _archiveCache; }
00062
00069 static void Cleanup();
00070
00071 protected:
00078 virtual size_t OnSysRead(void *buffer, size_t bufsize);
00079
00086 virtual off_t OnSysSeek(off_t seek, wxSeekMode mode);
00087
00092 virtual off_t OnSysTell() const { return _currPos; }
00093
00094 private:
00096 bool Init(const wxString& archive);
00097
00098
00099 private:
00101 static CHMFile *_archiveCache;
00102 off_t _currPos;
00103 chmUnitInfo _ui;
00104 static wxString _path;
00105 };
00106
00107 #endif // __CHMINPUTSTREAM_H_
00108