]>
Commit | Line | Data |
---|---|---|
79c3e0e1 GL |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: zstream.h | |
3 | // Purpose: Memory stream classes | |
4 | // Author: Guilhem Lavaux | |
5 | // Modified by: | |
6 | // Created: 11/07/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Guilhem Lavaux | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | #ifndef __WXZSTREAM_H__ | |
12 | #define __WXZSTREAM_H__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include <wx/stream.h> | |
19 | #include "zlib.h" | |
20 | ||
21 | class wxZlibInputStream: public wxFilterInputStream { | |
79c3e0e1 GL |
22 | public: |
23 | wxZlibInputStream(wxInputStream& stream); | |
24 | virtual ~wxZlibInputStream(); | |
25 | ||
26 | wxInputStream& Read(void *buffer, size_t size); | |
27 | off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart); | |
28 | off_t TellI() const; | |
29 | ||
30 | size_t LastRead() const { return m_lastread; } | |
31 | bool Eof() const; | |
32 | ||
33 | protected: | |
34 | size_t m_lastread; | |
35 | size_t m_z_size; | |
36 | unsigned char *m_z_buffer; | |
37 | bool m_eof; | |
38 | struct z_stream_s m_inflate; | |
39 | }; | |
40 | ||
41 | class wxZlibOutputStream: public wxFilterOutputStream { | |
79c3e0e1 GL |
42 | public: |
43 | wxZlibOutputStream(wxOutputStream& stream); | |
44 | virtual ~wxZlibOutputStream(); | |
45 | ||
46 | wxOutputStream& Write(const void *buffer, size_t size); | |
47 | off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart); | |
48 | off_t TellO() const; | |
49 | ||
50 | size_t LastWrite() const { return m_lastwrite; } | |
51 | bool Bad() const; | |
52 | ||
53 | protected: | |
54 | size_t m_lastwrite; | |
55 | size_t m_z_size; | |
56 | unsigned char *m_z_buffer; | |
57 | bool m_bad; | |
58 | struct z_stream_s m_deflate; | |
59 | }; | |
60 | ||
61 | #endif |