]>
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> | |
46dc76ba | 19 | #include "../zlib/zlib.h" |
79c3e0e1 GL |
20 | |
21 | class wxZlibInputStream: public wxFilterInputStream { | |
79c3e0e1 GL |
22 | public: |
23 | wxZlibInputStream(wxInputStream& stream); | |
24 | virtual ~wxZlibInputStream(); | |
25 | ||
79c3e0e1 GL |
26 | bool Eof() const; |
27 | ||
28 | protected: | |
1678ad78 | 29 | size_t DoRead(void *buffer, size_t size); |
46dc76ba | 30 | off_t DoSeekInput(off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; } |
1678ad78 GL |
31 | off_t DoTellInput() const { return wxInvalidOffset; } |
32 | ||
33 | protected: | |
79c3e0e1 GL |
34 | size_t m_z_size; |
35 | unsigned char *m_z_buffer; | |
79c3e0e1 GL |
36 | struct z_stream_s m_inflate; |
37 | }; | |
38 | ||
39 | class wxZlibOutputStream: public wxFilterOutputStream { | |
79c3e0e1 GL |
40 | public: |
41 | wxZlibOutputStream(wxOutputStream& stream); | |
42 | virtual ~wxZlibOutputStream(); | |
43 | ||
1678ad78 | 44 | void Sync(); |
79c3e0e1 | 45 | |
79c3e0e1 GL |
46 | bool Bad() const; |
47 | ||
48 | protected: | |
1678ad78 | 49 | size_t DoWrite(const void *buffer, size_t size); |
46dc76ba | 50 | off_t DoSeekOutput(off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) { return wxInvalidOffset; } |
1678ad78 GL |
51 | off_t DoTellOutput() const { return wxInvalidOffset; } |
52 | ||
53 | protected: | |
79c3e0e1 GL |
54 | size_t m_z_size; |
55 | unsigned char *m_z_buffer; | |
79c3e0e1 GL |
56 | struct z_stream_s m_deflate; |
57 | }; | |
58 | ||
59 | #endif |