]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/strmzlib.tex
Documented new menu label functions
[wxWidgets.git] / docs / latex / wx / strmzlib.tex
1 % -----------------------------------------------------------------------------
2 % wxZlibInputStream
3 % -----------------------------------------------------------------------------
4 \section{\class{wxZlibInputStream}}\label{wxzlibinputstream}
5
6 This filter stream decompresses a stream that is in zlib or gzip format.
7 Note that reading the gzip format requires zlib version 1.2.1 or greater,
8 (the builtin version does support gzip format).
9
10 The stream is not seekable, \helpref{SeekI()}{wxinputstreamseeki} returns
11 {\it wxInvalidOffset}. Also \helpref{GetSize()}{wxstreambasegetsize} is
12 not supported, it always returns $0$.
13
14 \wxheading{Derived from}
15
16 \helpref{wxFilterInputStream}{wxfilterinputstream}
17
18 \wxheading{Include files}
19
20 <wx/zstream.h>
21
22 \wxheading{Library}
23
24 \helpref{wxBase}{librarieslist}
25
26 \wxheading{See also}
27
28 \helpref{wxInputStream}{wxinputstream},
29 \helpref{wxZlibOutputStream}{wxzliboutputstream}.
30
31 \latexignore{\rtfignore{\wxheading{Members}}}
32
33 \membersection{wxZlibInputStream::wxZlibInputStream}\label{wxzlibinputstreamwxzlibinputstream}
34
35 \func{}{wxZlibInputStream}{\param{wxInputStream\&}{ stream}, \param{int}{ flags = wxZLIB\_AUTO}}
36
37 \func{}{wxZlibInputStream}{\param{wxInputStream*}{ stream}, \param{int}{ flags = wxZLIB\_AUTO}}
38
39 If the parent stream is passed as a pointer then the new filter stream
40 takes ownership of it. If it is passed by reference then it does not.
41
42 The {\it flags} wxZLIB\_ZLIB and wxZLIB\_GZIP specify whether the input data
43 is in zlib or gzip format. If wxZLIB\_AUTO is used, then zlib will
44 autodetect the stream type, this is the default.
45
46 If {\it flags} is wxZLIB\_NO\_HEADER, then the data is assumed to be a raw
47 deflate stream without either zlib or gzip headers. This is a lower level
48 mode, which is not usually used directly. It can be used to read a raw
49 deflate stream embedded in a higher level protocol.
50
51 %if WXWIN_COMPATIBILITY_2_4
52 This version is not by default compatible with the output produced by
53 the version of {\it wxZlibOutputStream} in wxWidgets 2.4.x. However,
54 there is a compatibility mode, which is switched on by passing
55 wxZLIB\_24COMPATIBLE for flags. Note that in when operating in compatibility
56 mode error checking is very much reduced.
57 %endif
58
59 The following symbols can be use for the flags:
60
61 \begin{verbatim}
62 // Flags
63 enum {
64 #if WXWIN_COMPATIBILITY_2_4
65 wxZLIB_24COMPATIBLE = 4, // read v2.4.x data without error
66 #endif
67 wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum
68 wxZLIB_ZLIB = 1, // zlib header and checksum
69 wxZLIB_GZIP = 2, // gzip header and checksum, requires zlib 1.2.1+
70 wxZLIB_AUTO = 3 // autodetect header zlib or gzip
71 };
72 \end{verbatim}
73
74 \membersection{wxZlibInputStream::CanHandleGZip}\label{wxzlibinputstreamcanhandlegzip}
75
76 \func{static bool}{CanHandleGZip}{\void}
77
78 Returns true if zlib library in use can handle gzip compressed data.
79
80 % -----------------------------------------------------------------------------
81 % wxZlibOutputStream
82 % -----------------------------------------------------------------------------
83 \section{\class{wxZlibOutputStream}}\label{wxzliboutputstream}
84
85 This stream compresses all data written to it. The compressed output can be
86 in zlib or gzip format.
87 Note that writing the gzip format requires zlib version 1.2.1 or greater
88 (the builtin version does support gzip format).
89
90 The stream is not seekable, \helpref{SeekO()}{wxoutputstreamseeko} returns
91 {\it wxInvalidOffset}.
92
93 \wxheading{Derived from}
94
95 \helpref{wxFilterOutputStream}{wxfilteroutputstream}
96
97 \wxheading{Include files}
98
99 <wx/zstream.h>
100
101 \wxheading{Library}
102
103 \helpref{wxBase}{librarieslist}
104
105 \wxheading{See also}
106
107 \helpref{wxOutputStream}{wxoutputstream},
108 \helpref{wxZlibInputStream}{wxzlibinputstream}
109
110
111 \latexignore{\rtfignore{\wxheading{Members}}}
112
113 \membersection{wxZlibOutputStream::wxZlibOutputStream}\label{wxzliboutputstreamwxzliboutputstream}
114
115 \func{}{wxZlibOutputStream}{\param{wxOutputStream\&}{ stream}, \param{int}{ level = -1}, \param{int}{ flags = wxZLIB\_ZLIB}}
116
117 \func{}{wxZlibOutputStream}{\param{wxOutputStream*}{ stream}, \param{int}{ level = -1}, \param{int}{ flags = wxZLIB\_ZLIB}}
118
119 Creates a new write-only compressed stream. {\it level} means level of
120 compression. It is number between 0 and 9 (including these values) where
121 0 means no compression and 9 best but slowest compression. -1 is default
122 value (currently equivalent to 6).
123
124 If the parent stream is passed as a pointer then the new filter stream
125 takes ownership of it. If it is passed by reference then it does not.
126
127 The {\it flags} wxZLIB\_ZLIB and wxZLIB\_GZIP specify whether the output data
128 will be in zlib or gzip format. wxZLIB\_ZLIB is the default.
129
130 If {\it flags} is wxZLIB\_NO\_HEADER, then a raw deflate stream is output
131 without either zlib or gzip headers. This is a lower level
132 mode, which is not usually used directly. It can be used to embed a raw
133 deflate stream in a higher level protocol.
134
135 The following symbols can be use for the compression level and flags:
136
137 \begin{verbatim}
138 // Compression level
139 enum {
140 wxZ_DEFAULT_COMPRESSION = -1,
141 wxZ_NO_COMPRESSION = 0,
142 wxZ_BEST_SPEED = 1,
143 wxZ_BEST_COMPRESSION = 9
144 };
145
146 // Flags
147 enum {
148 wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum
149 wxZLIB_ZLIB = 1, // zlib header and checksum
150 wxZLIB_GZIP = 2 // gzip header and checksum, requires zlib 1.2.1+
151 };
152 \end{verbatim}
153
154 \membersection{wxZlibOutputStream::CanHandleGZip}\label{wxoutputstreamcanhandlegzip}
155
156 \func{static bool}{CanHandleGZip}{\void}
157
158 Returns true if zlib library in use can handle gzip compressed data.
159