Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

chminputstream.h

00001 /*
00002 
00003   Copyright (C) 2003  Razvan Cojocaru <razvanco@gmx.net>
00004  
00005   This program is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU General Public License as published by
00007   the Free Software Foundation; either version 2 of the License, or
00008   (at your option) any later version.
00009   
00010   This program is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU General Public License for more details.
00014   
00015   You should have received a copy of the GNU General Public License
00016   along with this program; if not, write to the Free Software
00017   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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();
00068         static void Cleanup();
00069         
00070 protected:
00077         virtual size_t OnSysRead(void *buffer, size_t bufsize);
00078 
00085 #ifdef __WXMSW__
00086         virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode);
00087 #else
00088         virtual off_t OnSysSeek(off_t seek, wxSeekMode mode);
00089 #endif
00090 
00095 #ifdef __WXMSW__
00096         virtual wxFileOffset OnSysTell() const { return _currPos; }
00097 #else
00098         virtual off_t OnSysTell() const { return _currPos; }
00099 #endif
00100 
00101 private:
00103         bool Init(const wxString& archive);
00104 
00105 
00106 private:
00107         static CHMFile *_archiveCache;
00108         off_t _currPos;
00109         chmUnitInfo _ui;
00110         static wxString _path;
00111 };
00112 
00113 #endif // __CHMINPUTSTREAM_H_
00114 
00115 
00116 /*
00117   Local Variables:
00118   mode: c++
00119   c-basic-offset: 8
00120   tab-width: 8
00121   c-indent-comments-syntactically-p: t
00122   c-tab-always-indent: t
00123   indent-tabs-mode: t
00124   End:
00125 */
00126 
00127 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8

Generated on Mon May 22 12:43:42 2006 for xCHM by  doxygen 1.4.4