1999-02-06 08:32:46 -05:00
|
|
|
% -----------------------------------------------------------------------------
|
|
|
|
% wxZlibInputStream
|
|
|
|
% -----------------------------------------------------------------------------
|
1999-02-10 17:44:53 -05:00
|
|
|
\section{\class{wxZlibInputStream}}\label{wxzlibinputstream}
|
1999-02-06 08:32:46 -05:00
|
|
|
|
2003-12-20 23:28:45 -05:00
|
|
|
This filter stream decompresses a stream that is in zlib or gzip format.
|
2004-04-11 15:34:56 -04:00
|
|
|
Note that reading the gzip format requires zlib version 1.2.1 or greater,
|
2004-10-22 15:15:35 -04:00
|
|
|
(the builtin version does support gzip format).
|
1999-11-01 15:36:43 -05:00
|
|
|
|
2003-09-26 16:07:22 -04:00
|
|
|
The stream is not seekable, \helpref{SeekI()}{wxinputstreamseeki} returns
|
|
|
|
{\it wxInvalidOffset}. Also \helpref{GetSize()}{wxstreambasegetsize} is
|
|
|
|
not supported, it always returns $0$.
|
|
|
|
|
1999-02-06 08:32:46 -05:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxFilterInputStream}{wxfilterinputstream}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/zstream.h>
|
|
|
|
|
1999-02-06 08:32:46 -05:00
|
|
|
\wxheading{See also}
|
|
|
|
|
2003-09-26 16:07:22 -04:00
|
|
|
\helpref{wxInputStream}{wxinputstream},
|
|
|
|
\helpref{wxZlibOutputStream}{wxzliboutputstream}.
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{wxZlibInputStream::wxZlibInputStream}\label{wxzlibinputstreamwxzlibinputstream}
|
2003-09-26 16:07:22 -04:00
|
|
|
|
2004-04-11 15:34:56 -04:00
|
|
|
\func{}{wxZlibInputStream}{\param{wxInputStream\&}{ stream}, \param{int}{ flags = wxZLIB\_AUTO}}
|
2003-09-26 16:07:22 -04:00
|
|
|
|
2003-12-20 23:28:45 -05:00
|
|
|
The {\it flags} wxZLIB\_ZLIB and wxZLIB\_GZIP specify whether the input data
|
2004-04-11 15:34:56 -04:00
|
|
|
is in zlib or gzip format. If wxZLIB\_AUTO is used, then zlib will
|
2003-12-20 23:28:45 -05:00
|
|
|
autodetect the stream type, this is the default.
|
2004-04-11 15:34:56 -04:00
|
|
|
|
|
|
|
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,
|
2004-10-22 15:15:35 -04:00
|
|
|
there is a compatibility mode, which is switched on by passing
|
|
|
|
wxZLIB\_24COMPATIBLE for flags. Note that in when operating in compatibility
|
2004-04-11 15:34:56 -04:00
|
|
|
mode error checking is very much reduced.
|
|
|
|
%endif
|
2003-09-26 16:07:22 -04:00
|
|
|
|
2003-12-20 23:28:45 -05:00
|
|
|
The following symbols can be use for the flags:
|
2003-09-26 16:07:22 -04:00
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
// Flags
|
|
|
|
enum {
|
2004-04-11 15:34:56 -04:00
|
|
|
#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
|
2003-12-20 23:28:45 -05:00
|
|
|
};
|
2003-09-26 16:07:22 -04:00
|
|
|
\end{verbatim}
|
|
|
|
|
2004-04-11 15:34:56 -04:00
|
|
|
\membersection{wxZlibInputStream::CanHandleGZip}\label{wxzlibinputstreamcanhandlegzip}
|
|
|
|
|
|
|
|
\func{static bool}{CanHandleGZip}{\void}
|
|
|
|
|
|
|
|
Returns true if zlib library in use can handle gzip compressed data.
|
1999-02-06 08:32:46 -05:00
|
|
|
|
|
|
|
% -----------------------------------------------------------------------------
|
|
|
|
% wxZlibOutputStream
|
|
|
|
% -----------------------------------------------------------------------------
|
1999-02-10 17:44:53 -05:00
|
|
|
\section{\class{wxZlibOutputStream}}\label{wxzliboutputstream}
|
1999-02-06 08:32:46 -05:00
|
|
|
|
2003-12-20 23:28:45 -05:00
|
|
|
This stream compresses all data written to it. The compressed output can be
|
|
|
|
in zlib or gzip format.
|
2004-04-11 15:34:56 -04:00
|
|
|
Note that writing the gzip format requires zlib version 1.2.1 or greater
|
2004-10-22 15:15:35 -04:00
|
|
|
(the builtin version does support gzip format).
|
1999-11-01 15:36:43 -05:00
|
|
|
|
2003-09-26 16:07:22 -04:00
|
|
|
The stream is not seekable, \helpref{SeekO()}{wxoutputstreamseeko} returns
|
|
|
|
{\it wxInvalidOffset}.
|
|
|
|
|
1999-02-06 08:32:46 -05:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxFilterOutputStream}{wxfilteroutputstream}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/zstream.h>
|
|
|
|
|
1999-02-06 08:32:46 -05:00
|
|
|
\wxheading{See also}
|
|
|
|
|
2003-09-26 16:07:22 -04:00
|
|
|
\helpref{wxOutputStream}{wxoutputstream},
|
|
|
|
\helpref{wxZlibInputStream}{wxzlibinputstream}
|
1999-02-06 08:32:46 -05:00
|
|
|
|
2000-03-03 17:52:17 -05:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-21 09:24:41 -04:00
|
|
|
\membersection{wxZlibOutputStream::wxZlibOutputStream}\label{wxzliboutputstreamwxzliboutputstream}
|
2000-03-03 17:52:17 -05:00
|
|
|
|
2003-12-20 23:28:45 -05:00
|
|
|
\func{}{wxZlibOutputStream}{\param{wxOutputStream\&}{ stream}, \param{int}{ level = -1}, \param{int}{ flags = wxZLIB\_ZLIB}}
|
2000-03-03 17:52:17 -05:00
|
|
|
|
|
|
|
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).
|
2003-09-26 16:07:22 -04:00
|
|
|
|
2003-12-20 23:28:45 -05:00
|
|
|
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.
|
2004-04-11 15:34:56 -04:00
|
|
|
|
|
|
|
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.
|
2003-09-26 16:07:22 -04:00
|
|
|
|
|
|
|
The following symbols can be use for the compression level and flags:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
// Compression level
|
|
|
|
enum {
|
|
|
|
wxZ_DEFAULT_COMPRESSION = -1,
|
|
|
|
wxZ_NO_COMPRESSION = 0,
|
|
|
|
wxZ_BEST_SPEED = 1,
|
|
|
|
wxZ_BEST_COMPRESSION = 9
|
2003-12-20 23:28:45 -05:00
|
|
|
};
|
2003-09-26 16:07:22 -04:00
|
|
|
|
|
|
|
// Flags
|
|
|
|
enum {
|
2003-12-20 23:28:45 -05:00
|
|
|
wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum
|
|
|
|
wxZLIB_ZLIB = 1, // zlib header and checksum
|
2004-04-11 15:34:56 -04:00
|
|
|
wxZLIB_GZIP = 2 // gzip header and checksum, requires zlib 1.2.1+
|
2003-12-20 23:28:45 -05:00
|
|
|
};
|
2003-09-26 16:07:22 -04:00
|
|
|
\end{verbatim}
|
|
|
|
|
2004-04-11 15:34:56 -04:00
|
|
|
\membersection{wxZlibOutputStream::CanHandleGZip}\label{wxoutputstreamcanhandlegzip}
|
|
|
|
|
|
|
|
\func{static bool}{CanHandleGZip}{\void}
|
|
|
|
|
|
|
|
Returns true if zlib library in use can handle gzip compressed data.
|
|
|
|
|