File: zipstrm.tex

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (723 lines) | stat: -rw-r--r-- 22,264 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
%
% automatically generated by HelpGen $Revision: 43373 $ from
% wx/zipstrm.h at 16/Sep/04 12:19:29
%

\section{\class{wxZipClassFactory}}\label{wxzipclassfactory}

Class factory for the zip archive format. See the base class
for details.

\wxheading{Derived from}

\helpref{wxArchiveClassFactory}{wxarchiveclassfactory}

\wxheading{Include files}

<wx/zipstrm.h>

\wxheading{See also}

\helpref{Archive formats such as zip}{wxarc}\\
\helpref{Generic archive programming}{wxarcgeneric}\\
\helpref{wxZipEntry}{wxzipentry}\\
\helpref{wxZipInputStream}{wxzipinputstream}\\
\helpref{wxZipOutputStream}{wxzipoutputstream}


%
% automatically generated by HelpGen $Revision: 43373 $ from
% wx/zipstrm.h at 16/Sep/04 12:19:29
%

\section{\class{wxZipEntry}}\label{wxzipentry}

Holds the meta-data for an entry in a zip.

\wxheading{Derived from}

\helpref{wxArchiveEntry}{wxarchiveentry}

\wxheading{Include files}

<wx/zipstrm.h>

\wxheading{Data structures}

Constants for \helpref{Get/SetMethod}{wxzipentrymethod}:

\begin{verbatim}
// Compression Method, only 0 (store) and 8 (deflate) are supported here
//
enum wxZipMethod
{
    wxZIP_METHOD_STORE,
    wxZIP_METHOD_SHRINK,
    wxZIP_METHOD_REDUCE1,
    wxZIP_METHOD_REDUCE2,
    wxZIP_METHOD_REDUCE3,
    wxZIP_METHOD_REDUCE4,
    wxZIP_METHOD_IMPLODE,
    wxZIP_METHOD_TOKENIZE,
    wxZIP_METHOD_DEFLATE,
    wxZIP_METHOD_DEFLATE64,
    wxZIP_METHOD_BZIP2 = 12,
    wxZIP_METHOD_DEFAULT = 0xffff
};

\end{verbatim}

Constants for \helpref{Get/SetSystemMadeBy}{wxzipentrysystemmadeby}:

\begin{verbatim}
// Originating File-System.
// 
// These are Pkware's values. Note that Info-zip disagree on some of them,
// most notably NTFS.
//
enum wxZipSystem
{
    wxZIP_SYSTEM_MSDOS,
    wxZIP_SYSTEM_AMIGA,
    wxZIP_SYSTEM_OPENVMS,
    wxZIP_SYSTEM_UNIX,
    wxZIP_SYSTEM_VM_CMS,
    wxZIP_SYSTEM_ATARI_ST,
    wxZIP_SYSTEM_OS2_HPFS,
    wxZIP_SYSTEM_MACINTOSH,
    wxZIP_SYSTEM_Z_SYSTEM,
    wxZIP_SYSTEM_CPM,
    wxZIP_SYSTEM_WINDOWS_NTFS,
    wxZIP_SYSTEM_MVS,
    wxZIP_SYSTEM_VSE,
    wxZIP_SYSTEM_ACORN_RISC,
    wxZIP_SYSTEM_VFAT,
    wxZIP_SYSTEM_ALTERNATE_MVS,
    wxZIP_SYSTEM_BEOS,
    wxZIP_SYSTEM_TANDEM,
    wxZIP_SYSTEM_OS_400
};

\end{verbatim}

Constants for \helpref{Get/SetExternalAttributes}{wxzipentryexternalattributes}:

\begin{verbatim}
// Dos/Win file attributes
//
enum wxZipAttributes
{
    wxZIP_A_RDONLY = 0x01,
    wxZIP_A_HIDDEN = 0x02,
    wxZIP_A_SYSTEM = 0x04,
    wxZIP_A_SUBDIR = 0x10,
    wxZIP_A_ARCH   = 0x20,

    wxZIP_A_MASK   = 0x37
};

\end{verbatim}

Constants for \helpref{Get/SetFlags}{wxzipentrygetflags}:

\begin{verbatim}
// Values for the flags field in the zip headers
//
enum wxZipFlags
{
    wxZIP_ENCRYPTED         = 0x0001,
    wxZIP_DEFLATE_NORMAL    = 0x0000,   // normal compression
    wxZIP_DEFLATE_EXTRA     = 0x0002,   // extra compression
    wxZIP_DEFLATE_FAST      = 0x0004,   // fast compression
    wxZIP_DEFLATE_SUPERFAST = 0x0006,   // superfast compression
    wxZIP_DEFLATE_MASK      = 0x0006,
    wxZIP_SUMS_FOLLOW       = 0x0008,   // crc and sizes come after the data
    wxZIP_ENHANCED          = 0x0010,
    wxZIP_PATCH             = 0x0020,
    wxZIP_STRONG_ENC        = 0x0040,
    wxZIP_UNUSED            = 0x0F80,
    wxZIP_RESERVED          = 0xF000
};

\end{verbatim}

\wxheading{See also}

\helpref{Archive formats such as zip}{wxarc}\\
\helpref{wxZipInputStream}{wxzipinputstream}\\
\helpref{wxZipOutputStream}{wxzipoutputstream}\\
\helpref{wxZipNotifier}{wxzipnotifier}

\wxheading{Field availability}

When reading a zip from a stream that is seekable,
 \helpref{GetNextEntry()}{wxzipinputstreamgetnextentry} returns
a fully populated wxZipEntry object except for
 \helpref{wxZipEntry::GetLocalExtra()}{wxzipentrylocalextra}. GetLocalExtra()
becomes available when the entry is opened, either by calling
 \helpref{wxZipInputStream::OpenEntry}{wxzipinputstreamopenentry} or by
making an attempt to read the entry's data.

For zips on \helpref{non-seekable}{wxarcnoseek} streams, the following
fields are always available when GetNextEntry() returns:

\helpref{GetDateTime}{wxarchiveentrydatetime}\\
\helpref{GetInternalFormat}{wxarchiveentrygetinternalformat}\\
\helpref{GetInternalName}{wxzipentrygetinternalname}\\
\helpref{GetFlags}{wxzipentrygetflags}\\
\helpref{GetLocalExtra}{wxzipentrylocalextra}\\
\helpref{GetMethod}{wxzipentrymethod}\\
\helpref{GetName}{wxarchiveentryname}\\
\helpref{GetOffset}{wxarchiveentrygetoffset}\\
\helpref{IsDir}{wxarchiveentryisdir}

The following fields are also usually available when GetNextEntry()
returns, however, if the zip was also written to a non-seekable stream
the zipper is permitted to store them after the entry's data. In that
case they become available when the entry's data has been read to Eof(),
or \helpref{CloseEntry()}{wxarchiveinputstreamcloseentry} has been called.
{\tt (GetFlags() \& wxZIP\_SUMS\_FOLLOW) != 0} indicates that one or
more of these come after the data:

\helpref{GetCompressedSize}{wxzipentrygetcompressedsize}\\
\helpref{GetCrc}{wxzipentrygetcrc}\\
\helpref{GetSize}{wxarchiveentrysize}

The following are stored at the end of the zip, and become available
when the end of the zip has been reached, i.e. after GetNextEntry()
returns NULL and Eof() is true:

\helpref{GetComment}{wxzipentrycomment}\\
\helpref{GetExternalAttributes}{wxzipentryexternalattributes}\\
\helpref{GetExtra}{wxzipentryextra}\\
\helpref{GetMode}{wxzipentrymode}\\
\helpref{GetSystemMadeBy}{wxzipentrysystemmadeby}\\
\helpref{IsReadOnly}{wxarchiveentryisreadonly}\\
\helpref{IsMadeByUnix}{wxzipentryismadebyunix}\\
\helpref{IsText}{wxzipentryistext}


\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxZipEntry::wxZipEntry}\label{wxzipentrywxzipentry}

\func{}{wxZipEntry}{\param{const wxString\& }{name = wxEmptyString}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}, \param{off\_t }{size = wxInvalidOffset}}

Constructor.

\func{}{wxZipEntry}{\param{const wxZipEntry\& }{entry}}

Copy constructor.


\membersection{wxZipEntry::Clone}\label{wxzipentryclone}

\constfunc{wxZipEntry*}{Clone}{\void}

Make a copy of this entry.


\membersection{wxZipEntry::Get/SetComment}\label{wxzipentrycomment}

\constfunc{wxString}{GetComment}{\void}

\func{void}{SetComment}{\param{const wxString\& }{comment}}

A short comment for this entry.


\membersection{wxZipEntry::GetCompressedSize}\label{wxzipentrygetcompressedsize}

\constfunc{off\_t}{GetCompressedSize}{\void}

The compressed size of this entry in bytes.


\membersection{wxZipEntry::GetCrc}\label{wxzipentrygetcrc}

\constfunc{wxUint32}{GetCrc}{\void}

CRC32 for this entry's data.


\membersection{wxZipEntry::Get/SetExternalAttributes}\label{wxzipentryexternalattributes}

\constfunc{wxUint32}{GetExternalAttributes}{\void}

\func{void}{SetExternalAttributes}{\param{wxUint32 }{attr}}

The low 8 bits are always the DOS/Windows file attributes for this entry.
The values of these attributes are given in the
enumeration {\tt wxZipAttributes}.

The remaining bits can store platform specific permission bits or
attributes, and their meaning depends on the value
of \helpref{SetSystemMadeBy()}{wxzipentrysystemmadeby}.
If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then the
high 16 bits are unix mode bits.

The following other accessors access these bits:

\helpref{IsReadOnly/SetIsReadOnly}{wxarchiveentryisreadonly}\\
\helpref{IsDir/SetIsDir}{wxarchiveentryisdir}\\
\helpref{Get/SetMode}{wxzipentrymode}


\membersection{wxZipEntry::Get/SetExtra}\label{wxzipentryextra}

\constfunc{const char*}{GetExtra}{\void}

\constfunc{size\_t}{GetExtraLen}{\void}

\func{void}{SetExtra}{\param{const char* }{extra}, \param{size\_t }{len}}

The extra field from the entry's central directory record.

The extra field is used to store platform or application specific
data. See Pkware's document 'appnote.txt' for information on its format.


\membersection{wxZipEntry::GetFlags}\label{wxzipentrygetflags}

\constfunc{int}{GetFlags}{\void}

Returns a combination of the bits flags in the enumeration {\tt wxZipFlags}.


\membersection{wxZipEntry::GetInternalName}\label{wxzipentrygetinternalname}

\constfunc{wxString}{GetInternalName}{\void}

Returns the entry's filename in the internal format used within the
archive. The name can include directory components, i.e. it can be a
full path.

The names of directory entries are returned without any trailing path
separator. This gives a canonical name that can be used in comparisons.

\func{wxString}{GetInternalName}{\param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}, \param{bool* }{pIsDir = NULL}}

A static member that translates a filename into the internal format used
within the archive. If the third parameter is provided, the bool pointed
to is set to indicate whether the name looks like a directory name
(i.e. has a trailing path separator).

\wxheading{See also}

\helpref{Looking up an archive entry by name}{wxarcbyname}


\membersection{wxZipEntry::Get/SetLocalExtra}\label{wxzipentrylocalextra}

\constfunc{const char*}{GetLocalExtra}{\void}

\constfunc{size\_t}{GetLocalExtraLen}{\void}

\func{void}{SetLocalExtra}{\param{const char* }{extra}, \param{size\_t }{len}}

The extra field from the entry's local record.

The extra field is used to store platform or application specific
data. See Pkware's document 'appnote.txt' for information on its format.


\membersection{wxZipEntry::Get/SetMethod}\label{wxzipentrymethod}

\constfunc{int}{GetMethod}{\void}

\func{void}{SetMethod}{\param{int }{method}}

The compression method. The enumeration {\tt wxZipMethod} lists the
possible values.

The default constructor sets this to wxZIP\_METHOD\_DEFAULT,
which allows \helpref{wxZipOutputStream}{wxzipoutputstream} to
choose the method when writing the entry.


\membersection{wxZipEntry::Get/SetMode}\label{wxzipentrymode}

\constfunc{int}{GetMode}{\void}

If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then
returns the unix permission bits stored in
 \helpref{GetExternalAttributes()}{wxzipentryexternalattributes}.
Otherwise synthesises them from the DOS attributes.

\func{void}{SetMode}{\param{int }{mode}}

Sets the DOS attributes
in \helpref{GetExternalAttributes()}{wxzipentryexternalattributes}
to be consistent with the {\tt mode} given.

If \helpref{IsMadeByUnix()}{wxzipentryismadebyunix} is true then also
stores {\tt mode} in GetExternalAttributes().

Note that the default constructor
sets \helpref{GetSystemMadeBy()}{wxzipentrysystemmadeby} to 
wxZIP\_SYSTEM\_MSDOS by default. So to be able to store unix
permissions when creating zips, call SetSystemMadeBy(wxZIP\_SYSTEM\_UNIX).


\membersection{wxZipEntry::SetNotifier}\label{wxzipentrynotifier}

\func{void}{SetNotifier}{\param{wxZipNotifier\& }{notifier}}

\func{void}{UnsetNotifier}{\void}

Sets the \helpref{notifier}{wxzipnotifier} for this entry.
Whenever the \helpref{wxZipInputStream}{wxzipinputstream} updates
this entry, it will then invoke the associated
notifier's \helpref{OnEntryUpdated}{wxzipnotifieronentryupdated}
method.

Setting a notifier is not usually necessary. It is used to handle
certain cases when modifying an zip in a pipeline (i.e. between
non-seekable streams).

\wxheading{See also}

\helpref{Archives on non-seekable streams}{wxarcnoseek}\\
\helpref{wxZipNotifier}{wxzipnotifier}


\membersection{wxZipEntry::Get/SetSystemMadeBy}\label{wxzipentrysystemmadeby}

\constfunc{int}{GetSystemMadeBy}{\void}

\func{void}{SetSystemMadeBy}{\param{int }{system}}

The originating file-system. The default constructor sets this to
wxZIP\_SYSTEM\_MSDOS. Set it to wxZIP\_SYSTEM\_UNIX in order to be
able to store unix permissions using \helpref{SetMode()}{wxzipentrymode}.


\membersection{wxZipEntry::IsMadeByUnix}\label{wxzipentryismadebyunix}

\constfunc{bool}{IsMadeByUnix}{\void}

Returns true if \helpref{GetSystemMadeBy()}{wxzipentrysystemmadeby}
is a flavour of unix.


\membersection{wxZipEntry::IsText/SetIsText}\label{wxzipentryistext}

\constfunc{bool}{IsText}{\void}

\func{void}{SetIsText}{\param{bool }{isText = true}}

Indicates that this entry's data is text in an 8-bit encoding.


\membersection{wxZipEntry::operator=}\label{wxzipentryoperatorassign}

\func{wxZipEntry\& operator}{operator=}{\param{const wxZipEntry\& }{entry}}

Assignment operator.


%
% automatically generated by HelpGen $Revision: 43373 $ from
% wx/zipstrm.h at 16/Sep/04 12:19:29
%

\section{\class{wxZipInputStream}}\label{wxzipinputstream}

Input stream for reading zip files.

\helpref{GetNextEntry()}{wxzipinputstreamgetnextentry} returns an
 \helpref{wxZipEntry}{wxzipentry} object containing the meta-data
for the next entry in the zip (and gives away ownership). Reading from
the wxZipInputStream then returns the entry's data. Eof() becomes true
after an attempt has been made to read past the end of the entry's data.
When there are no more entries, GetNextEntry() returns NULL and sets Eof().

Note that in general zip entries are not seekable, and
wxZipInputStream::SeekI() always returns wxInvalidOffset.

\wxheading{Derived from}

\helpref{wxArchiveInputStream}{wxarchiveinputstream}

\wxheading{Include files}

<wx/zipstrm.h>

\wxheading{Data structures}
\begin{verbatim}
typedef wxZipEntry entry_type
\end{verbatim}

\wxheading{See also}

\helpref{Archive formats such as zip}{wxarc}\\
\helpref{wxZipEntry}{wxzipentry}\\
\helpref{wxZipOutputStream}{wxzipoutputstream}

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxZipInputStream::wxZipInputStream}\label{wxzipinputstreamwxzipinputstream}

\func{}{wxZipInputStream}{\param{wxInputStream\& }{stream}, \param{wxMBConv\& }{conv = wxConvLocal}}

\func{}{wxZipInputStream}{\param{wxInputStream*}{stream}, \param{wxMBConv\& }{conv = wxConvLocal}}

Constructor. In a Unicode build the second parameter {\tt conv} is
used to translate the filename and comment fields into Unicode. It has
no effect on the stream's data.

If the parent stream is passed as a pointer then the new filter stream
takes ownership of it. If it is passed by reference then it does not.

\func{}{wxZipInputStream}{\param{const wxString\& }{archive}, \param{const wxString\& }{file}}

Compatibility constructor (requires WXWIN\_COMPATIBILITY\_2\_6).

When this constructor is used, an emulation of seeking is
switched on for compatibility with previous versions. Note however,
that it is deprecated.


\membersection{wxZipInputStream::CloseEntry}\label{wxzipinputstreamcloseentry}

\func{bool}{CloseEntry}{\void}

Closes the current entry. On a non-seekable stream reads to the end of
the current entry first.


\membersection{wxZipInputStream::GetComment}\label{wxzipinputstreamgetcomment}

\func{wxString}{GetComment}{\void}

Returns the zip comment.

This is stored at the end of the zip, therefore when reading a zip
from a non-seekable stream, it returns the empty string until the
end of the zip has been reached, i.e. when GetNextEntry() returns
NULL.


\membersection{wxZipInputStream::GetNextEntry}\label{wxzipinputstreamgetnextentry}

\func{wxZipEntry*}{GetNextEntry}{\void}

Closes the current entry if one is open, then reads the meta-data for
the next entry and returns it in a \helpref{wxZipEntry}{wxzipentry}
object, giving away ownership. The stream is then open and can be read.


\membersection{wxZipInputStream::GetTotalEntries}\label{wxzipinputstreamgettotalentries}

\func{int}{GetTotalEntries}{\void}

For a zip on a seekable stream returns the total number of entries in
the zip. For zips on non-seekable streams returns the number of entries
returned so far by \helpref{GetNextEntry()}{wxzipinputstreamgetnextentry}.


\membersection{wxZipInputStream::OpenEntry}\label{wxzipinputstreamopenentry}

\func{bool}{OpenEntry}{\param{wxZipEntry\& }{entry}}

Closes the current entry if one is open, then opens the entry specified
by the {\it entry} object.

{\it entry} should be from the same zip file, and the zip should
be on a seekable stream.

\wxheading{See also}

\helpref{Looking up an archive entry by name}{wxarcbyname}


%
% automatically generated by HelpGen $Revision: 43373 $ from
% wx/zipstrm.h at 16/Sep/04 12:19:29
%

\section{\class{wxZipNotifier}}\label{wxzipnotifier}

If you need to know when a \helpref{wxZipInputStream}{wxzipinputstream}
updates a \helpref{wxZipEntry}{wxzipentry},
you can create a notifier by deriving from this abstract base class,
overriding \helpref{OnEntryUpdated()}{wxzipnotifieronentryupdated}.
An instance of your notifier class can then be assigned to wxZipEntry
objects, using \helpref{wxZipEntry::SetNotifier()}{wxzipentrynotifier}.

Setting a notifier is not usually necessary. It is used to handle
certain cases when modifying an zip in a pipeline (i.e. between
non-seekable streams).
See '\helpref{Archives on non-seekable streams}{wxarcnoseek}'.

\wxheading{Derived from}

No base class

\wxheading{Include files}

<wx/zipstrm.h>

\wxheading{See also}

\helpref{Archives on non-seekable streams}{wxarcnoseek}\\
\helpref{wxZipEntry}{wxzipentry}\\
\helpref{wxZipInputStream}{wxzipinputstream}\\
\helpref{wxZipOutputStream}{wxzipoutputstream}

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxZipNotifier::OnEntryUpdated}\label{wxzipnotifieronentryupdated}

\func{void}{OnEntryUpdated}{\param{wxZipEntry\& }{entry}}

Override this to receive notifications when
an \helpref{wxZipEntry}{wxzipentry} object changes.


%
% automatically generated by HelpGen $Revision: 43373 $ from
% wx/zipstrm.h at 16/Sep/04 12:19:29
%

\section{\class{wxZipOutputStream}}\label{wxzipoutputstream}

Output stream for writing zip files.

\helpref{PutNextEntry()}{wxzipoutputstreamputnextentry} is used to create
a new entry in the output zip, then the entry's data is written to the
wxZipOutputStream.  Another call to PutNextEntry() closes the current
entry and begins the next.

\wxheading{Derived from}

\helpref{wxArchiveOutputStream}{wxarchiveoutputstream}

\wxheading{Include files}

<wx/zipstrm.h>

\wxheading{See also}

\helpref{Archive formats such as zip}{wxarc}\\
\helpref{wxZipEntry}{wxzipentry}\\
\helpref{wxZipInputStream}{wxzipinputstream}

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxZipOutputStream::wxZipOutputStream}\label{wxzipoutputstreamwxzipoutputstream}

