]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/zipstrm.tex
typo fix
[wxWidgets.git] / docs / latex / wx / zipstrm.tex
CommitLineData
704a4b75 1%
00375592
VZ
2% automatically generated by HelpGen $Revision$ from
3% wx/zipstrm.h at 16/Sep/04 12:19:29
704a4b75
VS
4%
5
00375592 6\section{\class{wxZipClassFactory}}\label{wxzipclassfactory}
704a4b75 7
00375592
VZ
8Class factory for the zip archive format. See the base class
9for details.
704a4b75 10
00375592 11\wxheading{Derived from}
f6bcfd97 12
00375592 13\helpref{wxArchiveClassFactory}{wxarchiveclassfactory}
f6bcfd97 14
00375592
VZ
15\wxheading{Include files}
16
17<wx/zipstrm.h>
18
a7af285d
VZ
19\wxheading{Library}
20
21\helpref{wxBase}{librarieslist}
22
00375592
VZ
23\wxheading{See also}
24
25\helpref{Archive formats such as zip}{wxarc}\\
601bee5c 26\helpref{Generic archive programming}{wxarcgeneric}\\
00375592
VZ
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
39Holds the meta-data for an entry in a zip.
f6bcfd97 40
704a4b75
VS
41\wxheading{Derived from}
42
00375592 43\helpref{wxArchiveEntry}{wxarchiveentry}
9704b250
VS
44
45\wxheading{Include files}
46
47<wx/zipstrm.h>
704a4b75 48
a7af285d
VZ
49\wxheading{Library}
50
51\helpref{wxBase}{librarieslist}
52
00375592
VZ
53\wxheading{Data structures}
54
55Constants for \helpref{Get/SetMethod}{wxzipentrymethod}:
56
57\begin{verbatim}
58// Compression Method, only 0 (store) and 8 (deflate) are supported here
59//
60enum 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
78Constants 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//
86enum 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
111Constants for \helpref{Get/SetExternalAttributes}{wxzipentryexternalattributes}:
112
113\begin{verbatim}
114// Dos/Win file attributes
115//
116enum 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
129Constants for \helpref{Get/SetFlags}{wxzipentrygetflags}:
130
131\begin{verbatim}
132// Values for the flags field in the zip headers
133//
134enum 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
161When reading a zip from a stream that is seekable,
162 \helpref{GetNextEntry()}{wxzipinputstreamgetnextentry} returns
163a fully populated wxZipEntry object except for
164 \helpref{wxZipEntry::GetLocalExtra()}{wxzipentrylocalextra}. GetLocalExtra()
165becomes available when the entry is opened, either by calling
166 \helpref{wxZipInputStream::OpenEntry}{wxzipinputstreamopenentry} or by
167making an attempt to read the entry's data.
168
169For zips on \helpref{non-seekable}{wxarcnoseek} streams, the following
170fields 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
182The following fields are also usually available when GetNextEntry()
183returns, however, if the zip was also written to a non-seekable stream
184the zipper is permitted to store them after the entry's data. In that
185case they become available when the entry's data has been read to Eof(),
186or \helpref{CloseEntry()}{wxarchiveinputstreamcloseentry} has been called.
187{\tt (GetFlags() \& wxZIP\_SUMS\_FOLLOW) != 0} indicates that one or
188more of these come after the data:
189
190\helpref{GetCompressedSize}{wxzipentrygetcompressedsize}\\
191\helpref{GetCrc}{wxzipentrygetcrc}\\
192\helpref{GetSize}{wxarchiveentrysize}
193
194The following are stored at the end of the zip, and become available
195when the end of the zip has been reached, i.e. after GetNextEntry()
196returns 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
704a4b75
VS
208\latexignore{\rtfignore{\wxheading{Members}}}
209
00375592
VZ
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
215Constructor.
216
217\func{}{wxZipEntry}{\param{const wxZipEntry\& }{entry}}
218
219Copy constructor.
220
221
222\membersection{wxZipEntry::Clone}\label{wxzipentryclone}
223
224\constfunc{wxZipEntry*}{Clone}{\void}
225
226Make 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
235A short comment for this entry.
236
237
238\membersection{wxZipEntry::GetCompressedSize}\label{wxzipentrygetcompressedsize}
239
240\constfunc{off\_t}{GetCompressedSize}{\void}
241
242The compressed size of this entry in bytes.
243
244
245\membersection{wxZipEntry::GetCrc}\label{wxzipentrygetcrc}
246
247\constfunc{wxUint32}{GetCrc}{\void}
248
249CRC32 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
258The low 8 bits are always the DOS/Windows file attributes for this entry.
259The values of these attributes are given in the
260enumeration {\tt wxZipAttributes}.
261
262The remaining bits can store platform specific permission bits or
263attributes, and their meaning depends on the value
264of \helpref{SetSystemMadeBy()}{wxzipentrysystemmadeby}.
265If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then the
266high 16 bits are unix mode bits.
267
268The 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
283The extra field from the entry's central directory record.
284
285The extra field is used to store platform or application specific
286data. 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
293Returns 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
300Returns the entry's filename in the internal format used within the
301archive. The name can include directory components, i.e. it can be a
302full path.
303
304The names of directory entries are returned without any trailing path
305separator. 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
309A static member that translates a filename into the internal format used
310within the archive. If the third parameter is provided, the bool pointed
311to 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
327The extra field from the entry's local record.
328
329The extra field is used to store platform or application specific
330data. 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
339The compression method. The enumeration {\tt wxZipMethod} lists the
340possible values.
341
342The default constructor sets this to wxZIP\_METHOD\_DEFAULT,
343which allows \helpref{wxZipOutputStream}{wxzipoutputstream} to
344choose the method when writing the entry.
345
346
347\membersection{wxZipEntry::Get/SetMode}\label{wxzipentrymode}
348
349\constfunc{int}{GetMode}{\void}
350
351If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then
352returns the unix permission bits stored in
353 \helpref{GetExternalAttributes()}{wxzipentryexternalattributes}.
354Otherwise synthesises them from the DOS attributes.
355
356\func{void}{SetMode}{\param{int }{mode}}
357
358Sets the DOS attributes
359in \helpref{GetExternalAttributes()}{wxzipentryexternalattributes}
360to be consistent with the {\tt mode} given.
361
362If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then also
363stores {\tt mode} in GetExternalAttributes().
364
365Note that the default constructor
366sets \helpref{GetSystemMadeBy()}{wxzipentrysystemmadeby} to
367wxZIP\_SYSTEM\_MSDOS by default. So to be able to store unix
368permissions 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
377Sets the \helpref{notifier}{wxzipnotifier} for this entry.
378Whenever the \helpref{wxZipInputStream}{wxzipinputstream} updates
379this entry, it will then invoke the associated
380notifier's \helpref{OnEntryUpdated}{wxzipnotifieronentryupdated}
381method.
382
383Setting a notifier is not usually necessary. It is used to handle
384certain cases when modifying an zip in a pipeline (i.e. between
385non-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
399The originating file-system. The default constructor sets this to
400wxZIP\_SYSTEM\_MSDOS. Set it to wxZIP\_SYSTEM\_UNIX in order to be
401able to store unix permissions using \helpref{SetMode()}{wxzipentrymode}.
402
403
404\membersection{wxZipEntry::IsMadeByUnix}\label{wxzipentryismadebyunix}
405
406\constfunc{bool}{IsMadeByUnix}{\void}
407
408Returns true if \helpref{GetSystemMadeBy()}{wxzipentrysystemmadeby}
409is 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
418Indicates 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
425Assignment 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
435Input stream for reading zip files.
436
437\helpref{GetNextEntry()}{wxzipinputstreamgetnextentry} returns an
438 \helpref{wxZipEntry}{wxzipentry} object containing the meta-data
439for the next entry in the zip (and gives away ownership). Reading from
440the wxZipInputStream then returns the entry's data. Eof() becomes true
441after an attempt has been made to read past the end of the entry's data.
442When there are no more entries, GetNextEntry() returns NULL and sets Eof().
443
df467a9d
MW
444Note that in general zip entries are not seekable, and
445wxZipInputStream::SeekI() always returns wxInvalidOffset.
446
00375592
VZ
447\wxheading{Derived from}
448
449\helpref{wxArchiveInputStream}{wxarchiveinputstream}
450
451\wxheading{Include files}
452
453<wx/zipstrm.h>
454
a7af285d
VZ
455\wxheading{Library}
456
457\helpref{wxBase}{librarieslist}
458
00375592 459\wxheading{Data structures}
46263455
VZ
460\begin{verbatim}
461typedef wxZipEntry entry_type
462\end{verbatim}
00375592
VZ
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
704a4b75
VS
473\membersection{wxZipInputStream::wxZipInputStream}\label{wxzipinputstreamwxzipinputstream}
474
00375592
VZ
475\func{}{wxZipInputStream}{\param{wxInputStream\& }{stream}, \param{wxMBConv\& }{conv = wxConvLocal}}
476
716b1f70
MW
477\func{}{wxZipInputStream}{\param{wxInputStream*}{stream}, \param{wxMBConv\& }{conv = wxConvLocal}}
478
00375592
VZ
479Constructor. In a Unicode build the second parameter {\tt conv} is
480used to translate the filename and comment fields into Unicode. It has
481no effect on the stream's data.
482
716b1f70
MW
483If the parent stream is passed as a pointer then the new filter stream
484takes ownership of it. If it is passed by reference then it does not.
485
704a4b75
VS
486\func{}{wxZipInputStream}{\param{const wxString\& }{archive}, \param{const wxString\& }{file}}
487
716b1f70 488Compatibility constructor (requires WXWIN\_COMPATIBILITY\_2\_6).
00375592 489
df467a9d
MW
490When this constructor is used, an emulation of seeking is
491switched on for compatibility with previous versions. Note however,
492that it is deprecated.
493
00375592
VZ
494
495\membersection{wxZipInputStream::CloseEntry}\label{wxzipinputstreamcloseentry}
496
497\func{bool}{CloseEntry}{\void}
498
499Closes the current entry. On a non-seekable stream reads to the end of
500the current entry first.
501
502
503\membersection{wxZipInputStream::GetComment}\label{wxzipinputstreamgetcomment}
504
505\func{wxString}{GetComment}{\void}
506
507Returns the zip comment.
508
43e8916f 509This is stored at the end of the zip, therefore when reading a zip
00375592
VZ
510from a non-seekable stream, it returns the empty string until the
511end of the zip has been reached, i.e. when GetNextEntry() returns
512NULL.
513
514
515\membersection{wxZipInputStream::GetNextEntry}\label{wxzipinputstreamgetnextentry}
516
517\func{wxZipEntry*}{GetNextEntry}{\void}
518
519Closes the current entry if one is open, then reads the meta-data for
520the next entry and returns it in a \helpref{wxZipEntry}{wxzipentry}
521object, 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
528For a zip on a seekable stream returns the total number of entries in
529the zip. For zips on non-seekable streams returns the number of entries
530returned so far by \helpref{GetNextEntry()}{wxzipinputstreamgetnextentry}.
531
532
533\membersection{wxZipInputStream::OpenEntry}\label{wxzipinputstreamopenentry}
534
535\func{bool}{OpenEntry}{\param{wxZipEntry\& }{entry}}
536
537Closes the current entry if one is open, then opens the entry specified
538by the {\it entry} object.
539
540{\it entry} should be from the same zip file, and the zip should
541be 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
555If you need to know when a \helpref{wxZipInputStream}{wxzipinputstream}
556updates a \helpref{wxZipEntry}{wxzipentry},
557you can create a notifier by deriving from this abstract base class,
558overriding \helpref{OnEntryUpdated()}{wxzipnotifieronentryupdated}.
559An instance of your notifier class can then be assigned to wxZipEntry
560objects, using \helpref{wxZipEntry::SetNotifier()}{wxzipentrynotifier}.
561
562Setting a notifier is not usually necessary. It is used to handle
563certain cases when modifying an zip in a pipeline (i.e. between
564non-seekable streams).
565See '\helpref{Archives on non-seekable streams}{wxarcnoseek}'.
566
567\wxheading{Derived from}
568
569No base class
570
571\wxheading{Include files}
572
573<wx/zipstrm.h>
574
a7af285d
VZ
575\wxheading{Library}
576
577\helpref{wxBase}{librarieslist}
578
00375592
VZ
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
593Override this to receive notifications when
594an \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
604Output stream for writing zip files.
605
606\helpref{PutNextEntry()}{wxzipoutputstreamputnextentry} is used to create
607a new entry in the output zip, then the entry's data is written to the
608wxZipOutputStream. Another call to PutNextEntry() closes the current
609entry 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
a7af285d
VZ
619\wxheading{Library}
620
621\helpref{wxBase}{librarieslist}
622
00375592
VZ
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
716b1f70
MW
636\func{}{wxZipOutputStream}{\param{wxOutputStream*}{stream}, \param{int }{level = -1}, \param{wxMBConv\& }{conv = wxConvLocal}}
637
00375592
VZ
638Constructor. {\tt level} is the compression level to use.
639It can be a value between 0 and 9 or -1 to use the default value
640which currently is equivalent to 6.
641
716b1f70
MW
642If the parent stream is passed as a pointer then the new filter stream
643takes ownership of it. If it is passed by reference then it does not.
644
00375592 645In a Unicode build the third parameter {\tt conv} is used to translate
08202189 646the filename and comment fields to an 8-bit encoding. It has no effect on the
00375592
VZ
647stream's data.
648
649
650\membersection{wxZipOutputStream::\destruct{wxZipOutputStream}}\label{wxzipoutputstreamdtor}
651
652\func{}{\destruct{wxZipOutputStream}}{\void}
653
654The destructor calls \helpref{Close()}{wxzipoutputstreamclose} to finish
655writing the zip if it has not been called already.
656
657
658\membersection{wxZipOutputStream::Close}\label{wxzipoutputstreamclose}
659
660\func{bool}{Close}{\void}
661
08202189 662Finishes writing the zip, returning true if successful.
00375592
VZ
663Called by the destructor if not called explicitly.
664
665
666\membersection{wxZipOutputStream::CloseEntry}\label{wxzipoutputstreamcloseentry}
667
668\func{bool}{CloseEntry}{\void}
669
670Close the current entry. It is called implicitly whenever another new
671entry is created with \helpref{CopyEntry()}{wxzipoutputstreamcopyentry}
672or \helpref{PutNextEntry()}{wxzipoutputstreamputnextentry}, or
673when the zip is closed.
674
675
676\membersection{wxZipOutputStream::CopyArchiveMetaData}\label{wxzipoutputstreamcopyarchivemetadata}
677
678\func{bool}{CopyArchiveMetaData}{\param{wxZipInputStream\& }{inputStream}}
679
680Transfers the zip comment from the \helpref{wxZipInputStream}{wxzipinputstream}
681to this output stream.
682
683
684\membersection{wxZipOutputStream::CopyEntry}\label{wxzipoutputstreamcopyentry}
685
686\func{bool}{CopyEntry}{\param{wxZipEntry* }{entry}, \param{wxZipInputStream\& }{inputStream}}
687
688Takes ownership of {\tt entry} and uses it to create a new entry
689in the zip. {\tt entry} is then opened in {\tt inputStream} and its contents
690copied to this stream.
691
692CopyEntry() is much more efficient than transferring the data using
693Read() and Write() since it will copy them without decompressing and
694recompressing them.
695
696For zips on seekable streams, {\tt entry} must be from the same zip file
697as {\tt stream}. For non-seekable streams, {\tt entry} must also be the
698last 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
707Set the compression level that will be used the next time an entry is
708created. It can be a value between 0 and 9 or -1 to use the default value
709which 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
716Create a new directory entry
717(see \helpref{wxArchiveEntry::IsDir()}{wxarchiveentryisdir})
718with the given name and timestamp.
719
720\helpref{PutNextEntry()}{wxzipoutputstreamputnextentry} can
721also be used to create directory entries, by supplying a name with
722a trailing path separator.
723
724
725\membersection{wxZipOutputStream::PutNextEntry}\label{wxzipoutputstreamputnextentry}
726
727\func{bool}{PutNextEntry}{\param{wxZipEntry* }{entry}}
728
729Takes ownership of {\tt entry} and uses it to create a new entry
730in the zip.
731
732\func{bool}{PutNextEntry}{\param{const wxString\& }{name}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}, \param{off\_t }{size = wxInvalidOffset}}
733
734Create a new entry with the given name, timestamp and size.
735
704a4b75 736
00375592 737\membersection{wxZipOutputStream::SetComment}\label{wxzipoutputstreamsetcomment}
704a4b75 738
00375592 739\func{void}{SetComment}{\param{const wxString\& }{comment}}
704a4b75 740
00375592
VZ
741Sets a comment for the zip as a whole. It is written at the end of the
742zip.
704a4b75 743