2 % automatically generated by HelpGen $Revision$ from
3 % gzstream.h at 20/Aug/03 18:41:55
10 \section{\class{wxGzipInputStream
}}\label{wxgzipinputstream
}
12 A stream filter to decompress gzipped data. The gzip format is specified in
15 A gzip stream can contain the original filename and timestamp of the
16 compressed data. These fields can be obtained using the
17 \helpref{GetName()
}{wxgzipinputstreamgetname
} and
18 \helpref{GetDateTime()
}{wxgzipinputstreamgetdatetime
} accessors.
20 If the stream turns out not to be a gzip stream (i.e. the signature bytes
21 0x1f,
0x8b are not found), then the constructor unreads the bytes read and
22 sets the stream state to
{\it wxSTREAM
\_EOF}.
24 So given a possibly gzipped stream '
{\it maybe
\_gzipped}' you can construct
25 a decompressed stream '
{\it decompressed
}' with something like:
28 wxGzipInputStream gzip(maybe_gzipped);
29 wxInputStream *decompressed = &gzip;
31 decompressed = &maybe_gzipped;
34 The stream will not read past the end of the gzip data, therefore you
35 can read another gzip entry concatenated by creating another
36 {\it wxGzipInputStream
} on the same underlying stream.
38 The stream is not seekable,
\helpref{SeekI()
}{wxinputstreamseeki
} returns
39 {\it wxInvalidOffset
}. Also
\helpref{GetSize()
}{wxstreambasegetsize
} is
40 not supported, it always returns $
0$.
42 \wxheading{Derived from
}
44 \helpref{wxFilterInputStream
}{wxfilterinputstream
}
46 \wxheading{Include files
}
52 \helpref{wxGzipOutputStream
}{wxgzipoutputstream
},
53 \helpref{wxZlibInputStream
}{wxzlibinputstream
},
54 \helpref{wxInputStream
}{wxinputstream
}.
56 \latexignore{\rtfignore{\wxheading{Members
}}}
59 \membersection{wxGzipInputStream::wxGzipInputStream
}\label{wxgzipinputstreamwxgzipinputstream
}
61 \func{}{wxGzipInputStream
}{\param{wxInputStream\&
}{stream
},
\param{wxMBConv\&
}{conv = wxConvFile
}}
63 Constructs an object to decompress a gzipped stream.
65 The constructor reads the gzip header. If the original file name and timestamp
66 are present, then they can be obtained through the
67 \helpref{GetName()
}{wxgzipinputstreamgetname
} and
68 \helpref{GetDateTime()
}{wxgzipinputstreamgetdatetime
} accessors.
70 The filename in the header is stored using an
8-bit character set. In a
71 Unicode build
{\it conv
} is used to translate the filename into Unicode (it
72 has no effect on the stream data). RFC-
1952 specifies that the character set
73 should be ISO-
8859-
1, however the default here is to use
{\it wxConvFile
}
74 which more closely matches the behaviour of the gzip program. In
75 a non-Unicode build
{\it conv
} is ignored.
77 If the first two bytes are not the gzip signature, then the data is not
78 gzipped after all. The stream state is set to
{\it wxSTREAM
\_EOF}, and the
79 two bytes are unread so that the underlying stream can be read directly.
82 \membersection{wxGzipInputStream::
\destruct{wxGzipInputStream
}}\label{wxgzipinputstreamdtor
}
84 \func{}{\destruct{wxGzipInputStream
}}{\void}
89 \membersection{wxGzipInputStream::GetDateTime
}\label{wxgzipinputstreamgetdatetime
}
91 \constfunc{wxDateTime
}{GetDateTime
}{\void}
93 Returns the original modification time of gzipped data, as obtained from the
97 \membersection{wxGzipInputStream::GetName
}\label{wxgzipinputstreamgetname
}
99 \constfunc{wxString
}{GetName
}{\void}
101 Returns the original filename of gzipped data, with any directory components
109 \section{\class{wxGzipOutputStream
}}\label{wxgzipoutputstream
}
111 A stream filter to compress gzipped data. The gzip format is specified in
114 The stream is not seekable,
\helpref{SeekO()
}{wxoutputstreamseeko
} returns
115 {\it wxInvalidOffset
}.
118 \wxheading{Derived from
}
120 \helpref{wxFilterOutputStream
}{wxfilteroutputstream
}
122 \wxheading{Include files
}
128 \helpref{wxGzipInputStream
}{wxgzipinputstream
},
129 \helpref{wxZlibOutputStream
}{wxzliboutputstream
},
130 \helpref{wxOutputStream
}{wxoutputstream
}.
132 \latexignore{\rtfignore{\wxheading{Members
}}}
135 \membersection{wxGzipOutputStream::wxGzipOutputStream
}\label{wxgzipoutputstreamwxgzipoutputstream
}
137 \func{}{wxGzipOutputStream
}{\param{wxOutputStream\&
}{stream
},
\param{const wxString\&
}{originalName = wxEmptyString
},
\param{const wxDateTime\&
}{originalTime = wxDateTime::Now()
},
\param{int
}{level = -
1},
\param{wxMBConv\&
}{conv = wxConvFile
}}
139 If the
{\it originalName
} is given, then it is written to the gzip header
140 with any directory components removed. On a Unicode build it is first
141 converted to an
8-bit encoding using
{\it conv
}. RFC-
1952 specifies that
142 the character set should be ISO-
8859-
1, however the default here is to
143 use
{\it wxConvFile
} which more closely matches the behaviour of the gzip
144 program. In a non-Unicode build
{\it conv
} is ignored.
{\it conv
} has no
145 effect on the stream data.
147 If
{\it originalTime
} is given then it is also written to the gzip header
148 as the timestamp. If omitted the current time is used.
150 {\it level
} is the compression level. It can be an integer between $
0$ (no
151 compression) and $
9$ (most compression). $-
1$ specifies that the default
152 compression should be used, and is currently equivalent to $
6$.
154 You can also use the following constants from <wx/zstream.h>:
159 wxZ_DEFAULT_COMPRESSION = -
1,
160 wxZ_NO_COMPRESSION =
0,
162 wxZ_BEST_COMPRESSION =
9
167 \membersection{wxGzipOutputStream::
\destruct{wxGzipOutputStream
}}\label{wxgzipoutputstreamdtor
}
169 \func{}{\destruct{wxGzipOutputStream
}}{\void}