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
}
36 \helpref{wxBase
}{librarieslist
}
38 \wxheading{Data structures
}
41 enum wxStreamProtocolType
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
53 \helpref{Archive formats such as zip
}{wxarc
}\\
54 \helpref{Generic archive programming
}{wxarcgeneric
}\\
55 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
56 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}\\
57 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}\\
58 \helpref{wxFilterClassFactory
}{wxfilterclassfactory
}
60 \latexignore{\rtfignore{\wxheading{Members
}}}
63 \membersection{wxArchiveClassFactory::Get/SetConv
}\label{wxarchiveclassfactoryconv
}
65 \constfunc{wxMBConv\&
}{GetConv
}{\void}
67 \func{void
}{SetConv
}{\param{wxMBConv\&
}{conv
}}
69 The
\helpref{wxMBConv
}{wxmbconv
} object that the created streams
70 will use when translating meta-data. The initial default, set by the
71 constructor, is wxConvLocal.
74 \membersection{wxArchiveClassFactory::CanHandle
}\label{wxarchiveclassfactorycanhandle
}
76 \constfunc{bool
}{CanHandle
}{\param{const wxChar*
}{protocol
},
\param{wxStreamProtocolType
}{type = wxSTREAM
\_PROTOCOL}}
78 Returns true if this factory can handle the given protocol, MIME type
81 When using wxSTREAM
\_FILEEXT for the second parameter, the first parameter
82 can be a complete filename rather than just an extension.
85 \membersection{wxArchiveClassFactory::Find
}\label{wxarchiveclassfactoryfind
}
87 \func{static const wxArchiveClassFactory*
}{Find
}{\param{const wxChar*
}{protocol
},
\param{wxStreamProtocolType
}{type = wxSTREAM
\_PROTOCOL}}
89 A static member that finds a factory that can handle a given protocol, MIME
90 type or file extension. Returns a pointer to the class factory if found, or
91 NULL otherwise. It does not give away ownership of the factory.
93 When using wxSTREAM
\_FILEEXT for the second parameter, the first parameter
94 can be a complete filename rather than just an extension.
97 \membersection{wxArchiveClassFactory::GetFirst/GetNext
}\label{wxarchiveclassfactorygetfirst
}
99 \func{static const wxArchiveClassFactory*
}{GetFirst
}{\void}
101 \constfunc{const wxArchiveClassFactory*
}{GetNext
}{\void}
103 GetFirst and GetNext can be used to enumerate the available factories.
105 For example, to list them:
109 const wxArchiveClassFactory *factory = wxArchiveClassFactory::GetFirst();
112 list << factory->GetProtocol() << _T("
\n");
113 factory = factory->GetNext();
118 GetFirst()/GetNext() return a pointer to a factory or NULL if no more
119 are available. They do not give away ownership of the factory.
122 \membersection{wxArchiveClassFactory::GetInternalName
}\label{wxarchiveclassfactorygetinternalname
}
124 \constfunc{wxString
}{GetInternalName
}{\param{const wxString\&
}{name
},
\param{wxPathFormat
}{format = wxPATH
\_NATIVE}}
126 Calls the static GetInternalName() function for the archive entry type,
128 \helpref{wxZipEntry::GetInternalName()
}{wxzipentrygetinternalname
}.
131 \membersection{wxArchiveClassFactory::GetProtocol
}\label{wxarchiveclassfactorygetprotocol
}
133 \constfunc{wxString
}{GetProtocol
}{\void}
135 Returns the wxFileSystem protocol supported by this factory. Equivalent
136 to wxString
(*GetProtcols()).
139 \membersection{wxArchiveClassFactory::GetProtocols}\label{wxarchiveclassfactorygetprotocols}
141 \constfunc{const wxChar * const*}{GetProtocols}{\param{wxStreamProtocolType }{type = wxSTREAM\_PROTOCOL}}
143 Returns the protocols, MIME types or file extensions supported by this
144 factory, as an array of null terminated strings. It does not give away
145 ownership of the array or strings.
147 For example, to list the file extensions a factory supports:
151 const wxChar *const *p;
153 for (p = factory->GetProtocols(wxSTREAM_FILEEXT); *p; p++)
154 list << *p << _T("\n");
159 \membersection{wxArchiveClassFactory::NewEntry}\label{wxarchiveclassfactorynewentry}
161 \constfunc{wxArchiveEntry*}{NewEntry}{\void}
163 Create a new \helpref{wxArchiveEntry}{wxarchiveentry} object of the
167 \membersection{wxArchiveClassFactory::NewStream}\label{wxarchiveclassfactorynewstream}
169 \constfunc{wxArchiveInputStream*}{NewStream}{\param{wxInputStream\& }{stream}}
171 \constfunc{wxArchiveOutputStream*}{NewStream}{\param{wxOutputStream\& }{stream}}
173 \constfunc{wxArchiveInputStream*}{NewStream}{\param{wxInputStream* }{stream}}
175 \constfunc{wxArchiveOutputStream*}{NewStream}{\param{wxOutputStream* }{stream}}
177 Create a new input or output stream to read or write an archive.
179 If the parent stream is passed as a pointer then the new archive stream
180 takes ownership of it. If it is passed by reference then it does not.
183 \membersection{wxArchiveClassFactory::PushFront}\label{wxarchiveclassfactorypushfront}
185 \func{void}{PushFront}{\void}
187 Adds this class factory to the list returned
188 by \helpref{GetFirst()/GetNext()}{wxarchiveclassfactorygetfirst}.
190 It is not necessary to do this to use the archive streams. It is usually
191 used when implementing streams, typically the implementation will
192 add a static instance of its factory class.
194 It can also be used to change the order of a factory already in the list,
195 bringing it to the front. This isn't a thread safe operation
196 so can't be done when other threads are running that will be using the list.
198 The list does not take ownership of the factory.
201 \membersection{wxArchiveClassFactory::Remove}\label{wxarchiveclassfactoryremove}
203 \func{void}{Remove}{\void}
205 Removes this class factory from the list returned
206 by \helpref{GetFirst()/GetNext()}{wxarchiveclassfactorygetfirst}.
208 Removing from the list isn't a thread safe operation
209 so can't be done when other threads are running that will be using the list.
211 The list does not own the factories, so removing a factory does not delete it.
215 % automatically generated by HelpGen $Revision$ from
216 % wx/archive.h at 16/Sep/04 12:19:29
219 \section{\class{wxArchiveEntry}}\label{wxarchiveentry}
221 An abstract base class which serves as a common interface to
222 archive entry classes such as \helpref{wxZipEntry}{wxzipentry}.
223 These hold the meta-data (filename, timestamp, etc.), for entries
224 in archive files such as zips and tars.
226 \wxheading{Derived from}
228 \helpref{wxObject}{wxobject}
230 \wxheading{Include files}
236 \helpref{wxBase}{librarieslist}
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}
246 \wxheading{Non-seekable streams}
248 This information applies only when reading archives from non-seekable
249 streams. When the stream is
250 seekable \helpref{GetNextEntry()}{wxarchiveinputstreamgetnextentry}
251 returns a fully populated \helpref{wxArchiveEntry}{wxarchiveentry}.
252 See '\helpref{Archives on non-seekable streams}{wxarcnoseek}' for
255 For generic programming, when the worst case must be assumed, you can
256 rely on all the fields of wxArchiveEntry being fully populated when
257 GetNextEntry() returns, with the the following exceptions:
259 \begin{twocollist}\twocolwidtha{3cm}
260 \twocolitem{\helpref{GetSize()}{wxarchiveentrysize}}{Guaranteed to be
261 available after the entry has been read to \helpref{Eof()}{wxinputstreameof},
262 or \helpref{CloseEntry()}{wxarchiveinputstreamcloseentry} has been called}
263 \twocolitem{\helpref{IsReadOnly()}{wxarchiveentryisreadonly}}{Guaranteed to
264 be available after the end of the archive has been reached, i.e. after
265 GetNextEntry() returns NULL and Eof() is true}
269 \latexignore{\rtfignore{\wxheading{Members}}}
272 \membersection{wxArchiveEntry::Clone}\label{wxarchiveentryclone}
274 \constfunc{wxArchiveEntry*}{Clone}{\void}
276 Returns a copy of this entry object.
279 \membersection{wxArchiveEntry::Get/SetDateTime}\label{wxarchiveentrydatetime}
281 \constfunc{wxDateTime}{GetDateTime}{\void}
283 \func{void}{SetDateTime}{\param{const wxDateTime\& }{dt}}
285 The entry's timestamp.
288 \membersection{wxArchiveEntry::GetInternalFormat}\label{wxarchiveentrygetinternalformat}
290 \constfunc{wxPathFormat}{GetInternalFormat}{\void}
292 Returns the path format used internally within the archive to store
296 \membersection{wxArchiveEntry::GetInternalName}\label{wxarchiveentrygetinternalname}
298 \constfunc{wxString}{GetInternalName}{\void}
300 Returns the entry's filename in the internal format used within the
301 archive. The name can include directory components, i.e. it can be a
304 The names of directory entries are returned without any trailing path
305 separator. This gives a canonical name that can be used in comparisons.
309 \helpref{Looking up an archive entry by name}{wxarcbyname}
312 \membersection{wxArchiveEntry::Get/SetName}\label{wxarchiveentryname}
314 \constfunc{wxString}{GetName}{\param{wxPathFormat }{format = wxPATH\_NATIVE}}
316 \func{void}{SetName}{\param{const wxString\& }{name}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
318 The entry's name, by default in the native format. The name can include
319 directory components, i.e. it can be a full path.
321 If this is a directory entry, (i.e. if \helpref{IsDir()}{wxarchiveentryisdir}
322 is true) then GetName() returns the name with a trailing path separator.
324 Similarly, setting a name with a trailing path separator sets IsDir().
327 \membersection{wxArchiveEntry::GetOffset}\label{wxarchiveentrygetoffset}
329 \constfunc{off\_t}{GetOffset}{\void}
331 Returns a numeric value unique to the entry within the archive.
334 \membersection{wxArchiveEntry::Get/SetSize}\label{wxarchiveentrysize}
336 \constfunc{off\_t}{GetSize}{\void}
338 \func{void}{SetSize}{\param{off\_t }{size}}
340 The size of the entry's data in bytes.
343 \membersection{wxArchiveEntry::IsDir/SetIsDir}\label{wxarchiveentryisdir}
345 \constfunc{bool}{IsDir}{\void}
347 \func{void}{SetIsDir}{\param{bool }{isDir = true}}
349 True if this is a directory entry.
351 Directory entries are entries with no data, which are used to store
352 the meta-data of directories. They also make it possible for completely
353 empty directories to be stored.
355 The names of entries within an archive can be complete paths, and
356 unarchivers typically create whatever directories are necessary as they
357 restore files, even if the archive contains no explicit directory entries.
360 \membersection{wxArchiveEntry::IsReadOnly/SetIsReadOnly}\label{wxarchiveentryisreadonly}
362 \constfunc{bool}{IsReadOnly}{\void}
364 \func{void}{SetIsReadOnly}{\param{bool }{isReadOnly = true}}
366 True if the entry is a read-only file.
369 \membersection{wxArchiveEntry::Set/UnsetNotifier}\label{wxarchiveentrynotifier}
371 \func{void}{SetNotifier}{\param{wxArchiveNotifier\& }{notifier}}
373 \func{void}{UnsetNotifier}{\void}
375 Sets the \helpref{notifier}{wxarchivenotifier} for this entry.
376 Whenever the \helpref{wxArchiveInputStream}{wxarchiveinputstream} updates
377 this entry, it will then invoke the associated
378 notifier's \helpref{OnEntryUpdated}{wxarchivenotifieronentryupdated}
381 Setting a notifier is not usually necessary. It is used to handle
382 certain cases when modifying an archive in a pipeline (i.e. between
383 non-seekable streams).
387 \helpref{Archives on non-seekable streams}{wxarcnoseek}\\
388 \helpref{wxArchiveNotifier}{wxarchivenotifier}
392 % automatically generated by HelpGen $Revision$ from
393 % wx/archive.h at 16/Sep/04 12:19:29
396 \section{\class{wxArchiveInputStream}}\label{wxarchiveinputstream}
398 An abstract base class which serves as a common interface to
399 archive input streams such as \helpref{wxZipInputStream}{wxzipinputstream}.
401 \helpref{GetNextEntry()}{wxarchiveinputstreamgetnextentry} returns an
402 \helpref{wxArchiveEntry}{wxarchiveentry} object containing the meta-data
403 for the next entry in the archive (and gives away ownership). Reading from
404 the wxArchiveInputStream then returns the entry's data. Eof() becomes true
405 after an attempt has been made to read past the end of the entry's data.
406 When there are no more entries, GetNextEntry() returns NULL and sets Eof().
408 \wxheading{Derived from}
410 \helpref{wxFilterInputStream}{wxfilterinputstream}\\
411 \helpref{wxInputStream}{wxinputstream}\\
412 \helpref{wxStreamBase}{wxstreambase}
414 \wxheading{Include files}
420 \helpref{wxBase}{librarieslist}
422 \wxheading{Data structures}
424 typedef wxArchiveEntry entry_type
429 \helpref{Archive formats such as zip}{wxarc}\\
430 \helpref{wxArchiveEntry}{wxarchiveentry}\\
431 \helpref{wxArchiveOutputStream}{wxarchiveoutputstream}
433 \latexignore{\rtfignore{\wxheading{Members}}}
436 \membersection{wxArchiveInputStream::CloseEntry}\label{wxarchiveinputstreamcloseentry}
438 \func{bool}{CloseEntry}{\void}
440 Closes the current entry. On a non-seekable stream reads to the end of
441 the current entry first.
444 \membersection{wxArchiveInputStream::GetNextEntry}\label{wxarchiveinputstreamgetnextentry}
446 \func{wxArchiveEntry*}{GetNextEntry}{\void}
448 Closes the current entry if one is open, then reads the meta-data for
449 the next entry and returns it in a \helpref{wxArchiveEntry}{wxarchiveentry}
450 object, giving away ownership. Reading this wxArchiveInputStream then
451 returns the entry's data.
454 \membersection{wxArchiveInputStream::OpenEntry}\label{wxarchiveinputstreamopenentry}
456 \func{bool}{OpenEntry}{\param{wxArchiveEntry\& }{entry}}
458 Closes the current entry if one is open, then opens the entry specified
459 by the \helpref{wxArchiveEntry}{wxarchiveentry} object.
461 {\it entry} must be from the same archive file that this
462 wxArchiveInputStream is reading, and it must be reading it from a
467 \helpref{Looking up an archive entry by name}{wxarcbyname}
471 % automatically generated by HelpGen $Revision$ from
472 % wx/archive.h at 16/Sep/04 12:19:29
475 \section{\class{wxArchiveIterator}}\label{wxarchiveiterator}
477 An input iterator template class that can be used to transfer an archive's
478 catalogue to a container. It is only available if wxUSE\_STL is set to 1
479 in setup.h, and the uses for it outlined below require a compiler which
480 supports member templates.
483 template <class Arc, class T = typename Arc::entry_type*>
484 class wxArchiveIterator
486 // this constructor creates an 'end of sequence' object
489 // template parameter 'Arc' should be the type of an archive input stream
490 wxArchiveIterator(Arc& arc) {
497 The first template parameter should be the type of archive input stream
498 (e.g. \helpref{wxArchiveInputStream}{wxarchiveinputstream}) and the
499 second 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*>).
503 The
{\tt <wx/archive.h>
} header defines the following typedefs:
506 typedef wxArchiveIterator<wxArchiveInputStream> wxArchiveIter;
508 typedef wxArchiveIterator<wxArchiveInputStream,
509 std::pair<wxString, wxArchiveEntry*> > wxArchivePairIter;
513 The header for any implementation of this interface should define similar
514 typedefs for its types, for example in
{\tt <wx/zipstrm.h>
} there is:
517 typedef wxArchiveIterator<wxZipInputStream> wxZipIter;
519 typedef wxArchiveIterator<wxZipInputStream,
520 std::pair<wxString, wxZipEntry*> > wxZipPairIter;
524 Transferring the catalogue of an archive
{\it arc
} to a vector
{\it cat
},
525 can then be done something like this:
528 std::vector<wxArchiveEntry*> cat((wxArchiveIter)arc, wxArchiveIter());
532 When the iterator is dereferenced, it gives away ownership of an entry
533 object. So in the above example, when you have finished with
{\it cat
}
534 you must delete the pointers it contains.
536 If you have smart pointers with normal copy semantics (i.e. not auto
\_ptr
537 or
\helpref{wxScopedPtr
}{wxscopedptr
}), then you can create an iterator
538 which uses them instead. For example, with a smart pointer class for
539 zip entries
{\it ZipEntryPtr
}:
542 typedef std::vector<ZipEntryPtr> ZipCatalog;
543 typedef wxArchiveIterator<wxZipInputStream, ZipEntryPtr> ZipIter;
544 ZipCatalog cat((ZipIter)zip, ZipIter());
548 Iterators that return std::pair objects can be used to
549 populate a std::multimap, to allow entries to be looked
550 up by name. The string is initialised using the wxArchiveEntry object's
551 \helpref{GetInternalName()
}{wxarchiveentrygetinternalname
} function.
554 typedef std::multimap<wxString, wxZipEntry*> ZipCatalog;
555 ZipCatalog cat((wxZipPairIter)zip, wxZipPairIter());
559 Note that this iterator also gives away ownership of an entry
560 object each time it is dereferenced. So in the above example, when
561 you have finished with
{\it cat
} you must delete the pointers it contains.
563 Or if you have them, a pair containing a smart pointer can be used
564 (again
{\it ZipEntryPtr
}), no worries about ownership:
567 typedef std::multimap<wxString, ZipEntryPtr> ZipCatalog;
568 typedef wxArchiveIterator<wxZipInputStream,
569 std::pair<wxString, ZipEntryPtr> > ZipPairIter;
570 ZipCatalog cat((ZipPairIter)zip, ZipPairIter());
574 \wxheading{Derived from
}
578 \wxheading{Include files
}
584 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
585 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}\\
586 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
588 \wxheading{Data structures
}
590 typedef std::input_iterator_tag iterator_category
592 typedef ptrdiff_t difference_type
597 \latexignore{\rtfignore{\wxheading{Members
}}}
600 \membersection{wxArchiveIterator::wxArchiveIterator
}\label{wxarchiveiteratorwxarchiveiterator
}
602 \func{}{wxArchiveIterator
}{\void}
604 Construct an 'end of sequence' instance.
606 \func{}{wxArchiveIterator
}{\param{Arc\&
}{arc
}}
608 Construct iterator that returns all the entries in the archive input
612 \membersection{wxArchiveIterator::operator*
}\label{wxarchiveiteratoroperatorstar
}
614 \constfunc{const T\&
}{operator*
}{\void}
616 Returns an entry object from the archive input stream, giving away
620 \membersection{wxArchiveIterator::operator++
}\label{wxarchiveiteratoroperatorincrement
}
622 \func{wxArchiveIterator\&
}{operator++
}{\void}
624 \func{wxArchiveIterator\&
}{operator++
}{\param{int
}{}}
626 Position the input iterator at the next entry in the archive input stream.
630 % automatically generated by HelpGen $Revision$ from
631 % wx/archive.h at 16/Sep/04 12:19:29
634 \section{\class{wxArchiveNotifier
}}\label{wxarchivenotifier
}
636 If you need to know when a
637 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
} updates a
638 \helpref{wxArchiveEntry
}{wxarchiveentry
} object, you can create
639 a notifier by deriving from this abstract base class, overriding
640 \helpref{OnEntryUpdated()
}{wxarchivenotifieronentryupdated
}. An instance
641 of your notifier class can then be assigned to the wxArchiveEntry object
642 using
\helpref{wxArchiveEntry::SetNotifier()
}{wxarchiveentrynotifier
}.
643 Your OnEntryUpdated() method will then be invoked whenever the input
644 stream updates the entry.
646 Setting a notifier is not usually necessary. It is used to handle
647 certain cases when modifying an archive in a pipeline (i.e. between
648 non-seekable streams).
649 See
\helpref{Archives on non-seekable streams
}{wxarcnoseek
}.
651 \wxheading{Derived from
}
655 \wxheading{Include files
}
661 \helpref{wxBase
}{librarieslist
}
665 \helpref{Archives on non-seekable streams
}{wxarcnoseek
}\\
666 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
667 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}\\
668 \helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
670 \latexignore{\rtfignore{\wxheading{Members
}}}
673 \membersection{wxArchiveNotifier::OnEntryUpdated
}\label{wxarchivenotifieronentryupdated
}
675 \func{void
}{OnEntryUpdated
}{\param{class wxArchiveEntry\&
}{entry
}}
677 This method must be overridden in your derived class.
681 % automatically generated by HelpGen $Revision$ from
682 % wx/archive.h at 16/Sep/04 12:19:29
685 \section{\class{wxArchiveOutputStream
}}\label{wxarchiveoutputstream
}
687 An abstract base class which serves as a common interface to
688 archive output streams such as
\helpref{wxZipOutputStream
}{wxzipoutputstream
}.
690 \helpref{PutNextEntry()
}{wxarchiveoutputstreamputnextentry
} is used
691 to create a new entry in the output archive, then the entry's data is
692 written to the wxArchiveOutputStream. Another call to PutNextEntry()
693 closes the current entry and begins the next.
695 \wxheading{Derived from
}
697 \helpref{wxFilterOutputStream
}{wxfilteroutputstream
}\\
698 \helpref{wxOutputStream
}{wxoutputstream
}\\
699 \helpref{wxStreamBase
}{wxstreambase
}
701 \wxheading{Include files
}
707 \helpref{wxBase
}{librarieslist
}
711 \helpref{Archive formats such as zip
}{wxarc
}\\
712 \helpref{wxArchiveEntry
}{wxarchiveentry
}\\
713 \helpref{wxArchiveInputStream
}{wxarchiveinputstream
}
715 \latexignore{\rtfignore{\wxheading{Members
}}}
718 \membersection{wxArchiveOutputStream::
\destruct{wxArchiveOutputStream
}}\label{wxarchiveoutputstreamdtor
}
720 \func{}{\destruct{wxArchiveOutputStream
}}{\void}
722 Calls
\helpref{Close()
}{wxarchiveoutputstreamclose
} if it has not already
726 \membersection{wxArchiveOutputStream::Close
}\label{wxarchiveoutputstreamclose
}
728 \func{bool
}{Close
}{\void}
730 Closes the archive, returning true if it was successfully written.
731 Called by the destructor if not called explicitly.
734 \membersection{wxArchiveOutputStream::CloseEntry
}\label{wxarchiveoutputstreamcloseentry
}
736 \func{bool
}{CloseEntry
}{\void}
738 Close the current entry. It is called implicitly whenever another new
739 entry is created with
\helpref{CopyEntry()
}{wxarchiveoutputstreamcopyentry
}
740 or
\helpref{PutNextEntry()
}{wxarchiveoutputstreamputnextentry
}, or
741 when the archive is closed.
744 \membersection{wxArchiveOutputStream::CopyArchiveMetaData
}\label{wxarchiveoutputstreamcopyarchivemetadata
}
746 \func{bool
}{CopyArchiveMetaData
}{\param{wxArchiveInputStream\&
}{stream
}}
748 Some archive formats have additional meta-data that applies to the archive
749 as a whole. For example in the case of zip there is a comment, which
750 is stored at the end of the zip file. CopyArchiveMetaData() can be used
751 to transfer such information when writing a modified copy of an archive.
753 Since the position of the meta-data can vary between the various archive
754 formats, it is best to call CopyArchiveMetaData() before transferring
755 the entries. The
\helpref{wxArchiveOutputStream
}{wxarchiveoutputstream
}
756 will then hold on to the meta-data and write it at the correct point in
759 When the input archive is being read from a non-seekable stream, the
760 meta-data may not be available when CopyArchiveMetaData() is called,
761 in which case the two streams set up a link and transfer the data
762 when it becomes available.
765 \membersection{wxArchiveOutputStream::CopyEntry
}\label{wxarchiveoutputstreamcopyentry
}
767 \func{bool
}{CopyEntry
}{\param{wxArchiveEntry*
}{entry
},
\param{wxArchiveInputStream\&
}{stream
}}
769 Takes ownership of
{\it entry
} and uses it to create a new entry in the
770 archive.
{\it entry
} is then opened in the input stream
{\it stream
}
771 and its contents copied to this stream.
773 For archive types which compress entry data, CopyEntry() is likely to be
774 much more efficient than transferring the data using Read() and Write()
775 since it will copy them without decompressing and recompressing them.
777 {\it entry
} must be from the same archive file that
{\it stream
} is
778 accessing. For non-seekable streams,
{\it entry
} must also be the last
779 thing read from
{\it stream
}.
782 \membersection{wxArchiveOutputStream::PutNextDirEntry
}\label{wxarchiveoutputstreamputnextdirentry
}
784 \func{bool
}{PutNextDirEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
}}
786 Create a new directory entry
787 (see
\helpref{wxArchiveEntry::IsDir()
}{wxarchiveentryisdir
})
788 with the given name and timestamp.
790 \helpref{PutNextEntry()
}{wxarchiveoutputstreamputnextentry
} can
791 also be used to create directory entries, by supplying a name with
792 a trailing path separator.
795 \membersection{wxArchiveOutputStream::PutNextEntry
}\label{wxarchiveoutputstreamputnextentry
}
797 \func{bool
}{PutNextEntry
}{\param{wxArchiveEntry*
}{entry
}}
799 Takes ownership of
{\it entry
} and uses it to create a new entry in
800 the archive. The entry's data can then be written by writing to this
801 wxArchiveOutputStream.
803 \func{bool
}{PutNextEntry
}{\param{const wxString\&
}{name
},
\param{const wxDateTime\&
}{dt = wxDateTime::Now()
},
\param{off
\_t }{size = wxInvalidOffset
}}
805 Create a new entry with the given name, timestamp and size. The entry's
806 data can then be written by writing to this wxArchiveOutputStream.