]> git.saurik.com Git - wxWidgets.git/blob - include/wx/zipstream.h
*** empty log message ***
[wxWidgets.git] / include / wx / zipstream.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: zipstream.h
3 // Purpose: wxZipInputStream for reading files from ZIP archive
4 // Author: Vaclav Slavik
5 // Copyright: (c) 1999 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 #ifndef __ZIPSTREAM_H__
10 #define __ZIPSTREAM_H__
11
12 #ifdef __GNUG__
13 #pragma interface
14 #endif
15
16 #if wxUSE_ZLIB && wxUSE_STREAMS
17
18 #include <wx/stream.h>
19
20 //--------------------------------------------------------------------------------
21 // wxZipInputStream
22 // This class is input stream from ZIP archive. The archive
23 // must be local file (accessible via FILE*)
24 //--------------------------------------------------------------------------------
25
26
27 class WXDLLEXPORT wxZipInputStream : public wxInputStream
28 {
29 private:
30 size_t m_Size;
31 off_t m_Pos;
32 void *m_Archive;
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.
36
37 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!
41 ~wxZipInputStream();
42
43 protected:
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;}
48 };
49
50
51 #endif // if use_zlib && use_streams
52
53 #endif // __ZIPSTREAM_H__
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70