]>
git.saurik.com Git - wxWidgets.git/blob - interface/zstream.h
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. @e 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).
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.
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.
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.
48 The following symbols can be use for the compression level and flags:
50 wxZlibOutputStream(wxOutputStream
& stream
, int level
= -1,
51 int flags
= wxZLIB_ZLIB
);
52 wxZlibOutputStream(wxOutputStream
* stream
, int level
= -1,
53 int flags
= wxZLIB_ZLIB
);
57 Returns @true if zlib library in use can handle gzip compressed data.
59 static bool CanHandleGZip();
64 @class wxZlibInputStream
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).
71 The stream is not seekable, wxInputStream::SeekI returns
72 @e wxInvalidOffset. Also wxStreamBase::GetSize is
73 not supported, it always returns 0.
79 wxInputStream, wxZlibOutputStream.
81 class wxZlibInputStream
: public wxFilterInputStream
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.
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.
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.
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:
105 wxZlibInputStream(wxInputStream
& stream
, int flags
= wxZLIB_AUTO
);
106 wxZlibInputStream(wxInputStream
* stream
,
107 int flags
= wxZLIB_AUTO
);
111 Returns @true if zlib library in use can handle gzip compressed data.
113 static bool CanHandleGZip();