]>
git.saurik.com Git - wxWidgets.git/blob - interface/zstream.h
6b7937c3756670b169220bab334e3c1a853c9a3e
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxZlibOutputStream class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxZlibOutputStream
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).
18 The stream is not seekable, wxOutputStream::SeekO returns
25 wxOutputStream, wxZlibInputStream
27 class wxZlibOutputStream
: public wxFilterOutputStream
32 Creates a new write-only compressed stream. @a level means level of
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 If the parent stream is passed as a pointer then the new filter stream
37 takes ownership of it. If it is passed by reference then it does not.
38 The @a flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the output data
39 will be in zlib or gzip format. wxZLIB_ZLIB is the default.
40 If @a flags is wxZLIB_NO_HEADER, then a raw deflate stream is output
41 without either zlib or gzip headers. This is a lower level
42 mode, which is not usually used directly. It can be used to embed a raw
43 deflate stream in a higher level protocol.
44 The following symbols can be use for the compression level and flags:
46 wxZlibOutputStream(wxOutputStream
& stream
, int level
= -1,
47 int flags
= wxZLIB_ZLIB
);
48 wxZlibOutputStream(wxOutputStream
* stream
, int level
= -1,
49 int flags
= wxZLIB_ZLIB
);
53 Returns @true if zlib library in use can handle gzip compressed data.
55 static bool CanHandleGZip();
60 @class wxZlibInputStream
63 This filter stream decompresses a stream that is in zlib or gzip format.
64 Note that reading the gzip format requires zlib version 1.2.1 or greater,
65 (the builtin version does support gzip format).
67 The stream is not seekable, wxInputStream::SeekI returns
68 @e wxInvalidOffset. Also wxStreamBase::GetSize is
69 not supported, it always returns 0.
75 wxInputStream, wxZlibOutputStream.
77 class wxZlibInputStream
: public wxFilterInputStream
82 If the parent stream is passed as a pointer then the new filter stream
83 takes ownership of it. If it is passed by reference then it does not.
84 The @a flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the input data
85 is in zlib or gzip format. If wxZLIB_AUTO is used, then zlib will
86 autodetect the stream type, this is the default.
87 If @a flags is wxZLIB_NO_HEADER, then the data is assumed to be a raw
88 deflate stream without either zlib or gzip headers. This is a lower level
89 mode, which is not usually used directly. It can be used to read a raw
90 deflate stream embedded in a higher level protocol.
91 This version is not by default compatible with the output produced by
92 the version of @e wxZlibOutputStream in wxWidgets 2.4.x. However,
93 there is a compatibility mode, which is switched on by passing
94 wxZLIB_24COMPATIBLE for flags. Note that in when operating in compatibility
95 mode error checking is very much reduced.
96 The following symbols can be use for the flags:
98 wxZlibInputStream(wxInputStream
& stream
, int flags
= wxZLIB_AUTO
);
99 wxZlibInputStream(wxInputStream
* stream
,
100 int flags
= wxZLIB_AUTO
);
104 Returns @true if zlib library in use can handle gzip compressed data.
106 static bool CanHandleGZip();