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