X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/954b8ae60391d18b87a604e7919c87c0c6ae208b..ec59d2ccea39b0225f49e6dd326d4d11940d656d:/docs/latex/wx/strmzlib.tex diff --git a/docs/latex/wx/strmzlib.tex b/docs/latex/wx/strmzlib.tex index 30997ea0cc..d563a50640 100644 --- a/docs/latex/wx/strmzlib.tex +++ b/docs/latex/wx/strmzlib.tex @@ -3,6 +3,13 @@ % ----------------------------------------------------------------------------- \section{\class{wxZlibInputStream}}\label{wxzlibinputstream} +This filter stream decompresses a stream that is in zlib or gzip format. +Note that reading the gzip format requires zlib version 1.2.0 greater. + +The stream is not seekable, \helpref{SeekI()}{wxinputstreamseeki} returns + {\it wxInvalidOffset}. Also \helpref{GetSize()}{wxstreambasegetsize} is +not supported, it always returns $0$. + \wxheading{Derived from} \helpref{wxFilterInputStream}{wxfilterinputstream} @@ -13,18 +20,45 @@ \wxheading{See also} -\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxInputStream}{wxinputstream} +\helpref{wxInputStream}{wxinputstream}, + \helpref{wxZlibOutputStream}{wxzliboutputstream}. + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxZlibInputStream::wxZlibInputStream} -\wxheading{Short description} +\func{}{wxZlibInputStream}{\param{wxInputStream\&}{ stream}, \param{int}{ flags = wxZLIB\_ZLIB | wxZLIB\_GZIP}} + +The {\it flags} wxZLIB\_ZLIB and wxZLIB\_GZIP specify whether the input data +is in zlib or gzip format. If both are used, bitwise ored, then zlib will +autodetect the stream type, this is the default. +If {\it flags} is zero, then the data is assumed to be a raw deflate stream +without either zlib or gzip headers. + +The following symbols can be use for the flags: + +\begin{verbatim} +// Flags +enum { + wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum + wxZLIB_ZLIB = 1, // zlib header and checksum + wxZLIB_GZIP = 2 // gzip header and checksum, requires zlib 1.2+ +}; +\end{verbatim} -This stream uncompresses all data read from it. It uses the "filtered" -stream to get new compressed data. % ----------------------------------------------------------------------------- % wxZlibOutputStream % ----------------------------------------------------------------------------- \section{\class{wxZlibOutputStream}}\label{wxzliboutputstream} +This stream compresses all data written to it. The compressed output can be +in zlib or gzip format. +Note that writing the gzip format requires zlib version 1.2.0 greater. + +The stream is not seekable, \helpref{SeekO()}{wxoutputstreamseeko} returns + {\it wxInvalidOffset}. + \wxheading{Derived from} \helpref{wxFilterOutputStream}{wxfilteroutputstream} @@ -35,10 +69,42 @@ stream to get new compressed data. \wxheading{See also} -\helpref{wxStreamBuffer}{wxstreamBuffer}, \helpref{wxOutputStream}{wxoutputstream} +\helpref{wxOutputStream}{wxoutputstream}, + \helpref{wxZlibInputStream}{wxzlibinputstream} + + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxZlibOutputStream::wxZlibOutputStream} + +\func{}{wxZlibOutputStream}{\param{wxOutputStream\&}{ stream}, \param{int}{ level = -1}, \param{int}{ flags = wxZLIB\_ZLIB}} + +Creates a new write-only compressed stream. {\it level} means level of +compression. It is number between 0 and 9 (including these values) where +0 means no compression and 9 best but slowest compression. -1 is default +value (currently equivalent to 6). + +The {\it flags} wxZLIB\_ZLIB and wxZLIB\_GZIP specify whether the output data +will be in zlib or gzip format. wxZLIB\_ZLIB is the default. +If {\it flags} is zero, then a raw deflate stream is output without either +zlib or gzip headers. + +The following symbols can be use for the compression level and flags: -\wxheading{Short description} +\begin{verbatim} +// Compression level +enum { + wxZ_DEFAULT_COMPRESSION = -1, + wxZ_NO_COMPRESSION = 0, + wxZ_BEST_SPEED = 1, + wxZ_BEST_COMPRESSION = 9 +}; -This stream compresses all data written to it, and passes the compressed data -to the ``filtered'' stream. +// Flags +enum { + wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum + wxZLIB_ZLIB = 1, // zlib header and checksum + wxZLIB_GZIP = 2 // gzip header and checksum, requires zlib 1.2+ +}; +\end{verbatim}