]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/gzstream.tex
iconMove was incorrectly called iconCopy in ctor docs
[wxWidgets.git] / docs / latex / wx / gzstream.tex
1 %
2 % automatically generated by HelpGen $Revision$ from
3 % gzstream.h at 20/Aug/03 18:41:55
4 %
5
6 %
7 % wxGzipInputStream
8 %
9
10 \section{\class{wxGzipInputStream}}\label{wxgzipinputstream}
11
12 A stream filter to decompress gzipped data. The gzip format is specified in
13 RFC-1952.
14
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.
19
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}.
23
24 So given a possibly gzipped stream '{\it maybe\_gzipped}' you can construct
25 a decompressed stream '{\it decompressed}' with something like:
26
27 \begin{verbatim}
28 wxGzipInputStream gzip(maybe_gzipped);
29 wxInputStream *decompressed = &gzip;
30 if (gzip.Eof())
31 decompressed = &maybe_gzipped;
32
33 \end{verbatim}
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.
37
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$.
41
42 \wxheading{Derived from}
43
44 \helpref{wxFilterInputStream}{wxfilterinputstream}
45
46 \wxheading{Include files}
47
48 <wx/gzstream.h>
49
50 \wxheading{See also}
51
52 \helpref{wxGzipOutputStream}{wxgzipoutputstream},
53 \helpref{wxZlibInputStream}{wxzlibinputstream},
54 \helpref{wxInputStream}{wxinputstream}.
55
56 \latexignore{\rtfignore{\wxheading{Members}}}
57
58
59 \membersection{wxGzipInputStream::wxGzipInputStream}\label{wxgzipinputstreamwxgzipinputstream}
60
61 \func{}{wxGzipInputStream}{\param{wxInputStream\& }{stream}, \param{wxMBConv\& }{conv = wxConvFile}}
62
63 Constructs an object to decompress a gzipped stream.
64
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.
69
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.
76
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.
80
81
82 \membersection{wxGzipInputStream::\destruct{wxGzipInputStream}}\label{wxgzipinputstreamdtor}
83
84 \func{}{\destruct{wxGzipInputStream}}{\void}
85
86 Destructor.
87
88
89 \membersection{wxGzipInputStream::GetDateTime}\label{wxgzipinputstreamgetdatetime}
90
91 \constfunc{wxDateTime}{GetDateTime}{\void}
92
93 Returns the original modification time of gzipped data, as obtained from the
94 gzip header.
95
96
97 \membersection{wxGzipInputStream::GetName}\label{wxgzipinputstreamgetname}
98
99 \constfunc{wxString}{GetName}{\void}
100
101 Returns the original filename of gzipped data, with any directory components
102 removed.
103
104
105 %
106 % wxGzipOutputStream
107 %
108
109 \section{\class{wxGzipOutputStream}}\label{wxgzipoutputstream}
110
111 A stream filter to compress gzipped data. The gzip format is specified in
112 RFC-1952.
113
114 The stream is not seekable, \helpref{SeekO()}{wxoutputstreamseeko} returns
115 {\it wxInvalidOffset}.
116
117
118 \wxheading{Derived from}
119
120 \helpref{wxFilterOutputStream}{wxfilteroutputstream}
121
122 \wxheading{Include files}
123
124 <wx/gzstream.h>
125
126 \wxheading{See also}
127
128 \helpref{wxGzipInputStream}{wxgzipinputstream},
129 \helpref{wxZlibOutputStream}{wxzliboutputstream},
130 \helpref{wxOutputStream}{wxoutputstream}.
131
132 \latexignore{\rtfignore{\wxheading{Members}}}
133
134
135 \membersection{wxGzipOutputStream::wxGzipOutputStream}\label{wxgzipoutputstreamwxgzipoutputstream}
136
137 \func{}{wxGzipOutputStream}{\param{wxOutputStream\& }{stream}, \param{const wxString\& }{originalName = wxEmptyString}, \param{int }{level = -1}, \param{wxMBConv\& }{conv = wxConvFile}}
138
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.
146
147 If {\it originalName} specifies a file that exists then it's current
148 modification time is also written to the gzip header as the timestamp.
149 Otherwise the current time is used for the timestamp.
150
151 {\it level} is the compression level. It can be an integer between $0$ (no
152 compression) and $9$ (most compression). $-1$ specifies that the default
153 compression should be used, and is currently equivalent to $6$.
154
155 You can also use the following constants from <wx/zstream.h>:
156
157 \begin{verbatim}
158 // Compression level
159 enum {
160 wxZ_DEFAULT_COMPRESSION = -1,
161 wxZ_NO_COMPRESSION = 0,
162 wxZ_BEST_SPEED = 1,
163 wxZ_BEST_COMPRESSION = 9
164 }
165 \end{verbatim}
166
167
168 \membersection{wxGzipOutputStream::\destruct{wxGzipOutputStream}}\label{wxgzipoutputstreamdtor}
169
170 \func{}{\destruct{wxGzipOutputStream}}{\void}
171
172 Destructor.
173