]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: zstream.h | |
3 | // Purpose: documentation for wxZlibOutputStream class | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxZlibOutputStream | |
11 | @wxheader{zstream.h} | |
7c913512 | 12 | |
23324ae1 FM |
13 | This stream compresses all data written to it. The compressed output can be |
14 | in zlib or gzip format. | |
15 | Note that writing the gzip format requires zlib version 1.2.1 or greater | |
16 | (the builtin version does support gzip format). | |
7c913512 | 17 | |
23324ae1 FM |
18 | The stream is not seekable, wxOutputStream::SeekO returns |
19 | @e wxInvalidOffset. | |
7c913512 | 20 | |
23324ae1 FM |
21 | @library{wxbase} |
22 | @category{streams} | |
7c913512 | 23 | |
23324ae1 FM |
24 | @seealso |
25 | wxOutputStream, wxZlibInputStream | |
26 | */ | |
27 | class wxZlibOutputStream : public wxFilterOutputStream | |
28 | { | |
29 | public: | |
30 | //@{ | |
31 | /** | |
7c913512 | 32 | Creates a new write-only compressed stream. @e level means level of |
23324ae1 FM |
33 | compression. It is number between 0 and 9 (including these values) where |
34 | 0 means no compression and 9 best but slowest compression. -1 is default | |
35 | value (currently equivalent to 6). | |
36 | ||
37 | If the parent stream is passed as a pointer then the new filter stream | |
38 | takes ownership of it. If it is passed by reference then it does not. | |
39 | ||
40 | The @e flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the output data | |
41 | will be in zlib or gzip format. wxZLIB_ZLIB is the default. | |
42 | ||
43 | If @e flags is wxZLIB_NO_HEADER, then a raw deflate stream is output | |
44 | without either zlib or gzip headers. This is a lower level | |
45 | mode, which is not usually used directly. It can be used to embed a raw | |
46 | deflate stream in a higher level protocol. | |
47 | ||
48 | The following symbols can be use for the compression level and flags: | |
49 | */ | |
50 | wxZlibOutputStream(wxOutputStream& stream, int level = -1, | |
51 | int flags = wxZLIB_ZLIB); | |
7c913512 FM |
52 | wxZlibOutputStream(wxOutputStream* stream, int level = -1, |
53 | int flags = wxZLIB_ZLIB); | |
23324ae1 FM |
54 | //@} |
55 | ||
56 | /** | |
57 | Returns @true if zlib library in use can handle gzip compressed data. | |
58 | */ | |
59 | static bool CanHandleGZip(); | |
60 | }; | |
61 | ||
62 | ||
63 | /** | |
64 | @class wxZlibInputStream | |
65 | @wxheader{zstream.h} | |
7c913512 | 66 | |
23324ae1 FM |
67 | This filter stream decompresses a stream that is in zlib or gzip format. |
68 | Note that reading the gzip format requires zlib version 1.2.1 or greater, | |
69 | (the builtin version does support gzip format). | |
7c913512 | 70 | |
23324ae1 FM |
71 | The stream is not seekable, wxInputStream::SeekI returns |
72 | @e wxInvalidOffset. Also wxStreamBase::GetSize is | |
73 | not supported, it always returns 0. | |
7c913512 | 74 | |
23324ae1 FM |
75 | @library{wxbase} |
76 | @category{streams} | |
7c913512 | 77 | |
23324ae1 FM |
78 | @seealso |
79 | wxInputStream, wxZlibOutputStream. | |
80 | */ | |
81 | class wxZlibInputStream : public wxFilterInputStream | |
82 | { | |
83 | public: | |
84 | //@{ | |
85 | /** | |
86 | If the parent stream is passed as a pointer then the new filter stream | |
87 | takes ownership of it. If it is passed by reference then it does not. | |
88 | ||
89 | The @e flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the input data | |
90 | is in zlib or gzip format. If wxZLIB_AUTO is used, then zlib will | |
91 | autodetect the stream type, this is the default. | |
92 | ||
93 | If @e flags is wxZLIB_NO_HEADER, then the data is assumed to be a raw | |
94 | deflate stream without either zlib or gzip headers. This is a lower level | |
95 | mode, which is not usually used directly. It can be used to read a raw | |
96 | deflate stream embedded in a higher level protocol. | |
97 | ||
98 | This version is not by default compatible with the output produced by | |
99 | the version of @e wxZlibOutputStream in wxWidgets 2.4.x. However, | |
100 | there is a compatibility mode, which is switched on by passing | |
101 | wxZLIB_24COMPATIBLE for flags. Note that in when operating in compatibility | |
102 | mode error checking is very much reduced. | |
103 | The following symbols can be use for the flags: | |
104 | */ | |
105 | wxZlibInputStream(wxInputStream& stream, int flags = wxZLIB_AUTO); | |
7c913512 FM |
106 | wxZlibInputStream(wxInputStream* stream, |
107 | int flags = wxZLIB_AUTO); | |
23324ae1 FM |
108 | //@} |
109 | ||
110 | /** | |
111 | Returns @true if zlib library in use can handle gzip compressed data. | |
112 | */ | |
113 | static bool CanHandleGZip(); | |
114 | }; |