]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/zstream.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxZlibOutputStream
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxZlibOutputStream
12 This stream compresses all data written to it. The compressed output can be
13 in zlib or gzip format.
14 Note that writing the gzip format requires zlib version 1.2.1 or greater
15 (the builtin version does support gzip format).
17 The stream is not seekable, wxOutputStream::SeekO returns
23 @see wxOutputStream, wxZlibInputStream
25 class wxZlibOutputStream
: public wxFilterOutputStream
30 Creates a new write-only compressed stream. @a level means level of
31 compression. It is number between 0 and 9 (including these values) where
32 0 means no compression and 9 best but slowest compression. -1 is default
33 value (currently equivalent to 6).
34 If the parent stream is passed as a pointer then the new filter stream
35 takes ownership of it. If it is passed by reference then it does not.
36 The @a flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the output data
37 will be in zlib or gzip format. wxZLIB_ZLIB is the default.
38 If @a flags is wxZLIB_NO_HEADER, then a raw deflate stream is output
39 without either zlib or gzip headers. This is a lower level
40 mode, which is not usually used directly. It can be used to embed a raw
41 deflate stream in a higher level protocol.
42 The following symbols can be use for the compression level and flags:
44 wxZlibOutputStream(wxOutputStream
& stream
, int level
= -1,
45 int flags
= wxZLIB_ZLIB
);
46 wxZlibOutputStream(wxOutputStream
* stream
, int level
= -1,
47 int flags
= wxZLIB_ZLIB
);
51 Returns @true if zlib library in use can handle gzip compressed data.
53 static bool CanHandleGZip();
59 @class wxZlibInputStream
61 This filter stream decompresses a stream that is in zlib or gzip format.
62 Note that reading the gzip format requires zlib version 1.2.1 or greater,
63 (the builtin version does support gzip format).
65 The stream is not seekable, wxInputStream::SeekI returns
66 @e wxInvalidOffset. Also wxStreamBase::GetSize is
67 not supported, it always returns 0.
72 @see wxInputStream, wxZlibOutputStream.
74 class wxZlibInputStream
: public wxFilterInputStream
79 If the parent stream is passed as a pointer then the new filter stream
80 takes ownership of it. If it is passed by reference then it does not.
81 The @a flags wxZLIB_ZLIB and wxZLIB_GZIP specify whether the input data
82 is in zlib or gzip format. If wxZLIB_AUTO is used, then zlib will
83 autodetect the stream type, this is the default.
84 If @a flags is wxZLIB_NO_HEADER, then the data is assumed to be a raw
85 deflate stream without either zlib or gzip headers. This is a lower level
86 mode, which is not usually used directly. It can be used to read a raw
87 deflate stream embedded in a higher level protocol.
88 This version is not by default compatible with the output produced by
89 the version of @e wxZlibOutputStream in wxWidgets 2.4.x. However,
90 there is a compatibility mode, which is switched on by passing
91 wxZLIB_24COMPATIBLE for flags. Note that in when operating in compatibility
92 mode error checking is very much reduced.
93 The following symbols can be use for the flags:
95 wxZlibInputStream(wxInputStream
& stream
, int flags
= wxZLIB_AUTO
);
96 wxZlibInputStream(wxInputStream
* stream
,
97 int flags
= wxZLIB_AUTO
);
101 Returns @true if zlib library in use can handle gzip compressed data.
103 static bool CanHandleGZip();