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