]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/zipstrm.tex
Added periods
[wxWidgets.git] / docs / latex / wx / zipstrm.tex
1 %
2 % automatically generated by HelpGen $Revision$ from
3 % wx/zipstrm.h at 16/Sep/04 12:19:29
4 %
5
6 \section{\class{wxZipClassFactory}}\label{wxzipclassfactory}
7
8 Class factory for the zip archive format. See the base class
9 for details.
10
11 \wxheading{Derived from}
12
13 \helpref{wxArchiveClassFactory}{wxarchiveclassfactory}
14
15 \wxheading{Include files}
16
17 <wx/zipstrm.h>
18
19 \wxheading{Library}
20
21 \helpref{wxBase}{librarieslist}
22
23 \wxheading{See also}
24
25 \helpref{Archive formats such as zip}{wxarc}\\
26 \helpref{Generic archive programming}{wxarcgeneric}\\
27 \helpref{wxZipEntry}{wxzipentry}\\
28 \helpref{wxZipInputStream}{wxzipinputstream}\\
29 \helpref{wxZipOutputStream}{wxzipoutputstream}
30
31
32 %
33 % automatically generated by HelpGen $Revision$ from
34 % wx/zipstrm.h at 16/Sep/04 12:19:29
35 %
36
37 \section{\class{wxZipEntry}}\label{wxzipentry}
38
39 Holds the meta-data for an entry in a zip.
40
41 \wxheading{Derived from}
42
43 \helpref{wxArchiveEntry}{wxarchiveentry}
44
45 \wxheading{Include files}
46
47 <wx/zipstrm.h>
48
49 \wxheading{Library}
50
51 \helpref{wxBase}{librarieslist}
52
53 \wxheading{Data structures}
54
55 Constants for \helpref{Get/SetMethod}{wxzipentrymethod}:
56
57 \begin{verbatim}
58 // Compression Method, only 0 (store) and 8 (deflate) are supported here
59 //
60 enum wxZipMethod
61 {
62 wxZIP_METHOD_STORE,
63 wxZIP_METHOD_SHRINK,
64 wxZIP_METHOD_REDUCE1,
65 wxZIP_METHOD_REDUCE2,
66 wxZIP_METHOD_REDUCE3,
67 wxZIP_METHOD_REDUCE4,
68 wxZIP_METHOD_IMPLODE,
69 wxZIP_METHOD_TOKENIZE,
70 wxZIP_METHOD_DEFLATE,
71 wxZIP_METHOD_DEFLATE64,
72 wxZIP_METHOD_BZIP2 = 12,
73 wxZIP_METHOD_DEFAULT = 0xffff
74 };
75
76 \end{verbatim}
77
78 Constants for \helpref{Get/SetSystemMadeBy}{wxzipentrysystemmadeby}:
79
80 \begin{verbatim}
81 // Originating File-System.
82 //
83 // These are Pkware's values. Note that Info-zip disagree on some of them,
84 // most notably NTFS.
85 //
86 enum wxZipSystem
87 {
88 wxZIP_SYSTEM_MSDOS,
89 wxZIP_SYSTEM_AMIGA,
90 wxZIP_SYSTEM_OPENVMS,
91 wxZIP_SYSTEM_UNIX,
92 wxZIP_SYSTEM_VM_CMS,
93 wxZIP_SYSTEM_ATARI_ST,
94 wxZIP_SYSTEM_OS2_HPFS,
95 wxZIP_SYSTEM_MACINTOSH,
96 wxZIP_SYSTEM_Z_SYSTEM,
97 wxZIP_SYSTEM_CPM,
98 wxZIP_SYSTEM_WINDOWS_NTFS,
99 wxZIP_SYSTEM_MVS,
100 wxZIP_SYSTEM_VSE,
101 wxZIP_SYSTEM_ACORN_RISC,
102 wxZIP_SYSTEM_VFAT,
103 wxZIP_SYSTEM_ALTERNATE_MVS,
104 wxZIP_SYSTEM_BEOS,
105 wxZIP_SYSTEM_TANDEM,
106 wxZIP_SYSTEM_OS_400
107 };
108
109 \end{verbatim}
110
111 Constants for \helpref{Get/SetExternalAttributes}{wxzipentryexternalattributes}:
112
113 \begin{verbatim}
114 // Dos/Win file attributes
115 //
116 enum wxZipAttributes
117 {
118 wxZIP_A_RDONLY = 0x01,
119 wxZIP_A_HIDDEN = 0x02,
120 wxZIP_A_SYSTEM = 0x04,
121 wxZIP_A_SUBDIR = 0x10,
122 wxZIP_A_ARCH = 0x20,
123
124 wxZIP_A_MASK = 0x37
125 };
126
127 \end{verbatim}
128
129 Constants for \helpref{Get/SetFlags}{wxzipentrygetflags}:
130
131 \begin{verbatim}
132 // Values for the flags field in the zip headers
133 //
134 enum wxZipFlags
135 {
136 wxZIP_ENCRYPTED = 0x0001,
137 wxZIP_DEFLATE_NORMAL = 0x0000, // normal compression
138 wxZIP_DEFLATE_EXTRA = 0x0002, // extra compression
139 wxZIP_DEFLATE_FAST = 0x0004, // fast compression
140 wxZIP_DEFLATE_SUPERFAST = 0x0006, // superfast compression
141 wxZIP_DEFLATE_MASK = 0x0006,
142 wxZIP_SUMS_FOLLOW = 0x0008, // crc and sizes come after the data
143 wxZIP_ENHANCED = 0x0010,
144 wxZIP_PATCH = 0x0020,
145 wxZIP_STRONG_ENC = 0x0040,
146 wxZIP_UNUSED = 0x0F80,
147 wxZIP_RESERVED = 0xF000
148 };
149
150 \end{verbatim}
151
152 \wxheading{See also}
153
154 \helpref{Archive formats such as zip}{wxarc}\\
155 \helpref{wxZipInputStream}{wxzipinputstream}\\
156 \helpref{wxZipOutputStream}{wxzipoutputstream}\\
157 \helpref{wxZipNotifier}{wxzipnotifier}
158
159 \wxheading{Field availability}
160
161 When reading a zip from a stream that is seekable,
162 \helpref{GetNextEntry()}{wxzipinputstreamgetnextentry} returns
163 a fully populated wxZipEntry object except for
164 \helpref{wxZipEntry::GetLocalExtra()}{wxzipentrylocalextra}. GetLocalExtra()
165 becomes available when the entry is opened, either by calling
166 \helpref{wxZipInputStream::OpenEntry}{wxzipinputstreamopenentry} or by
167 making an attempt to read the entry's data.
168
169 For zips on \helpref{non-seekable}{wxarcnoseek} streams, the following
170 fields are always available when GetNextEntry() returns:
171
172 \helpref{GetDateTime}{wxarchiveentrydatetime}\\
173 \helpref{GetInternalFormat}{wxarchiveentrygetinternalformat}\\
174 \helpref{GetInternalName}{wxzipentrygetinternalname}\\
175 \helpref{GetFlags}{wxzipentrygetflags}\\
176 \helpref{GetLocalExtra}{wxzipentrylocalextra}\\
177 \helpref{GetMethod}{wxzipentrymethod}\\
178 \helpref{GetName}{wxarchiveentryname}\\
179 \helpref{GetOffset}{wxarchiveentrygetoffset}\\
180 \helpref{IsDir}{wxarchiveentryisdir}
181
182 The following fields are also usually available when GetNextEntry()
183 returns, however, if the zip was also written to a non-seekable stream
184 the zipper is permitted to store them after the entry's data. In that
185 case they become available when the entry's data has been read to Eof(),
186 or \helpref{CloseEntry()}{wxarchiveinputstreamcloseentry} has been called.
187 {\tt (GetFlags() \& wxZIP\_SUMS\_FOLLOW) != 0} indicates that one or
188 more of these come after the data:
189
190 \helpref{GetCompressedSize}{wxzipentrygetcompressedsize}\\
191 \helpref{GetCrc}{wxzipentrygetcrc}\\
192 \helpref{GetSize}{wxarchiveentrysize}
193
194 The following are stored at the end of the zip, and become available
195 when the end of the zip has been reached, i.e. after GetNextEntry()
196 returns NULL and Eof() is true:
197
198 \helpref{GetComment}{wxzipentrycomment}\\
199 \helpref{GetExternalAttributes}{wxzipentryexternalattributes}\\
200 \helpref{GetExtra}{wxzipentryextra}\\
201 \helpref{GetMode}{wxzipentrymode}\\
202 \helpref{GetSystemMadeBy}{wxzipentrysystemmadeby}\\
203 \helpref{IsReadOnly}{wxarchiveentryisreadonly}\\
204 \helpref{IsMadeByUnix}{wxzipentryismadebyunix}\\
205 \helpref{IsText}{wxzipentryistext}
206
207
208 \latexignore{\rtfignore{\wxheading{Members}}}
209
210
211 \membersection{wxZipEntry::wxZipEntry}\label{wxzipentrywxzipentry}
212
213 \func{}{wxZipEntry}{\param{const wxString\& }{name = wxEmptyString}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}, \param{off\_t }{size = wxInvalidOffset}}
214
215 Constructor.
216
217 \func{}{wxZipEntry}{\param{const wxZipEntry\& }{entry}}
218
219 Copy constructor.
220
221
222 \membersection{wxZipEntry::Clone}\label{wxzipentryclone}
223
224 \constfunc{wxZipEntry*}{Clone}{\void}
225
226 Make a copy of this entry.
227
228
229 \membersection{wxZipEntry::Get/SetComment}\label{wxzipentrycomment}
230
231 \constfunc{wxString}{GetComment}{\void}
232
233 \func{void}{SetComment}{\param{const wxString\& }{comment}}
234
235 A short comment for this entry.
236
237
238 \membersection{wxZipEntry::GetCompressedSize}\label{wxzipentrygetcompressedsize}
239
240 \constfunc{off\_t}{GetCompressedSize}{\void}
241
242 The compressed size of this entry in bytes.
243
244
245 \membersection{wxZipEntry::GetCrc}\label{wxzipentrygetcrc}
246
247 \constfunc{wxUint32}{GetCrc}{\void}
248
249 CRC32 for this entry's data.
250
251
252 \membersection{wxZipEntry::Get/SetExternalAttributes}\label{wxzipentryexternalattributes}
253
254 \constfunc{wxUint32}{GetExternalAttributes}{\void}
255
256 \func{void}{SetExternalAttributes}{\param{wxUint32 }{attr}}
257
258 The low 8 bits are always the DOS/Windows file attributes for this entry.
259 The values of these attributes are given in the
260 enumeration {\tt wxZipAttributes}.
261
262 The remaining bits can store platform specific permission bits or
263 attributes, and their meaning depends on the value
264 of \helpref{SetSystemMadeBy()}{wxzipentrysystemmadeby}.
265 If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then the
266 high 16 bits are unix mode bits.
267
268 The following other accessors access these bits:
269
270 \helpref{IsReadOnly/SetIsReadOnly}{wxarchiveentryisreadonly}\\
271 \helpref{IsDir/SetIsDir}{wxarchiveentryisdir}\\
272 \helpref{Get/SetMode}{wxzipentrymode}
273
274
275 \membersection{wxZipEntry::Get/SetExtra}\label{wxzipentryextra}
276
277 \constfunc{const char*}{GetExtra}{\void}
278
279 \constfunc{size\_t}{GetExtraLen}{\void}
280
281 \func{void}{SetExtra}{\param{const char* }{extra}, \param{size\_t }{len}}
282
283 The extra field from the entry's central directory record.
284
285 The extra field is used to store platform or application specific
286 data. See Pkware's document 'appnote.txt' for information on its format.
287
288
289 \membersection{wxZipEntry::GetFlags}\label{wxzipentrygetflags}
290
291 \constfunc{int}{GetFlags}{\void}
292
293 Returns a combination of the bits flags in the enumeration {\tt wxZipFlags}.
294
295
296 \membersection{wxZipEntry::GetInternalName}\label{wxzipentrygetinternalname}
297
298 \constfunc{wxString}{GetInternalName}{\void}
299
300 Returns the entry's filename in the internal format used within the
301 archive. The name can include directory components, i.e. it can be a
302 full path.
303
304 The names of directory entries are returned without any trailing path
305 separator. This gives a canonical name that can be used in comparisons.
306
307 \func{wxString}{GetInternalName}{\param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}, \param{bool* }{pIsDir = NULL}}
308
309 A static member that translates a filename into the internal format used
310 within the archive. If the third parameter is provided, the bool pointed
311 to is set to indicate whether the name looks like a directory name
312 (i.e. has a trailing path separator).
313
314 \wxheading{See also}
315
316 \helpref{Looking up an archive entry by name}{wxarcbyname}
317
318
319 \membersection{wxZipEntry::Get/SetLocalExtra}\label{wxzipentrylocalextra}
320
321 \constfunc{const char*}{GetLocalExtra}{\void}
322
323 \constfunc{size\_t}{GetLocalExtraLen}{\void}
324
325 \func{void}{SetLocalExtra}{\param{const char* }{extra}, \param{size\_t }{len}}
326
327 The extra field from the entry's local record.
328
329 The extra field is used to store platform or application specific
330 data. See Pkware's document 'appnote.txt' for information on its format.
331
332
333 \membersection{wxZipEntry::Get/SetMethod}\label{wxzipentrymethod}
334
335 \constfunc{int}{GetMethod}{\void}
336
337 \func{void}{SetMethod}{\param{int }{method}}
338
339 The compression method. The enumeration {\tt wxZipMethod} lists the
340 possible values.
341
342 The default constructor sets this to wxZIP\_METHOD\_DEFAULT,
343 which allows \helpref{wxZipOutputStream}{wxzipoutputstream} to
344 choose the method when writing the entry.
345
346
347 \membersection{wxZipEntry::Get/SetMode}\label{wxzipentrymode}
348
349 \constfunc{int}{GetMode}{\void}
350
351 If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then
352 returns the unix permission bits stored in
353 \helpref{GetExternalAttributes()}{wxzipentryexternalattributes}.
354 Otherwise synthesises them from the DOS attributes.
355
356 \func{void}{SetMode}{\param{int }{mode}}
357
358 Sets the DOS attributes
359 in \helpref{GetExternalAttributes()}{wxzipentryexternalattributes}
360 to be consistent with the {\tt mode} given.
361
362 If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then also
363 stores {\tt mode} in GetExternalAttributes().
364
365 Note that the default constructor
366 sets \helpref{GetSystemMadeBy()}{wxzipentrysystemmadeby} to
367 wxZIP\_SYSTEM\_MSDOS by default. So to be able to store unix
368 permissions when creating zips, call SetSystemMadeBy(wxZIP\_SYSTEM\_UNIX).
369
370
371 \membersection{wxZipEntry::SetNotifier}\label{wxzipentrynotifier}
372
373 \func{void}{SetNotifier}{\param{wxZipNotifier\& }{notifier}}
374
375 \func{void}{UnsetNotifier}{\void}
376
377 Sets the \helpref{notifier}{wxzipnotifier} for this entry.
378 Whenever the \helpref{wxZipInputStream}{wxzipinputstream} updates
379 this entry, it will then invoke the associated
380 notifier's \helpref{OnEntryUpdated}{wxzipnotifieronentryupdated}
381 method.
382
383 Setting a notifier is not usually necessary. It is used to handle
384 certain cases when modifying an zip in a pipeline (i.e. between
385 non-seekable streams).
386
387 \wxheading{See also}
388
389 \helpref{Archives on non-seekable streams}{wxarcnoseek}\\
390 \helpref{wxZipNotifier}{wxzipnotifier}
391
392
393 \membersection{wxZipEntry::Get/SetSystemMadeBy}\label{wxzipentrysystemmadeby}
394
395 \constfunc{int}{GetSystemMadeBy}{\void}
396
397 \func{void}{SetSystemMadeBy}{\param{int }{system}}
398
399 The originating file-system. The default constructor sets this to
400 wxZIP\_SYSTEM\_MSDOS. Set it to wxZIP\_SYSTEM\_UNIX in order to be
401 able to store unix permissions using \helpref{SetMode()}{wxzipentrymode}.
402
403
404 \membersection{wxZipEntry::IsMadeByUnix}\label{wxzipentryismadebyunix}
405
406 \constfunc{bool}{IsMadeByUnix}{\void}
407
408 Returns true if \helpref{GetSystemMadeBy()}{wxzipentrysystemmadeby}
409 is a flavour of unix.
410
411
412 \membersection{wxZipEntry::IsText/SetIsText}\label{wxzipentryistext}
413
414 \constfunc{bool}{IsText}{\void}
415
416 \func{void}{SetIsText}{\param{bool }{isText = true}}
417
418 Indicates that this entry's data is text in an 8-bit encoding.
419
420
421 \membersection{wxZipEntry::operator=}\label{wxzipentryoperatorassign}
422
423 \func{wxZipEntry\& operator}{operator=}{\param{const wxZipEntry\& }{entry}}
424
425 Assignment operator.
426
427
428 %
429 % automatically generated by HelpGen $Revision$ from
430 % wx/zipstrm.h at 16/Sep/04 12:19:29
431 %
432
433 \section{\class{wxZipInputStream}}\label{wxzipinputstream}
434
435 Input stream for reading zip files.
436
437 \helpref{GetNextEntry()}{wxzipinputstreamgetnextentry} returns an
438 \helpref{wxZipEntry}{wxzipentry} object containing the meta-data
439 for the next entry in the zip (and gives away ownership). Reading from
440 the wxZipInputStream then returns the entry's data. Eof() becomes true
441 after an attempt has been made to read past the end of the entry's data.
442 When there are no more entries, GetNextEntry() returns NULL and sets Eof().
443
444 Note that in general zip entries are not seekable, and
445 wxZipInputStream::SeekI() always returns wxInvalidOffset.
446
447 \wxheading{Derived from}
448
449 \helpref{wxArchiveInputStream}{wxarchiveinputstream}
450
451 \wxheading{Include files}
452
453 <wx/zipstrm.h>
454
455 \wxheading{Library}
456
457 \helpref{wxBase}{librarieslist}
458
459 \wxheading{Data structures}
460 \begin{verbatim}
461 typedef wxZipEntry entry_type
462 \end{verbatim}
463
464 \wxheading{See also}
465
466 \helpref{Archive formats such as zip}{wxarc}\\
467 \helpref{wxZipEntry}{wxzipentry}\\
468 \helpref{wxZipOutputStream}{wxzipoutputstream}
469
470 \latexignore{\rtfignore{\wxheading{Members}}}
471
472
473 \membersection{wxZipInputStream::wxZipInputStream}\label{wxzipinputstreamwxzipinputstream}
474
475 \func{}{wxZipInputStream}{\param{wxInputStream\& }{stream}, \param{wxMBConv\& }{conv = wxConvLocal}}
476
477 \func{}{wxZipInputStream}{\param{wxInputStream*}{stream}, \param{wxMBConv\& }{conv = wxConvLocal}}
478
479 Constructor. In a Unicode build the second parameter {\tt conv} is
480 used to translate the filename and comment fields into Unicode. It has
481 no effect on the stream's data.
482
483 If the parent stream is passed as a pointer then the new filter stream
484 takes ownership of it. If it is passed by reference then it does not.
485
486 \func{}{wxZipInputStream}{\param{const wxString\& }{archive}, \param{const wxString\& }{file}}
487
488 Compatibility constructor (requires WXWIN\_COMPATIBILITY\_2\_6).
489
490 When this constructor is used, an emulation of seeking is
491 switched on for compatibility with previous versions. Note however,
492 that it is deprecated.
493
494
495 \membersection{wxZipInputStream::CloseEntry}\label{wxzipinputstreamcloseentry}
496
497 \func{bool}{CloseEntry}{\void}
498
499 Closes the current entry. On a non-seekable stream reads to the end of
500 the current entry first.
501
502
503 \membersection{wxZipInputStream::GetComment}\label{wxzipinputstreamgetcomment}
504
505 \func{wxString}{GetComment}{\void}
506
507 Returns the zip comment.
508
509 This is stored at the end of the zip, therefore when reading a zip
510 from a non-seekable stream, it returns the empty string until the
511 end of the zip has been reached, i.e. when GetNextEntry() returns
512 NULL.
513
514
515 \membersection{wxZipInputStream::GetNextEntry}\label{wxzipinputstreamgetnextentry}
516
517 \func{wxZipEntry*}{GetNextEntry}{\void}
518
519 Closes the current entry if one is open, then reads the meta-data for
520 the next entry and returns it in a \helpref{wxZipEntry}{wxzipentry}
521 object, giving away ownership. The stream is then open and can be read.
522
523
524 \membersection{wxZipInputStream::GetTotalEntries}\label{wxzipinputstreamgettotalentries}
525
526 \func{int}{GetTotalEntries}{\void}
527
528 For a zip on a seekable stream returns the total number of entries in
529 the zip. For zips on non-seekable streams returns the number of entries
530 returned so far by \helpref{GetNextEntry()}{wxzipinputstreamgetnextentry}.
531
532
533 \membersection{wxZipInputStream::OpenEntry}\label{wxzipinputstreamopenentry}
534
535 \func{bool}{OpenEntry}{\param{wxZipEntry\& }{entry}}
536
537 Closes the current entry if one is open, then opens the entry specified
538 by the {\it entry} object.
539
540 {\it entry} should be from the same zip file, and the zip should
541 be on a seekable stream.
542
543 \wxheading{See also}
544
545 \helpref{Looking up an archive entry by name}{wxarcbyname}
546
547
548 %
549 % automatically generated by HelpGen $Revision$ from
550 % wx/zipstrm.h at 16/Sep/04 12:19:29
551 %
552
553 \section{\class{wxZipNotifier}}\label{wxzipnotifier}
554
555 If you need to know when a \helpref{wxZipInputStream}{wxzipinputstream}
556 updates a \helpref{wxZipEntry}{wxzipentry},
557 you can create a notifier by deriving from this abstract base class,
558 overriding \helpref{OnEntryUpdated()}{wxzipnotifieronentryupdated}.
559 An instance of your notifier class can then be assigned to wxZipEntry
560 objects, using \helpref{wxZipEntry::SetNotifier()}{wxzipentrynotifier}.
561
562 Setting a notifier is not usually necessary. It is used to handle
563 certain cases when modifying an zip in a pipeline (i.e. between
564 non-seekable streams).
565 See '\helpref{Archives on non-seekable streams}{wxarcnoseek}'.
566
567 \wxheading{Derived from}
568
569 No base class
570
571 \wxheading{Include files}
572
573 <wx/zipstrm.h>
574
575 \wxheading{Library}
576
577 \helpref{wxBase}{librarieslist}
578
579 \wxheading{See also}
580
581 \helpref{Archives on non-seekable streams}{wxarcnoseek}\\
582 \helpref{wxZipEntry}{wxzipentry}\\
583 \helpref{wxZipInputStream}{wxzipinputstream}\\
584 \helpref{wxZipOutputStream}{wxzipoutputstream}
585
586 \latexignore{\rtfignore{\wxheading{Members}}}
587
588
589 \membersection{wxZipNotifier::OnEntryUpdated}\label{wxzipnotifieronentryupdated}
590
591 \func{void}{OnEntryUpdated}{\param{wxZipEntry\& }{entry}}
592
593 Override this to receive notifications when
594 an \helpref{wxZipEntry}{wxzipentry} object changes.
595
596
597 %
598 % automatically generated by HelpGen $Revision$ from
599 % wx/zipstrm.h at 16/Sep/04 12:19:29
600 %
601
602 \section{\class{wxZipOutputStream}}\label{wxzipoutputstream}
603
604 Output stream for writing zip files.
605
606 \helpref{PutNextEntry()}{wxzipoutputstreamputnextentry} is used to create
607 a new entry in the output zip, then the entry's data is written to the
608 wxZipOutputStream. Another call to PutNextEntry() closes the current
609 entry and begins the next.
610
611 \wxheading{Derived from}
612
613 \helpref{wxArchiveOutputStream}{wxarchiveoutputstream}
614
615 \wxheading{Include files}
616
617 <wx/zipstrm.h>
618
619 \wxheading{Library}
620
621 \helpref{wxBase}{librarieslist}
622
623 \wxheading{See also}
624
625 \helpref{Archive formats such as zip}{wxarc}\\
626 \helpref{wxZipEntry}{wxzipentry}\\
627 \helpref{wxZipInputStream}{wxzipinputstream}
628
629 \latexignore{\rtfignore{\wxheading{Members}}}
630
631
632 \membersection{wxZipOutputStream::wxZipOutputStream}\label{wxzipoutputstreamwxzipoutputstream}
633
634 \func{}{wxZipOutputStream}{\param{wxOutputStream\& }{stream}, \param{int }{level = -1}, \param{wxMBConv\& }{conv = wxConvLocal}}
635
636 \func{}{wxZipOutputStream}{\param{wxOutputStream*}{stream}, \param{int }{level = -1}, \param{wxMBConv\& }{conv = wxConvLocal}}
637
638 Constructor. {\tt level} is the compression level to use.
639 It can be a value between 0 and 9 or -1 to use the default value
640 which currently is equivalent to 6.
641
642 If the parent stream is passed as a pointer then the new filter stream
643 takes ownership of it. If it is passed by reference then it does not.
644
645 In a Unicode build the third parameter {\tt conv} is used to translate
646 the filename and comment fields to an 8-bit encoding. It has no effect on the
647 stream's data.
648
649
650 \membersection{wxZipOutputStream::\destruct{wxZipOutputStream}}\label{wxzipoutputstreamdtor}
651
652 \func{}{\destruct{wxZipOutputStream}}{\void}
653
654 The destructor calls \helpref{Close()}{wxzipoutputstreamclose} to finish
655 writing the zip if it has not been called already.
656
657
658 \membersection{wxZipOutputStream::Close}\label{wxzipoutputstreamclose}
659
660 \func{bool}{Close}{\void}
661
662 Finishes writing the zip, returning true if successful.
663 Called by the destructor if not called explicitly.
664
665
666 \membersection{wxZipOutputStream::CloseEntry}\label{wxzipoutputstreamcloseentry}
667
668 \func{bool}{CloseEntry}{\void}
669
670 Close the current entry. It is called implicitly whenever another new
671 entry is created with \helpref{CopyEntry()}{wxzipoutputstreamcopyentry}
672 or \helpref{PutNextEntry()}{wxzipoutputstreamputnextentry}, or
673 when the zip is closed.
674
675
676 \membersection{wxZipOutputStream::CopyArchiveMetaData}\label{wxzipoutputstreamcopyarchivemetadata}
677
678 \func{bool}{CopyArchiveMetaData}{\param{wxZipInputStream\& }{inputStream}}
679
680 Transfers the zip comment from the \helpref{wxZipInputStream}{wxzipinputstream}
681 to this output stream.
682
683
684 \membersection{wxZipOutputStream::CopyEntry}\label{wxzipoutputstreamcopyentry}
685
686 \func{bool}{CopyEntry}{\param{wxZipEntry* }{entry}, \param{wxZipInputStream\& }{inputStream}}
687
688 Takes ownership of {\tt entry} and uses it to create a new entry
689 in the zip. {\tt entry} is then opened in {\tt inputStream} and its contents
690 copied to this stream.
691
692 CopyEntry() is much more efficient than transferring the data using
693 Read() and Write() since it will copy them without decompressing and
694 recompressing them.
695
696 For zips on seekable streams, {\tt entry} must be from the same zip file
697 as {\tt stream}. For non-seekable streams, {\tt entry} must also be the
698 last thing read from {\tt inputStream}.
699
700
701 \membersection{wxZipOutputStream::Get/SetLevel}\label{wxzipoutputstreamlevel}
702
703 \constfunc{int}{GetLevel}{\void}
704
705 \func{void}{SetLevel}{\param{int }{level}}
706
707 Set the compression level that will be used the next time an entry is
708 created. It can be a value between 0 and 9 or -1 to use the default value
709 which currently is equivalent to 6.
710
711
712 \membersection{wxZipOutputStream::PutNextDirEntry}\label{wxzipoutputstreamputnextdirentry}
713
714 \func{bool}{PutNextDirEntry}{\param{const wxString\& }{name}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}}
715
716 Create a new directory entry
717 (see \helpref{wxArchiveEntry::IsDir()}{wxarchiveentryisdir})
718 with the given name and timestamp.
719
720 \helpref{PutNextEntry()}{wxzipoutputstreamputnextentry} can
721 also be used to create directory entries, by supplying a name with
722 a trailing path separator.
723
724
725 \membersection{wxZipOutputStream::PutNextEntry}\label{wxzipoutputstreamputnextentry}
726
727 \func{bool}{PutNextEntry}{\param{wxZipEntry* }{entry}}
728
729 Takes ownership of {\tt entry} and uses it to create a new entry
730 in the zip.
731
732 \func{bool}{PutNextEntry}{\param{const wxString\& }{name}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}, \param{off\_t }{size = wxInvalidOffset}}
733
734 Create a new entry with the given name, timestamp and size.
735
736
737 \membersection{wxZipOutputStream::SetComment}\label{wxzipoutputstreamsetcomment}
738
739 \func{void}{SetComment}{\param{const wxString\& }{comment}}
740
741 Sets a comment for the zip as a whole. It is written at the end of the
742 zip.
743