X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0915d0b2e210701353ef30743d0df9c195f76295..cec5ffc46da1cf66cb3e61567006a8c0f4b84f81:/docs/latex/wx/strmzlib.tex?ds=sidebyside diff --git a/docs/latex/wx/strmzlib.tex b/docs/latex/wx/strmzlib.tex index a16745b8fb..722011a33a 100644 --- a/docs/latex/wx/strmzlib.tex +++ b/docs/latex/wx/strmzlib.tex @@ -3,8 +3,9 @@ % ----------------------------------------------------------------------------- \section{\class{wxZlibInputStream}}\label{wxzlibinputstream} -This stream uncompresses all data read from it. It uses the "filtered" -stream to get new compressed data. +This filter stream decompresses a stream that is in zlib or gzip format. +Note that reading the gzip format requires zlib version 1.2.1 or greater, +(the builtin version does support gzip format). The stream is not seekable, \helpref{SeekI()}{wxinputstreamseeki} returns {\it wxInvalidOffset}. Also \helpref{GetSize()}{wxstreambasegetsize} is @@ -25,31 +26,57 @@ not supported, it always returns $0$. \latexignore{\rtfignore{\wxheading{Members}}} -\membersection{wxZlibInputStream::wxZlibInputStream} +\membersection{wxZlibInputStream::wxZlibInputStream}\label{wxzlibinputstreamwxzlibinputstream} -\func{}{wxZlibInputStream}{\param{wxInputStream\&}{ stream}, \param{int}{ flags = 0}} +\func{}{wxZlibInputStream}{\param{wxInputStream\&}{ stream}, \param{int}{ flags = wxZLIB\_AUTO}} -{\it flags} should be omitted for normal usage. The flag {\it wxZLIB\_NO_HEADER} - is needed when wxZlibInputStream is used as an 'inflate' decompressor for gzip -or zip files. +The {\it flags} wxZLIB\_ZLIB and wxZLIB\_GZIP specify whether the input data +is in zlib or gzip format. If wxZLIB\_AUTO is used, then zlib will +autodetect the stream type, this is the default. -{\it wxZLIB\_NO_HEADER} is currently the only flag: +If {\it flags} is wxZLIB\_NO\_HEADER, then the data is assumed to be a raw +deflate stream without either zlib or gzip headers. This is a lower level +mode, which is not usually used directly. It can be used to read a raw +deflate stream embedded in a higher level protocol. + +%if WXWIN_COMPATIBILITY_2_4 +This version is not by default compatible with the output produced by +the version of {\it wxZlibOutputStream} in wxWidgets 2.4.x. However, +there is a compatibility mode, which is switched on by passing +wxZLIB\_24COMPATIBLE for flags. Note that in when operating in compatibility +mode error checking is very much reduced. +%endif + +The following symbols can be use for the flags: \begin{verbatim} // Flags enum { - wxZLIB_NO_HEADER = 1 // required for use in Gzip and Zip files -} +#if WXWIN_COMPATIBILITY_2_4 + wxZLIB_24COMPATIBLE = 4, // read v2.4.x data without error +#endif + 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.1+ + wxZLIB_AUTO = 3 // autodetect header zlib or gzip +}; \end{verbatim} +\membersection{wxZlibInputStream::CanHandleGZip}\label{wxzlibinputstreamcanhandlegzip} + +\func{static bool}{CanHandleGZip}{\void} + +Returns true if zlib library in use can handle gzip compressed data. % ----------------------------------------------------------------------------- % wxZlibOutputStream % ----------------------------------------------------------------------------- \section{\class{wxZlibOutputStream}}\label{wxzliboutputstream} -This stream compresses all data written to it, and passes the compressed data -to the "filtered" stream. +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.1 or greater +(the builtin version does support gzip format). The stream is not seekable, \helpref{SeekO()}{wxoutputstreamseeko} returns {\it wxInvalidOffset}. @@ -70,18 +97,22 @@ The stream is not seekable, \helpref{SeekO()}{wxoutputstreamseeko} returns \latexignore{\rtfignore{\wxheading{Members}}} -\membersection{wxZlibOutputStream::wxZlibOutputStream} +\membersection{wxZlibOutputStream::wxZlibOutputStream}\label{wxzliboutputstreamwxzliboutputstream} -\func{}{wxZlibOutputStream}{\param{wxOutputStream\&}{ stream}, \param{int}{ level = -1}, \param{int}{ flags = 0}} +\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). -{\it flags} should be omitted for normal usage. The flag {\it wxZLIB\_NO_HEADER} - suppresses the generation of the zlib header and checksum, and is required -when wxZlibOutputStream is used as a 'deflate' compressor for gzip or zip files. +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 wxZLIB\_NO\_HEADER, then a raw deflate stream is output +without either zlib or gzip headers. This is a lower level +mode, which is not usually used directly. It can be used to embed a raw +deflate stream in a higher level protocol. The following symbols can be use for the compression level and flags: @@ -92,11 +123,19 @@ enum { wxZ_NO_COMPRESSION = 0, wxZ_BEST_SPEED = 1, wxZ_BEST_COMPRESSION = 9 -} +}; // Flags enum { - wxZLIB_NO_HEADER = 1 // required for use in Gzip and Zip files -} + 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.1+ +}; \end{verbatim} +\membersection{wxZlibOutputStream::CanHandleGZip}\label{wxoutputstreamcanhandlegzip} + +\func{static bool}{CanHandleGZip}{\void} + +Returns true if zlib library in use can handle gzip compressed data. +