2 % automatically generated by HelpGen $Revision$ from
3 % wx/archive.h at 16/Sep/04 12:19:29
6 \section{\class{wxArchiveClassFactory
}}\label{wxarchiveclassfactory
}
8 Allows the creation of streams to handle archive formats such
11 For example, given a filename you can search for a factory that will
12 handle it and create a stream to read it:
15 factory = wxArchiveClassFactory::Find(filename, wxSTREAM_FILEEXT);
17 stream = factory->NewStream(new wxFFileInputStream(filename));
21 \helpref{Find()
}{wxarchiveclassfactoryfind
} can also search
22 for a factory by MIME type or wxFileSystem protocol.
23 The available factories can be enumerated
24 using
\helpref{GetFirst() and GetNext()
}{wxarchiveclassfactorygetfirst
}.
26 \wxheading{Derived from
}
28 \helpref{wxObject
}{wxobject
}
30 \wxheading{Include files
}
34 \wxheading{Data structures
}
37 enum wxStreamProtocolType
39 wxSTREAM_PROTOCOL, // wxFileSystem protocol (should be only one)
40 wxSTREAM_MIMETYPE, // MIME types the stream handles
41 wxSTREAM_ENCODING, // Not used for archives
42 wxSTREAM_FILEEXT // File extensions the stream handles
49 \helpref{Archive formats such as zip
}{wxarc
}\\
50 \helpref{Generic archive programming
}{wxarcgeneric
}\\
51 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
52 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}\\
53 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}\\
54 \helpref{wxFilterClassFactory
}{wxfilterclassfactory
}
56 \latexignore{\rtfignore{\wxheading{Members
}}}
59 \membersection{wxArchiveClassFactory::Get/SetConv
}\label{wxarchiveclassfactoryconv
}
61 \constfunc{wxMBConv\&
}{GetConv
}{\void}
63 \func{void
}{SetConv
}{\param{wxMBConv\&
}{conv
}}
65 The
\helpref{wxMBConv
}{wxmbconv
} object that the created streams
66 will use when translating meta-data. The initial default, set by the
67 constructor, is wxConvLocal.
70 \membersection{wxArchiveClassFactory::CanHandle
}\label{wxarchiveclassfactorycanhandle
}
72 \constfunc{bool
}{CanHandle
}{\param{const wxChar*
}{protocol
},
\param{wxStreamProtocolType
}{type = wxSTREAM
\_PROTOCOL}}
74 Returns true if this factory can handle the given protocol, MIME type
77 When using wxSTREAM
\_FILEEXT for the second parameter, the first parameter
78 can be a complete filename rather than just an extension.
81 \membersection{wxArchiveClassFactory::Find
}\label{wxarchiveclassfactoryfind
}
83 \func{static const wxArchiveClassFactory*
}{Find
}{\param{const wxChar*
}{protocol
},
\param{wxStreamProtocolType
}{type = wxSTREAM
\_PROTOCOL}}
85 A static member that finds a factory that can handle a given protocol, MIME
86 type or file extension. Returns a pointer to the class factory if found, or
87 NULL otherwise. It does not give away ownership of the factory.
89 When using wxSTREAM
\_FILEEXT for the second parameter, the first parameter
90 can be a complete filename rather than just an extension.
93 \membersection{wxArchiveClassFactory::GetFirst/GetNext
}\label{wxarchiveclassfactorygetfirst
}
95 \func{static const wxArchiveClassFactory*
}{GetFirst
}{\void}
97 \constfunc{const wxArchiveClassFactory*
}{GetNext
}{\void}
99 GetFirst and GetNext can be used to enumerate the available factories.
101 For example, to list them:
105 const wxArchiveClassFactory *factory = wxArchiveClassFactory::GetFirst();
108 list << factory->GetProtocol() << _T("
\n");
109 factory = factory->GetNext();
114 GetFirst()/GetNext() return a pointer to a factory or NULL if no more
115 are available. They do not give away ownership of the factory.
118 \membersection{wxArchiveClassFactory::GetInternalName
}\label{wxarchiveclassfactorygetinternalname
}
120 \constfunc{wxString
}{GetInternalName
}{\param{const wxString\&
}{name
},
\param{wxPathFormat
}{format = wxPATH
\_NATIVE}}
122 Calls the static GetInternalName() function for the archive entry type,
124 \helpref{wxZipEntry::GetInternalName()
}{wxzipentrygetinternalname
}.
127 \membersection{wxArchiveClassFactory::GetProtocol
}\label{wxarchiveclassfactorygetprotocol
}
129 \constfunc{wxString
}{GetProtocol
}{\void}
131 Returns the wxFileSystem protocol supported by this factory. Equivalent
132 to wxString
(*GetProtcols()).
135 \membersection{wxArchiveClassFactory::GetProtocols}\label{wxarchiveclassfactorygetprotocols}
137 \constfunc{const wxChar * const*}{GetProtocols}{\param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
139 Returns the protocols, MIME types or file extensions supported by this
140 factory, as an array of null terminated strings. It does not give away
141 ownership of the array or strings.
143 For example, to list the file extensions a factory supports:
147 const wxChar *const *p;
149 for (p = factory->GetProtocols(wxSTREAM_FILEEXT); *p; p++)
150 list << *p << _T("\n");
155 \membersection{wxArchiveClassFactory::NewEntry}\label{wxarchiveclassfactorynewentry}
157 \constfunc{wxArchiveEntry*}{NewEntry}{\void}
159 Create a new \helpref{wxArchiveEntry}{wxarchiveentry} object of the
163 \membersection{wxArchiveClassFactory::NewStream}\label{wxarchiveclassfactorynewstream}
165 \constfunc{wxArchiveInputStream*}{NewStream}{\param{wxInputStream\& }{stream}}
167 \constfunc{wxArchiveOutputStream*}{NewStream}{\param{wxOutputStream\& }{stream}}
169 \constfunc{wxArchiveInputStream*}{NewStream}{\param{wxInputStream* }{stream}}
171 \constfunc{wxArchiveOutputStream*}{NewStream}{\param{wxOutputStream* }{stream}}
173 Create a new input or output stream to read or write an archive.
175 If the parent stream is passed as a pointer then the new archive stream
176 takes ownership of it. If it is passed by reference then it does not.
179 \membersection{wxArchiveClassFactory::PushFront}\label{wxarchiveclassfactorypushfront}
181 \func{void}{PushFront}{\void}
183 Adds this class factory to the list returned
184 by \helpref{GetFirst()/GetNext()}{wxarchiveclassfactorygetfirst}.
186 It is not necessary to do this to use the archive streams. It is usually
187 used when implementing streams, typically the implementation will
188 add a static instance of its factory class.
190 It can also be used to change the order of a factory already in the list,
191 bringing it to the front. This isn't a thread safe operation
192 so can't be done when other threads are running that will be using the list.
194 The list does not take ownership of the factory.
197 \membersection{wxArchiveClassFactory::Remove}\label{wxarchiveclassfactoryremove}
199 \func{void}{Remove}{\void}
201 Removes this class factory from the list returned
202 by \helpref{GetFirst()/GetNext()}{wxarchiveclassfactorygetfirst}.
204 Removing from the list isn't a thread safe operation
205 so can't be done when other threads are running that will be using the list.
207 The list does not own the factories, so removing a factory does not delete it.
211 % automatically generated by HelpGen $Revision$ from
212 % wx/archive.h at 16/Sep/04 12:19:29
215 \section{\class{wxArchiveEntry}}\label{wxarchiveentry}
217 An abstract base class which serves as a common interface to
218 archive entry classes such as \helpref{wxZipEntry}{wxzipentry}.
219 These hold the meta-data (filename, timestamp, etc.), for entries
220 in archive files such as zips and tars.
222 \wxheading{Derived from}
224 \helpref{wxObject}{wxobject}
226 \wxheading{Include files}
232 \helpref{Archive formats such as zip}{wxarc}\\
233 \helpref{Generic archive programming}{wxarcgeneric}\\
234 \helpref{wxArchiveInputStream}{wxarchiveinputstream}\\
235 \helpref{wxArchiveOutputStream}{wxarchiveoutputstream}\\
236 \helpref{wxArchiveNotifier}{wxarchivenotifier}
238 \wxheading{Non-seekable streams}
240 This information applies only when reading archives from non-seekable
241 streams. When the stream is
242 seekable \helpref{GetNextEntry()}{wxarchiveinputstreamgetnextentry}
243 returns a fully populated \helpref{wxArchiveEntry}{wxarchiveentry}.
244 See '\helpref{Archives on non-seekable streams}{wxarcnoseek}' for
247 For generic programming, when the worst case must be assumed, you can
248 rely on all the fields of wxArchiveEntry being fully populated when
249 GetNextEntry() returns, with the the following exceptions:
251 \begin{twocollist}\twocolwidtha{3cm}
252 \twocolitem{\helpref{GetSize()}{wxarchiveentrysize}}{Guaranteed to be
253 available after the entry has been read to \helpref{Eof()}{wxinputstreameof},
254 or \helpref{CloseEntry()}{wxarchiveinputstreamcloseentry} has been called}
255 \twocolitem{\helpref{IsReadOnly()}{wxarchiveentryisreadonly}}{Guaranteed to
256 be available after the end of the archive has been reached, i.e. after
257 GetNextEntry() returns NULL and Eof() is true}
261 \latexignore{\rtfignore{\wxheading{Members}}}
264 \membersection{wxArchiveEntry::Clone}\label{wxarchiveentryclone}
266 \constfunc{wxArchiveEntry*}{Clone}{\void}
268 Returns a copy of this entry object.
271 \membersection{wxArchiveEntry::Get/SetDateTime}\label{wxarchiveentrydatetime}
273 \constfunc{wxDateTime}{GetDateTime}{\void}
275 \func{void}{SetDateTime}{\param{const wxDateTime\& }{dt}}
277 The entry's timestamp.
280 \membersection{wxArchiveEntry::GetInternalFormat}\label{wxarchiveentrygetinternalformat}
282 \constfunc{wxPathFormat}{GetInternalFormat}{\void}
284 Returns the path format used internally within the archive to store
288 \membersection{wxArchiveEntry::GetInternalName}\label{wxarchiveentrygetinternalname}
290 \constfunc{wxString}{GetInternalName}{\void}
292 Returns the entry's filename in the internal format used within the
293 archive. The name can include directory components, i.e. it can be a
296 The names of directory entries are returned without any trailing path
297 separator. This gives a canonical name that can be used in comparisons.
301 \helpref{Looking up an archive entry by name}{wxarcbyname}
304 \membersection{wxArchiveEntry::Get/SetName}\label{wxarchiveentryname}
306 \constfunc{wxString}{GetName}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
308 \func{void}{SetName}{\param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
310 The entry's name, by default in the native format. The name can include
311 directory components, i.e. it can be a full path.
313 If this is a directory entry, (i.e. if \helpref{IsDir()}{wxarchiveentryisdir}
314 is true) then GetName() returns the name with a trailing path separator.
316 Similarly, setting a name with a trailing path separator sets IsDir().
319 \membersection{wxArchiveEntry::GetOffset}\label{wxarchiveentrygetoffset}
321 \constfunc{off\_t}{GetOffset}{\void}
323 Returns a numeric value unique to the entry within the archive.
326 \membersection{wxArchiveEntry::Get/SetSize}\label{wxarchiveentrysize}
328 \constfunc{off\_t}{GetSize}{\void}
330 \func{void}{SetSize}{\param{off\_t }{size}}
332 The size of the entry's data in bytes.
335 \membersection{wxArchiveEntry::IsDir/SetIsDir}\label{wxarchiveentryisdir}
337 \constfunc{bool}{IsDir}{\void}
339 \func{void}{SetIsDir}{\param{bool }{isDir = true}}
341 True if this is a directory entry.
343 Directory entries are entries with no data, which are used to store
344 the meta-data of directories. They also make it possible for completely
345 empty directories to be stored.
347 The names of entries within an archive can be complete paths, and
348 unarchivers typically create whatever directories are necessary as they
349 restore files, even if the archive contains no explicit directory entries.
352 \membersection{wxArchiveEntry::IsReadOnly/SetIsReadOnly}\label{wxarchiveentryisreadonly}
354 \constfunc{bool}{IsReadOnly}{\void}
356 \func{void}{SetIsReadOnly}{\param{bool }{isReadOnly = true}}
358 True if the entry is a read-only file.
361 \membersection{wxArchiveEntry::Set/UnsetNotifier}\label{wxarchiveentrynotifier}
363 \func{void}{SetNotifier}{\param{wxArchiveNotifier\& }{notifier}}
365 \func{void}{UnsetNotifier}{\void}
367 Sets the \helpref{notifier}{wxarchivenotifier} for this entry.
368 Whenever the \helpref{wxArchiveInputStream}{wxarchiveinputstream} updates
369 this entry, it will then invoke the associated
370 notifier's \helpref{OnEntryUpdated}{wxarchivenotifieronentryupdated}
373 Setting a notifier is not usually necessary. It is used to handle
374 certain cases when modifying an archive in a pipeline (i.e. between
375 non-seekable streams).
379 \helpref{Archives on non-seekable streams}{wxarcnoseek}\\
380 \helpref{wxArchiveNotifier}{wxarchivenotifier}
384 % automatically generated by HelpGen $Revision$ from
385 % wx/archive.h at 16/Sep/04 12:19:29
388 \section{\class{wxArchiveInputStream}}\label{wxarchiveinputstream}
390 An abstract base class which serves as a common interface to
391 archive input streams such as \helpref{wxZipInputStream}{wxzipinputstream}.
393 \helpref{GetNextEntry()}{wxarchiveinputstreamgetnextentry} returns an
394 \helpref{wxArchiveEntry}{wxarchiveentry} object containing the meta-data
395 for the next entry in the archive (and gives away ownership). Reading from
396 the wxArchiveInputStream then returns the entry's data. Eof() becomes true
397 after an attempt has been made to read past the end of the entry's data.
398 When there are no more entries, GetNextEntry() returns NULL and sets Eof().
400 \wxheading{Derived from}
402 \helpref{wxFilterInputStream}{wxfilterinputstream}
404 \wxheading{Include files}
408 \wxheading{Data structures}
410 typedef wxArchiveEntry entry_type
415 \helpref{Archive formats such as zip}{wxarc}\\
416 \helpref{wxArchiveEntry}{wxarchiveentry}\\
417 \helpref{wxArchiveOutputStream}{wxarchiveoutputstream}
419 \latexignore{\rtfignore{\wxheading{Members}}}
422 \membersection{wxArchiveInputStream::CloseEntry}\label{wxarchiveinputstreamcloseentry}
424 \func{bool}{CloseEntry}{\void}
426 Closes the current entry. On a non-seekable stream reads to the end of
427 the current entry first.
430 \membersection{wxArchiveInputStream::GetNextEntry}\label{wxarchiveinputstreamgetnextentry}
432 \func{wxArchiveEntry*}{GetNextEntry}{\void}
434 Closes the current entry if one is open, then reads the meta-data for
435 the next entry and returns it in a \helpref{wxArchiveEntry}{wxarchiveentry}
436 object, giving away ownership. Reading this wxArchiveInputStream then
437 returns the entry's data.
440 \membersection{wxArchiveInputStream::OpenEntry}\label{wxarchiveinputstreamopenentry}
442 \func{bool}{OpenEntry}{\param{wxArchiveEntry\& }{entry}}
444 Closes the current entry if one is open, then opens the entry specified
445 by the \helpref{wxArchiveEntry}{wxarchiveentry} object.
447 {\it entry} must be from the same archive file that this
448 wxArchiveInputStream is reading, and it must be reading it from a
453 \helpref{Looking up an archive entry by name}{wxarcbyname}
457 % automatically generated by HelpGen $Revision$ from
458 % wx/archive.h at 16/Sep/04 12:19:29
461 \section{\class{wxArchiveIterator}}\label{wxarchiveiterator}
463 An input iterator template class that can be used to transfer an archive's
464 catalogue to a container. It is only available if wxUSE\_STL is set to 1
465 in setup.h, and the uses for it outlined below require a compiler which
466 supports member templates.
469 template <class Arc, class T = typename Arc::entry_type*>
470 class wxArchiveIterator
472 // this constructor creates an 'end of sequence' object
475 // template parameter 'Arc' should be the type of an archive input stream
476 wxArchiveIterator(Arc& arc) {
483 The first template parameter should be the type of archive input stream
484 (e.g. \helpref{wxArchiveInputStream}{wxarchiveinputstream}) and the
485 second can either be a pointer to an entry
486 (e.g. \helpref{wxArchiveEntry}{wxarchiveentry}*), or a string/pointer pair
487 (e.g. std::pair<wxString, wxArchiveEntry*>).
489 The
{\tt <wx/archive.h>
} header defines the following typedefs:
492 typedef wxArchiveIterator<wxArchiveInputStream> wxArchiveIter;
494 typedef wxArchiveIterator<wxArchiveInputStream,
495 std::pair<wxString, wxArchiveEntry*> > wxArchivePairIter;
499 The header for any implementation of this interface should define similar
500 typedefs for its types, for example in
{\tt <wx/zipstrm.h>
} there is:
503 typedef wxArchiveIterator<wxZipInputStream> wxZipIter;
505 typedef wxArchiveIterator<wxZipInputStream,
506 std::pair<wxString, wxZipEntry*> > wxZipPairIter;
510 Transferring the catalogue of an archive
{\it arc
} to a vector
{\it cat
},
511 can then be done something like this:
514 std::vector<wxArchiveEntry*> cat((wxArchiveIter)arc, wxArchiveIter());
518 When the iterator is dereferenced, it gives away ownership of an entry
519 object. So in the above example, when you have finished with
{\it cat
}
520 you must delete the pointers it contains.
522 If you have smart pointers with normal copy semantics (i.e. not auto
\_ptr
523 or
\helpref{wxScopedPtr
}{wxscopedptr
}), then you can create an iterator
524 which uses them instead. For example, with a smart pointer class for
525 zip entries
{\it ZipEntryPtr
}:
528 typedef std::vector<ZipEntryPtr> ZipCatalog;
529 typedef wxArchiveIterator<wxZipInputStream, ZipEntryPtr> ZipIter;
530 ZipCatalog cat((ZipIter)zip, ZipIter());
534 Iterators that return std::pair objects can be used to
535 populate a std::multimap, to allow entries to be looked
536 up by name. The string is initialised using the wxArchiveEntry object's
537 \helpref{GetInternalName()
}{wxarchiveentrygetinternalname
} function.
540 typedef std::multimap<wxString, wxZipEntry*> ZipCatalog;
541 ZipCatalog cat((wxZipPairIter)zip, wxZipPairIter());
545 Note that this iterator also gives away ownership of an entry
546 object each time it is dereferenced. So in the above example, when
547 you have finished with
{\it cat
} you must delete the pointers it contains.
549 Or if you have them, a pair containing a smart pointer can be used
550 (again
{\it ZipEntryPtr
}), no worries about ownership:
553 typedef std::multimap<wxString, ZipEntryPtr> ZipCatalog;
554 typedef wxArchiveIterator<wxZipInputStream,
555 std::pair<wxString, ZipEntryPtr> > ZipPairIter;
556 ZipCatalog cat((ZipPairIter)zip, ZipPairIter());
560 \wxheading{Derived from
}
564 \wxheading{Include files
}
570 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
571 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}\\
572 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
574 \wxheading{Data structures
}
576 typedef std::input_iterator_tag iterator_category
578 typedef ptrdiff_t difference_type
583 \latexignore{\rtfignore{\wxheading{Members
}}}
586 \membersection{wxArchiveIterator::wxArchiveIterator
}\label{wxarchiveiteratorwxarchiveiterator
}
588 \func{}{wxArchiveIterator
}{\void}
590 Construct an 'end of sequence' instance.
592 \func{}{wxArchiveIterator
}{\param{Arc\&
}{arc
}}
594 Construct iterator that returns all the entries in the archive input
598 \membersection{wxArchiveIterator::operator*
}\label{wxarchiveiteratoroperatorstar
}
600 \constfunc{const T\&
}{operator*
}{\void}
602 Returns an entry object from the archive input stream, giving away
606 \membersection{wxArchiveIterator::operator++
}\label{wxarchiveiteratoroperatorincrement
}
608 \func{wxArchiveIterator\&
}{operator++
}{\void}
610 \func{wxArchiveIterator\&
}{operator++
}{\param{int
}{}}
612 Position the input iterator at the next entry in the archive input stream.
616 % automatically generated by HelpGen $Revision$ from
617 % wx/archive.h at 16/Sep/04 12:19:29
620 \section{\class{wxArchiveNotifier
}}\label{wxarchivenotifier
}
622 If you need to know when a
623 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
} updates a
624 \helpref{wxArchiveEntry
}{wxarchiveentry
} object, you can create
625 a notifier by deriving from this abstract base class, overriding
626 \helpref{OnEntryUpdated()
}{wxarchivenotifieronentryupdated
}. An instance
627 of your notifier class can then be assigned to the wxArchiveEntry object
628 using
\helpref{wxArchiveEntry::SetNotifier()
}{wxarchiveentrynotifier
}.
629 Your OnEntryUpdated() method will then be invoked whenever the input
630 stream updates the entry.
632 Setting a notifier is not usually necessary. It is used to handle
633 certain cases when modifying an archive in a pipeline (i.e. between
634 non-seekable streams).
635 See
\helpref{Archives on non-seekable streams
}{wxarcnoseek
}.
637 \wxheading{Derived from
}
641 \wxheading{Include files
}
647 \helpref{Archives on non-seekable streams
}{wxarcnoseek
}\\
648 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
649 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}\\
650 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
652 \latexignore{\rtfignore{\wxheading{Members
}}}
655 \membersection{wxArchiveNotifier::OnEntryUpdated
}\label{wxarchivenotifieronentryupdated
}
657 \func{void
}{OnEntryUpdated
}{\param{class wxArchiveEntry\&
}{entry
}}
659 This method must be overridden in your derived class.
663 % automatically generated by HelpGen $Revision$ from
664 % wx/archive.h at 16/Sep/04 12:19:29
667 \section{\class{wxArchiveOutputStream
}}\label{wxarchiveoutputstream
}
669 An abstract base class which serves as a common interface to
670 archive output streams such as
\helpref{wxZipOutputStream
}{wxzipoutputstream
}.
672 \helpref{PutNextEntry()
}{wxarchiveoutputstreamputnextentry
} is used
673 to create a new entry in the output archive, then the entry's data is
674 written to the wxArchiveOutputStream. Another call to PutNextEntry()
675 closes the current entry and begins the next.
677 \wxheading{Derived from
}
679 \helpref{wxFilterOutputStream
}{wxfilteroutputstream
}
681 \wxheading{Include files
}
687 \helpref{Archive formats such as zip
}{wxarc
}\\
688 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
689 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}
691 \latexignore{\rtfignore{\wxheading{Members
}}}
694 \membersection{wxArchiveOutputStream::
\destruct{wxArchiveOutputStream
}}\label{wxarchiveoutputstreamdtor
}
696 \func{}{\destruct{wxArchiveOutputStream
}}{\void}
698 Calls
\helpref{Close()
}{wxarchiveoutputstreamclose
} if it has not already
702 \membersection{wxArchiveOutputStream::Close
}\label{wxarchiveoutputstreamclose
}
704 \func{bool
}{Close
}{\void}
706 Closes the archive, returning true if it was successfully written.
707 Called by the destructor if not called explicitly.
710 \membersection{wxArchiveOutputStream::CloseEntry
}\label{wxarchiveoutputstreamcloseentry
}
712 \func{bool
}{CloseEntry
}{\void}
714 Close the current entry. It is called implicitly whenever another new
715 entry is created with
\helpref{CopyEntry()
}{wxarchiveoutputstreamcopyentry
}
716 or
\helpref{PutNextEntry()
}{wxarchiveoutputstreamputnextentry
}, or
717 when the archive is closed.
720 \membersection{wxArchiveOutputStream::CopyArchiveMetaData
}\label{wxarchiveoutputstreamcopyarchivemetadata
}
722 \func{bool
}{CopyArchiveMetaData
}{\param{wxArchiveInputStream\&
}{stream
}}
724 Some archive formats have additional meta-data that applies to the archive
725 as a whole. For example in the case of zip there is a comment, which
726 is stored at the end of the zip file. CopyArchiveMetaData() can be used
727 to transfer such information when writing a modified copy of an archive.
729 Since the position of the meta-data can vary between the various archive
730 formats, it is best to call CopyArchiveMetaData() before transferring
731 the entries. The
\helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
732 will then hold on to the meta-data and write it at the correct point in
735 When the input archive is being read from a non-seekable stream, the
736 meta-data may not be available when CopyArchiveMetaData() is called,
737 in which case the two streams set up a link and transfer the data
738 when it becomes available.
741 \membersection{wxArchiveOutputStream::CopyEntry
}\label{wxarchiveoutputstreamcopyentry
}
743 \func{bool
}{CopyEntry
}{\param{wxArchiveEntry*
}{entry
},
\param{wxArchiveInputStream\&
}{stream
}}
745 Takes ownership of
{\it entry
} and uses it to create a new entry in the
746 archive.
{\it entry
} is then opened in the input stream
{\it stream
}
747 and its contents copied to this stream.
749 For archive types which compress entry data, CopyEntry() is likely to be
750 much more efficient than transferring the data using Read() and Write()
751 since it will copy them without decompressing and recompressing them.
753 {\it entry
} must be from the same archive file that
{\it stream
} is
754 accessing. For non-seekable streams,
{\it entry
} must also be the last
755 thing read from
{\it stream
}.
758 \membersection{wxArchiveOutputStream::PutNextDirEntry
}\label{wxarchiveoutputstreamputnextdirentry
}
760 \func{bool
}{PutNextDirEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
}}
762 Create a new directory entry
763 (see
\helpref{wxArchiveEntry::IsDir()
}{wxarchiveentryisdir
})
764 with the given name and timestamp.
766 \helpref{PutNextEntry()
}{wxarchiveoutputstreamputnextentry
} can
767 also be used to create directory entries, by supplying a name with
768 a trailing path separator.
771 \membersection{wxArchiveOutputStream::PutNextEntry
}\label{wxarchiveoutputstreamputnextentry
}
773 \func{bool
}{PutNextEntry
}{\param{wxArchiveEntry*
}{entry
}}
775 Takes ownership of
{\it entry
} and uses it to create a new entry in
776 the archive. The entry's data can then be written by writing to this
777 wxArchiveOutputStream.
779 \func{bool
}{PutNextEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{off
\_t }{size = wxInvalidOffset
}}
781 Create a new entry with the given name, timestamp and size. The entry's
782 data can then be written by writing to this wxArchiveOutputStream.