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__
16 #if wxUSE_ZLIB && wxUSE_STREAMS
18 #include <wx/stream.h>
20 //--------------------------------------------------------------------------------
22 // This class is input stream from ZIP archive. The archive
23 // must be local file (accessible via FILE*)
24 //--------------------------------------------------------------------------------
27 class WXDLLEXPORT wxZipInputStream
: public wxInputStream
33 // this void* is handle of archive .
34 // I'm sorry it is void and not proper type but I don't want
35 // to make unzip.h header public.
38 wxZipInputStream(const wxString
& archive
, const wxString
& file
);
39 // archive is name of .zip archive, file is name of file to be extracted.
40 // Remember that archive must be local file accesible via fopen, fread functions!
44 virtual size_t StreamSize() const {return m_Size
;}
45 virtual size_t OnSysRead(void *buffer
, size_t bufsize
);
46 virtual off_t
OnSysSeek(off_t seek
, wxSeekMode mode
);
47 virtual off_t
OnSysTell() const {return m_Pos
;}
51 #endif // if use_zlib && use_streams
53 #endif // __ZIPSTREAM_H__