1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxZipInputStream for reading files from ZIP archive
4 // Author: Vaclav Slavik
5 // Copyright: (c) 1999 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef __ZIPSTREAM_H__
10 #define __ZIPSTREAM_H__
18 #if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
20 #include "wx/stream.h"
22 //--------------------------------------------------------------------------------
24 // This class is input stream from ZIP archive. The archive
25 // must be local file (accessible via FILE*)
26 //--------------------------------------------------------------------------------
29 class WXDLLEXPORT wxZipInputStream
: public wxInputStream
35 // this void* is handle of archive .
36 // I'm sorry it is void and not proper type but I don't want
37 // to make unzip.h header public.
40 wxZipInputStream(const wxString
& archive
, const wxString
& file
);
41 // archive is name of .zip archive, file is name of file to be extracted.
42 // Remember that archive must be local file accesible via fopen, fread functions!
46 virtual size_t StreamSize() const {return m_Size
;}
47 virtual size_t OnSysRead(void *buffer
, size_t bufsize
);
48 virtual off_t
OnSysSeek(off_t seek
, wxSeekMode mode
);
49 virtual off_t
OnSysTell() const {return m_Pos
;}
54 // wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB