]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/archive.tex
added copy constr
[wxWidgets.git] / docs / latex / wx / archive.tex
CommitLineData
00375592
VZ
1%
2% automatically generated by HelpGen $Revision$ from
3% wx/archive.h at 16/Sep/04 12:19:29
4%
5
6\section{\class{wxArchiveClassFactory}}\label{wxarchiveclassfactory}
7
716b1f70
MW
8Allows the creation of streams to handle archive formats such
9as zip and tar.
10
11For example, given a filename you can search for a factory that will
12handle it and create a stream to read it:
13
14\begin{verbatim}
15 factory = wxArchiveClassFactory::Find(filename, wxSTREAM_FILEEXT);
16 if (factory)
17 stream = factory->NewStream(new wxFFileInputStream(filename));
18
19\end{verbatim}
00375592 20
716b1f70
MW
21\helpref{Find()}{wxarchiveclassfactoryfind} can also search
22for a factory by MIME type or wxFileSystem protocol.
23The available factories can be enumerated
24using \helpref{GetFirst() and GetNext()}{wxarchiveclassfactorygetfirst}.
00375592
VZ
25
26\wxheading{Derived from}
27
28\helpref{wxObject}{wxobject}
29
30\wxheading{Include files}
31
32<wx/archive.h>
33
a7af285d
VZ
34\wxheading{Library}
35
36\helpref{wxBase}{librarieslist}
37
716b1f70
MW
38\wxheading{Data structures}
39
40\begin{verbatim}
41enum wxStreamProtocolType
42{
43 wxSTREAM_PROTOCOL, // wxFileSystem protocol (should be only one)
44 wxSTREAM_MIMETYPE, // MIME types the stream handles
45 wxSTREAM_ENCODING, // Not used for archives
46 wxSTREAM_FILEEXT // File extensions the stream handles
47};
48
49\end{verbatim}
50
00375592
VZ
51\wxheading{See also}
52
53\helpref{Archive formats such as zip}{wxarc}\\
54\helpref{Generic archive programming}{wxarcgeneric}\\
55\helpref{wxArchiveEntry}{wxarchiveentry}\\
56\helpref{wxArchiveInputStream}{wxarchiveinputstream}\\
716b1f70
MW
57\helpref{wxArchiveOutputStream}{wxarchiveoutputstream}\\
58\helpref{wxFilterClassFactory}{wxfilterclassfactory}
00375592
VZ
59
60\latexignore{\rtfignore{\wxheading{Members}}}
61
62
63\membersection{wxArchiveClassFactory::Get/SetConv}\label{wxarchiveclassfactoryconv}
64
65\constfunc{wxMBConv\&}{GetConv}{\void}
66
67\func{void}{SetConv}{\param{wxMBConv\& }{conv}}
68
69The \helpref{wxMBConv}{wxmbconv} object that the created streams
70will use when translating meta-data. The initial default, set by the
71constructor, is wxConvLocal.
72
73
716b1f70
MW
74\membersection{wxArchiveClassFactory::CanHandle}\label{wxarchiveclassfactorycanhandle}
75
76\constfunc{bool}{CanHandle}{\param{const wxChar* }{protocol}, \param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
77
78Returns true if this factory can handle the given protocol, MIME type
79or file extension.
80
81When using wxSTREAM\_FILEEXT for the second parameter, the first parameter
82can be a complete filename rather than just an extension.
83
84
85\membersection{wxArchiveClassFactory::Find}\label{wxarchiveclassfactoryfind}
86
87\func{static const wxArchiveClassFactory*}{Find}{\param{const wxChar* }{protocol}, \param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
88
89A static member that finds a factory that can handle a given protocol, MIME
90type or file extension. Returns a pointer to the class factory if found, or
91NULL otherwise. It does not give away ownership of the factory.
92
93When using wxSTREAM\_FILEEXT for the second parameter, the first parameter
94can be a complete filename rather than just an extension.
95
96
97\membersection{wxArchiveClassFactory::GetFirst/GetNext}\label{wxarchiveclassfactorygetfirst}
98
99\func{static const wxArchiveClassFactory*}{GetFirst}{\void}
100
101\constfunc{const wxArchiveClassFactory*}{GetNext}{\void}
102
103GetFirst and GetNext can be used to enumerate the available factories.
104
105For example, to list them:
106
107\begin{verbatim}
108 wxString list;
109 const wxArchiveClassFactory *factory = wxArchiveClassFactory::GetFirst();
110
111 while (factory) {
112 list << factory->GetProtocol() << _T("\n");
113 factory = factory->GetNext();
114 }
115
116\end{verbatim}
117
118GetFirst()/GetNext() return a pointer to a factory or NULL if no more
119are available. They do not give away ownership of the factory.
120
121
00375592
VZ
122\membersection{wxArchiveClassFactory::GetInternalName}\label{wxarchiveclassfactorygetinternalname}
123
124\constfunc{wxString}{GetInternalName}{\param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
125
126Calls the static GetInternalName() function for the archive entry type,
127for example
128 \helpref{wxZipEntry::GetInternalName()}{wxzipentrygetinternalname}.
129
130
716b1f70
MW
131\membersection{wxArchiveClassFactory::GetProtocol}\label{wxarchiveclassfactorygetprotocol}
132
133\constfunc{wxString}{GetProtocol}{\void}
134
135Returns the wxFileSystem protocol supported by this factory. Equivalent
136to wxString(*GetProtcols()).
137
138
139\membersection{wxArchiveClassFactory::GetProtocols}\label{wxarchiveclassfactorygetprotocols}
140
141\constfunc{const wxChar * const*}{GetProtocols}{\param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
142
143Returns the protocols, MIME types or file extensions supported by this
144factory, as an array of null terminated strings. It does not give away
145ownership of the array or strings.
146
147For example, to list the file extensions a factory supports:
148
149\begin{verbatim}
150 wxString list;
151 const wxChar *const *p;
152
153 for (p = factory->GetProtocols(wxSTREAM_FILEEXT); *p; p++)
154 list << *p << _T("\n");
155
156\end{verbatim}
157
158
00375592
VZ
159\membersection{wxArchiveClassFactory::NewEntry}\label{wxarchiveclassfactorynewentry}
160
161\constfunc{wxArchiveEntry*}{NewEntry}{\void}
162
163Create a new \helpref{wxArchiveEntry}{wxarchiveentry} object of the
164appropriate type.
165
166
167\membersection{wxArchiveClassFactory::NewStream}\label{wxarchiveclassfactorynewstream}
168
169\constfunc{wxArchiveInputStream*}{NewStream}{\param{wxInputStream\& }{stream}}
170
171\constfunc{wxArchiveOutputStream*}{NewStream}{\param{wxOutputStream\& }{stream}}
172
716b1f70
MW
173\constfunc{wxArchiveInputStream*}{NewStream}{\param{wxInputStream* }{stream}}
174
175\constfunc{wxArchiveOutputStream*}{NewStream}{\param{wxOutputStream* }{stream}}
176
177Create a new input or output stream to read or write an archive.
178
179If the parent stream is passed as a pointer then the new archive stream
180takes ownership of it. If it is passed by reference then it does not.
181
182
183\membersection{wxArchiveClassFactory::PushFront}\label{wxarchiveclassfactorypushfront}
184
185\func{void}{PushFront}{\void}
186
187Adds this class factory to the list returned
188by \helpref{GetFirst()/GetNext()}{wxarchiveclassfactorygetfirst}.
189
190It is not necessary to do this to use the archive streams. It is usually
191used when implementing streams, typically the implementation will
192add a static instance of its factory class.
193
194It can also be used to change the order of a factory already in the list,
195bringing it to the front. This isn't a thread safe operation
196so can't be done when other threads are running that will be using the list.
197
198The list does not take ownership of the factory.
199
200
201\membersection{wxArchiveClassFactory::Remove}\label{wxarchiveclassfactoryremove}
202
203\func{void}{Remove}{\void}
204
205Removes this class factory from the list returned
206by \helpref{GetFirst()/GetNext()}{wxarchiveclassfactorygetfirst}.
207
208Removing from the list isn't a thread safe operation
209so can't be done when other threads are running that will be using the list.
210
211The list does not own the factories, so removing a factory does not delete it.
00375592
VZ
212
213
214%
215% automatically generated by HelpGen $Revision$ from
216% wx/archive.h at 16/Sep/04 12:19:29
217%
218
219\section{\class{wxArchiveEntry}}\label{wxarchiveentry}
220
221An abstract base class which serves as a common interface to
222archive entry classes such as \helpref{wxZipEntry}{wxzipentry}.
223These hold the meta-data (filename, timestamp, etc.), for entries
224in archive files such as zips and tars.
225
226\wxheading{Derived from}
227
228\helpref{wxObject}{wxobject}
229
230\wxheading{Include files}
231
232<wx/archive.h>
233
a7af285d
VZ
234\wxheading{Library}
235
236\helpref{wxBase}{librarieslist}
237
00375592
VZ
238\wxheading{See also}
239
240\helpref{Archive formats such as zip}{wxarc}\\
241\helpref{Generic archive programming}{wxarcgeneric}\\
242\helpref{wxArchiveInputStream}{wxarchiveinputstream}\\
243\helpref{wxArchiveOutputStream}{wxarchiveoutputstream}\\
244\helpref{wxArchiveNotifier}{wxarchivenotifier}
245
246\wxheading{Non-seekable streams}
247
248This information applies only when reading archives from non-seekable
249streams. When the stream is
250seekable \helpref{GetNextEntry()}{wxarchiveinputstreamgetnextentry}
251returns a fully populated \helpref{wxArchiveEntry}{wxarchiveentry}.
252See '\helpref{Archives on non-seekable streams}{wxarcnoseek}' for
253more information.
254
255For generic programming, when the worst case must be assumed, you can
256rely on all the fields of wxArchiveEntry being fully populated when
257GetNextEntry() returns, with the the following exceptions:
258
259\begin{twocollist}\twocolwidtha{3cm}
260\twocolitem{\helpref{GetSize()}{wxarchiveentrysize}}{Guaranteed to be
261available after the entry has been read to \helpref{Eof()}{wxinputstreameof},
262or \helpref{CloseEntry()}{wxarchiveinputstreamcloseentry} has been called}
263\twocolitem{\helpref{IsReadOnly()}{wxarchiveentryisreadonly}}{Guaranteed to
264be available after the end of the archive has been reached, i.e. after
265GetNextEntry() returns NULL and Eof() is true}
266\end{twocollist}
267
268
269\latexignore{\rtfignore{\wxheading{Members}}}
270
271
272\membersection{wxArchiveEntry::Clone}\label{wxarchiveentryclone}
273
274\constfunc{wxArchiveEntry*}{Clone}{\void}
275
276Returns a copy of this entry object.
277
278
279\membersection{wxArchiveEntry::Get/SetDateTime}\label{wxarchiveentrydatetime}
280
281\constfunc{wxDateTime}{GetDateTime}{\void}
282
283\func{void}{SetDateTime}{\param{const wxDateTime\& }{dt}}
284
285The entry's timestamp.
286
287
288\membersection{wxArchiveEntry::GetInternalFormat}\label{wxarchiveentrygetinternalformat}
289
290\constfunc{wxPathFormat}{GetInternalFormat}{\void}
291
292Returns the path format used internally within the archive to store
293filenames.
294
295
296\membersection{wxArchiveEntry::GetInternalName}\label{wxarchiveentrygetinternalname}
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\wxheading{See also}
308
309\helpref{Looking up an archive entry by name}{wxarcbyname}
310
311
312\membersection{wxArchiveEntry::Get/SetName}\label{wxarchiveentryname}
313
314\constfunc{wxString}{GetName}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
315
316\func{void}{SetName}{\param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
317
318The entry's name, by default in the native format. The name can include
319directory components, i.e. it can be a full path.
320
321If this is a directory entry, (i.e. if \helpref{IsDir()}{wxarchiveentryisdir}
322is true) then GetName() returns the name with a trailing path separator.
323
324Similarly, setting a name with a trailing path separator sets IsDir().
325
326
327\membersection{wxArchiveEntry::GetOffset}\label{wxarchiveentrygetoffset}
328
329\constfunc{off\_t}{GetOffset}{\void}
330
331Returns a numeric value unique to the entry within the archive.
332
333
334\membersection{wxArchiveEntry::Get/SetSize}\label{wxarchiveentrysize}
335
336\constfunc{off\_t}{GetSize}{\void}
337
338\func{void}{SetSize}{\param{off\_t }{size}}
339
340The size of the entry's data in bytes.
341
342
343\membersection{wxArchiveEntry::IsDir/SetIsDir}\label{wxarchiveentryisdir}
344
345\constfunc{bool}{IsDir}{\void}
346
347\func{void}{SetIsDir}{\param{bool }{isDir = true}}
348
349True if this is a directory entry.
350
351Directory entries are entries with no data, which are used to store
352the meta-data of directories. They also make it possible for completely
353empty directories to be stored.
354
355The names of entries within an archive can be complete paths, and
356unarchivers typically create whatever directories are necessary as they
357restore files, even if the archive contains no explicit directory entries.
358
359
360\membersection{wxArchiveEntry::IsReadOnly/SetIsReadOnly}\label{wxarchiveentryisreadonly}
361
362\constfunc{bool}{IsReadOnly}{\void}
363
364\func{void}{SetIsReadOnly}{\param{bool }{isReadOnly = true}}
365
366True if the entry is a read-only file.
367
368
369\membersection{wxArchiveEntry::Set/UnsetNotifier}\label{wxarchiveentrynotifier}
370
371\func{void}{SetNotifier}{\param{wxArchiveNotifier\& }{notifier}}
372
373\func{void}{UnsetNotifier}{\void}
374
375Sets the \helpref{notifier}{wxarchivenotifier} for this entry.
376Whenever the \helpref{wxArchiveInputStream}{wxarchiveinputstream} updates
377this entry, it will then invoke the associated
378notifier's \helpref{OnEntryUpdated}{wxarchivenotifieronentryupdated}
379method.
380
381Setting a notifier is not usually necessary. It is used to handle
382certain cases when modifying an archive in a pipeline (i.e. between
383non-seekable streams).
384
385\wxheading{See also}
386
387\helpref{Archives on non-seekable streams}{wxarcnoseek}\\
388\helpref{wxArchiveNotifier}{wxarchivenotifier}
389
390
391%
392% automatically generated by HelpGen $Revision$ from
393% wx/archive.h at 16/Sep/04 12:19:29
394%
395
396\section{\class{wxArchiveInputStream}}\label{wxarchiveinputstream}
397
398An abstract base class which serves as a common interface to
399archive input streams such as \helpref{wxZipInputStream}{wxzipinputstream}.
400
401\helpref{GetNextEntry()}{wxarchiveinputstreamgetnextentry} returns an
402 \helpref{wxArchiveEntry}{wxarchiveentry} object containing the meta-data
403for the next entry in the archive (and gives away ownership). Reading from
404the wxArchiveInputStream then returns the entry's data. Eof() becomes true
405after an attempt has been made to read past the end of the entry's data.
406When there are no more entries, GetNextEntry() returns NULL and sets Eof().
407
408\wxheading{Derived from}
409
7376079d
VZ
410\helpref{wxFilterInputStream}{wxfilterinputstream}\\
411\helpref{wxInputStream}{wxinputstream}\\
412\helpref{wxStreamBase}{wxstreambase}
00375592
VZ
413
414\wxheading{Include files}
415
416<wx/archive.h>
417
a7af285d
VZ
418\wxheading{Library}
419
420\helpref{wxBase}{librarieslist}
421
00375592 422\wxheading{Data structures}
46263455
VZ
423\begin{verbatim}
424typedef wxArchiveEntry entry_type
425\end{verbatim}
00375592
VZ
426
427\wxheading{See also}
428
429\helpref{Archive formats such as zip}{wxarc}\\
430\helpref{wxArchiveEntry}{wxarchiveentry}\\
431\helpref{wxArchiveOutputStream}{wxarchiveoutputstream}
432
433\latexignore{\rtfignore{\wxheading{Members}}}
434
435
436\membersection{wxArchiveInputStream::CloseEntry}\label{wxarchiveinputstreamcloseentry}
437
438\func{bool}{CloseEntry}{\void}
439
440Closes the current entry. On a non-seekable stream reads to the end of
441the current entry first.
442
443
444\membersection{wxArchiveInputStream::GetNextEntry}\label{wxarchiveinputstreamgetnextentry}
445
446\func{wxArchiveEntry*}{GetNextEntry}{\void}
447
448Closes the current entry if one is open, then reads the meta-data for
449the next entry and returns it in a \helpref{wxArchiveEntry}{wxarchiveentry}
450object, giving away ownership. Reading this wxArchiveInputStream then
451returns the entry's data.
452
453
454\membersection{wxArchiveInputStream::OpenEntry}\label{wxarchiveinputstreamopenentry}
455
456\func{bool}{OpenEntry}{\param{wxArchiveEntry\& }{entry}}
457
458Closes the current entry if one is open, then opens the entry specified
459by the \helpref{wxArchiveEntry}{wxarchiveentry} object.
460
461{\it entry} must be from the same archive file that this
462wxArchiveInputStream is reading, and it must be reading it from a
463seekable stream.
464
465\wxheading{See also}
466
467\helpref{Looking up an archive entry by name}{wxarcbyname}
468
469
470%
471% automatically generated by HelpGen $Revision$ from
472% wx/archive.h at 16/Sep/04 12:19:29
473%
474
475\section{\class{wxArchiveIterator}}\label{wxarchiveiterator}
476
477An input iterator template class that can be used to transfer an archive's
478catalogue to a container. It is only available if wxUSE\_STL is set to 1
479in setup.h, and the uses for it outlined below require a compiler which
480supports member templates.
481
482\begin{verbatim}
483template <class Arc, class T = typename Arc::entry_type*>
484class wxArchiveIterator
485{
486 // this constructor creates an 'end of sequence' object
487 wxArchiveIterator();
488
489 // template parameter 'Arc' should be the type of an archive input stream
490 wxArchiveIterator(Arc& arc) {
491
492 /* ... */
493};
494
495\end{verbatim}
496
497The first template parameter should be the type of archive input stream
498(e.g. \helpref{wxArchiveInputStream}{wxarchiveinputstream}) and the
499second can either be a pointer to an entry
500(e.g. \helpref{wxArchiveEntry}{wxarchiveentry}*), or a string/pointer pair
501(e.g. std::pair<wxString, wxArchiveEntry*>).
502
503The {\tt <wx/archive.h>} header defines the following typedefs:
504
505\begin{verbatim}
506 typedef wxArchiveIterator<wxArchiveInputStream> wxArchiveIter;
507
508 typedef wxArchiveIterator<wxArchiveInputStream,
509 std::pair<wxString, wxArchiveEntry*> > wxArchivePairIter;
510
511\end{verbatim}
512
513The header for any implementation of this interface should define similar
514typedefs for its types, for example in {\tt <wx/zipstrm.h>} there is:
515
516\begin{verbatim}
517 typedef wxArchiveIterator<wxZipInputStream> wxZipIter;
518
519 typedef wxArchiveIterator<wxZipInputStream,
520 std::pair<wxString, wxZipEntry*> > wxZipPairIter;
521
522\end{verbatim}
523
524Transferring the catalogue of an archive {\it arc} to a vector {\it cat},
525can then be done something like this:
526
527\begin{verbatim}
528 std::vector<wxArchiveEntry*> cat((wxArchiveIter)arc, wxArchiveIter());
529
530\end{verbatim}
531
532When the iterator is dereferenced, it gives away ownership of an entry
533object. So in the above example, when you have finished with {\it cat}
534you must delete the pointers it contains.
535
536If you have smart pointers with normal copy semantics (i.e. not auto\_ptr
537or \helpref{wxScopedPtr}{wxscopedptr}), then you can create an iterator
538which uses them instead. For example, with a smart pointer class for
539zip entries {\it ZipEntryPtr}:
540
541\begin{verbatim}
542 typedef std::vector<ZipEntryPtr> ZipCatalog;
543 typedef wxArchiveIterator<wxZipInputStream, ZipEntryPtr> ZipIter;
544 ZipCatalog cat((ZipIter)zip, ZipIter());
545
546\end{verbatim}
547
548Iterators that return std::pair objects can be used to
549populate a std::multimap, to allow entries to be looked
550up by name. The string is initialised using the wxArchiveEntry object's
551 \helpref{GetInternalName()}{wxarchiveentrygetinternalname} function.
552
553\begin{verbatim}
554 typedef std::multimap<wxString, wxZipEntry*> ZipCatalog;
555 ZipCatalog cat((wxZipPairIter)zip, wxZipPairIter());
556
557\end{verbatim}
558
559Note that this iterator also gives away ownership of an entry
560object each time it is dereferenced. So in the above example, when
561you have finished with {\it cat} you must delete the pointers it contains.
562
563Or if you have them, a pair containing a smart pointer can be used
564(again {\it ZipEntryPtr}), no worries about ownership:
565
566\begin{verbatim}
567 typedef std::multimap<wxString, ZipEntryPtr> ZipCatalog;
568 typedef wxArchiveIterator<wxZipInputStream,
569 std::pair<wxString, ZipEntryPtr> > ZipPairIter;
570 ZipCatalog cat((ZipPairIter)zip, ZipPairIter());
571
572\end{verbatim}
573
574\wxheading{Derived from}
575
576No base class
577
578\wxheading{Include files}
579
580<wx/archive.h>
581
582\wxheading{See also}
583
584\helpref{wxArchiveEntry}{wxarchiveentry}\\
585\helpref{wxArchiveInputStream}{wxarchiveinputstream}\\
586\helpref{wxArchiveOutputStream}{wxarchiveoutputstream}
587
588\wxheading{Data structures}
46263455
VZ
589\begin{verbatim}
590typedef std::input_iterator_tag iterator_category
591typedef T value_type
592typedef ptrdiff_t difference_type
00375592 593typedef T* pointer
46263455
VZ
594typedef T& reference
595\end{verbatim}
00375592
VZ
596
597\latexignore{\rtfignore{\wxheading{Members}}}
598
599
600\membersection{wxArchiveIterator::wxArchiveIterator}\label{wxarchiveiteratorwxarchiveiterator}
601
602\func{}{wxArchiveIterator}{\void}
603
604Construct an 'end of sequence' instance.
605
606\func{}{wxArchiveIterator}{\param{Arc\& }{arc}}
607
608Construct iterator that returns all the entries in the archive input
609stream {\it arc}.
610
611
bee44427 612\membersection{wxArchiveIterator::operator*}\label{wxarchiveiteratoroperatorstar}
00375592
VZ
613
614\constfunc{const T\&}{operator*}{\void}
615
616Returns an entry object from the archive input stream, giving away
617ownership.
618
619
bee44427 620\membersection{wxArchiveIterator::operator++}\label{wxarchiveiteratoroperatorincrement}
00375592
VZ
621
622\func{wxArchiveIterator\&}{operator++}{\void}
623
624\func{wxArchiveIterator\&}{operator++}{\param{int}{}}
625
626Position the input iterator at the next entry in the archive input stream.
627
628
629%
630% automatically generated by HelpGen $Revision$ from
631% wx/archive.h at 16/Sep/04 12:19:29
632%
633
634\section{\class{wxArchiveNotifier}}\label{wxarchivenotifier}
635
636If you need to know when a
637 \helpref{wxArchiveInputStream}{wxarchiveinputstream} updates a
638 \helpref{wxArchiveEntry}{wxarchiveentry} object, you can create
639a notifier by deriving from this abstract base class, overriding
640 \helpref{OnEntryUpdated()}{wxarchivenotifieronentryupdated}. An instance
641of your notifier class can then be assigned to the wxArchiveEntry object
642using \helpref{wxArchiveEntry::SetNotifier()}{wxarchiveentrynotifier}.
643Your OnEntryUpdated() method will then be invoked whenever the input
644stream updates the entry.
645
646Setting a notifier is not usually necessary. It is used to handle
647certain cases when modifying an archive in a pipeline (i.e. between
648non-seekable streams).
649See \helpref{Archives on non-seekable streams}{wxarcnoseek}.
650
651\wxheading{Derived from}
652
653No base class
654
655\wxheading{Include files}
656
657<wx/archive.h>
658
a7af285d
VZ
659\wxheading{Library}
660
661\helpref{wxBase}{librarieslist}
662
00375592
VZ
663\wxheading{See also}
664
665\helpref{Archives on non-seekable streams}{wxarcnoseek}\\
666\helpref{wxArchiveEntry}{wxarchiveentry}\\
667\helpref{wxArchiveInputStream}{wxarchiveinputstream}\\
668\helpref{wxArchiveOutputStream}{wxarchiveoutputstream}
669
670\latexignore{\rtfignore{\wxheading{Members}}}
671
672
673\membersection{wxArchiveNotifier::OnEntryUpdated}\label{wxarchivenotifieronentryupdated}
674
675\func{void}{OnEntryUpdated}{\param{class wxArchiveEntry\& }{entry}}
676
677This method must be overridden in your derived class.
678
679
680%
681% automatically generated by HelpGen $Revision$ from
682% wx/archive.h at 16/Sep/04 12:19:29
683%
684
685\section{\class{wxArchiveOutputStream}}\label{wxarchiveoutputstream}
686
687An abstract base class which serves as a common interface to
688archive output streams such as \helpref{wxZipOutputStream}{wxzipoutputstream}.
689
690\helpref{PutNextEntry()}{wxarchiveoutputstreamputnextentry} is used
691to create a new entry in the output archive, then the entry's data is
692written to the wxArchiveOutputStream. Another call to PutNextEntry()
693closes the current entry and begins the next.
694
695\wxheading{Derived from}
696
7376079d
VZ
697\helpref{wxFilterOutputStream}{wxfilteroutputstream}\\
698\helpref{wxOutputStream}{wxoutputstream}\\
699\helpref{wxStreamBase}{wxstreambase}
00375592
VZ
700
701\wxheading{Include files}
702
703<wx/archive.h>
704
a7af285d
VZ
705\wxheading{Library}
706
707\helpref{wxBase}{librarieslist}
708
00375592
VZ
709\wxheading{See also}
710
711\helpref{Archive formats such as zip}{wxarc}\\
712\helpref{wxArchiveEntry}{wxarchiveentry}\\
713\helpref{wxArchiveInputStream}{wxarchiveinputstream}
714
715\latexignore{\rtfignore{\wxheading{Members}}}
716
717
718\membersection{wxArchiveOutputStream::\destruct{wxArchiveOutputStream}}\label{wxarchiveoutputstreamdtor}
719
720\func{}{\destruct{wxArchiveOutputStream}}{\void}
721
722Calls \helpref{Close()}{wxarchiveoutputstreamclose} if it has not already
723been called.
724
725
726\membersection{wxArchiveOutputStream::Close}\label{wxarchiveoutputstreamclose}
727
728\func{bool}{Close}{\void}
729
730Closes the archive, returning true if it was successfully written.
731Called by the destructor if not called explicitly.
732
733
734\membersection{wxArchiveOutputStream::CloseEntry}\label{wxarchiveoutputstreamcloseentry}
735
736\func{bool}{CloseEntry}{\void}
737
738Close the current entry. It is called implicitly whenever another new
739entry is created with \helpref{CopyEntry()}{wxarchiveoutputstreamcopyentry}
740or \helpref{PutNextEntry()}{wxarchiveoutputstreamputnextentry}, or
741when the archive is closed.
742
743
744\membersection{wxArchiveOutputStream::CopyArchiveMetaData}\label{wxarchiveoutputstreamcopyarchivemetadata}
745
746\func{bool}{CopyArchiveMetaData}{\param{wxArchiveInputStream\& }{stream}}
747
748Some archive formats have additional meta-data that applies to the archive
749as a whole. For example in the case of zip there is a comment, which
750is stored at the end of the zip file. CopyArchiveMetaData() can be used
751to transfer such information when writing a modified copy of an archive.
752
753Since the position of the meta-data can vary between the various archive
754formats, it is best to call CopyArchiveMetaData() before transferring
755the entries. The \helpref{wxArchiveOutputStream}{wxarchiveoutputstream}
756will then hold on to the meta-data and write it at the correct point in
757the output file.
758
759When the input archive is being read from a non-seekable stream, the
760meta-data may not be available when CopyArchiveMetaData() is called,
761in which case the two streams set up a link and transfer the data
762when it becomes available.
763
764
765\membersection{wxArchiveOutputStream::CopyEntry}\label{wxarchiveoutputstreamcopyentry}
766
767\func{bool}{CopyEntry}{\param{wxArchiveEntry* }{entry}, \param{wxArchiveInputStream\& }{stream}}
768
769Takes ownership of {\it entry} and uses it to create a new entry in the
770archive. {\it entry} is then opened in the input stream {\it stream}
771and its contents copied to this stream.
772
773For archive types which compress entry data, CopyEntry() is likely to be
774much more efficient than transferring the data using Read() and Write()
775since it will copy them without decompressing and recompressing them.
776
777{\it entry} must be from the same archive file that {\it stream} is
778accessing. For non-seekable streams, {\it entry} must also be the last
779thing read from {\it stream}.
780
781
782\membersection{wxArchiveOutputStream::PutNextDirEntry}\label{wxarchiveoutputstreamputnextdirentry}
783
784\func{bool}{PutNextDirEntry}{\param{const wxString\& }{name}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}}
785
786Create a new directory entry
787(see \helpref{wxArchiveEntry::IsDir()}{wxarchiveentryisdir})
788with the given name and timestamp.
789
790\helpref{PutNextEntry()}{wxarchiveoutputstreamputnextentry} can
791also be used to create directory entries, by supplying a name with
792a trailing path separator.
793
794
795\membersection{wxArchiveOutputStream::PutNextEntry}\label{wxarchiveoutputstreamputnextentry}
796
797\func{bool}{PutNextEntry}{\param{wxArchiveEntry* }{entry}}
798
799Takes ownership of {\it entry} and uses it to create a new entry in
800the archive. The entry's data can then be written by writing to this
801wxArchiveOutputStream.
802
803\func{bool}{PutNextEntry}{\param{const wxString\& }{name}, \param{const wxDateTime\& }{dt = wxDateTime::Now()}, \param{off\_t }{size = wxInvalidOffset}}
804
805Create a new entry with the given name, timestamp and size. The entry's
806data can then be written by writing to this wxArchiveOutputStream.
807
808