\func{}{wxZipOutputStream}{\param{wxOutputStream\& }{stream}, \param{int }{level = -1}, \param{wxMBConv\& }{conv = wxConvLocal}}

\func{}{wxZipOutputStream}{\param{wxOutputStream*}{stream}, \param{int }{level = -1}, \param{wxMBConv\& }{conv = wxConvLocal}}

Constructor. {\tt level} is the compression level to use.
It can be a value between 0 and 9 or -1 to use the default value
which currently is equivalent to 6.

If the parent stream is passed as a pointer then the new filter stream
takes ownership of it. If it is passed by reference then it does not.

In a Unicode build the third parameter {\tt conv} is used to translate
the filename and comment fields to an 8-bit encoding. It has no effect on the
stream's data.


\membersection{wxZipOutputStream::\destruct{wxZipOutputStream}}\label{wxzipoutputstreamdtor}

\func{}{\destruct{wxZipOutputStream}}{\void}

The destructor calls \helpref{Close()}{wxzipoutputstreamclose} to finish
writing the zip if it has not been called already.


\membersection{wxZipOutputStream::Close}\label{wxzipoutputstreamclose}

\func{bool}{Close}{\void}

Finishes writing the zip, returning true if successful.
Called by the destructor if not called explicitly.


\membersection{wxZipOutputStream::CloseEntry}\label{wxzipoutputstreamcloseentry}

\func{bool}{CloseEntry}{\void}

Close the current entry. It is called implicitly whenever another new
entry is created with \helpref{CopyEntry()}{wxzipoutputstreamcopyentry}
or \helpref{PutNextEntry()}{wxzipoutputstreamputnextentry}, or
when the zip is closed.


\membersection{wxZipOutputStream::CopyArchiveMetaData}\label{wxzipoutputstreamcopyarchivemetadata}

\func{bool}{CopyArchiveMetaData}{\param{wxZipInputStream\& }{inputStream}}

Transfers the zip comment from the \helpref{wxZipInputStream}{wxzipinputstream}
to this output stream.


\membersection{wxZipOutputStream::CopyEntry}\label{wxzipoutputstreamcopyentry}

\func{bool}{CopyEntry}{\param{wxZipEntry* }{entry}, \param{wxZipInputStream\& }{inputStream}}

Takes ownership of {\tt entry} and uses it to create a new entry
in the zip. {\tt entry} is then opened in {\tt inputStream} and its contents
copied to this stream.

CopyEntry() is much more efficient than transferring the data using
Read() and Write() since it will copy them without decompressing and
recompressing them.

For zips on seekable streams, {\tt entry} must be from the same zip file
as {\tt stream}. For non-seekable streams, {\tt entry} must also be the
last thing read from {\tt inputStream}.


\membersection{wxZipOutputStream::Get/SetLevel}\label{wxzipoutputstreamlevel}

\constfunc{int}{GetLevel}{\void}

\func{void}{SetLevel}{\param{int }{level}}

Set the compression level that will be used the next time an entry is
created. It can be a value between 0 and 9 or -1 to use the default value
which currently is equivalent to 6.


\membersection{wxZipOutputStream::PutNextDirEntry}\label{wxzipoutputstreamputnextdirentry}

\func{bool}{PutNextDirEntry}{\param{const wxString\& }{name}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}}

Create a new directory entry
(see \helpref{wxArchiveEntry::IsDir()}{wxarchiveentryisdir})
with the given name and timestamp.

\helpref{PutNextEntry()}{wxzipoutputstreamputnextentry} can
also be used to create directory entries, by supplying a name with
a trailing path separator.


\membersection{wxZipOutputStream::PutNextEntry}\label{wxzipoutputstreamputnextentry}

\func{bool}{PutNextEntry}{\param{wxZipEntry* }{entry}}

Takes ownership of {\tt entry} and uses it to create a new entry
in the zip. 

\func{bool}{PutNextEntry}{\param{const wxString\& }{name}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}, \param{off\_t }{size = wxInvalidOffset}}

Create a new entry with the given name, timestamp and size.


\membersection{wxZipOutputStream::SetComment}\label{wxzipoutputstreamsetcomment}

\func{void}{SetComment}{\param{const wxString\& }{comment}}

Sets a comment for the zip as a whole. It is written at the end of the
zip.