📄 zipstrm.tex
字号:
\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} updatesthis entry, it will then invoke the associatednotifier's \helpref{OnEntryUpdated}{wxzipnotifieronentryupdated}method.Setting a notifier is not usually necessary. It is used to handlecertain cases when modifying an zip in a pipeline (i.e. betweennon-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 towxZIP\_SYSTEM\_MSDOS. Set it to wxZIP\_SYSTEM\_UNIX in order to beable 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: 1.13 $ 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-datafor the next entry in the zip (and gives away ownership). Reading fromthe wxZipInputStream then returns the entry's data. Eof() becomes trueafter 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, andwxZipInputStream::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} isused to translate the filename and comment fields into Unicode. It hasno effect on the stream's data.If the parent stream is passed as a pointer then the new filter streamtakes 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 isswitched 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 ofthe 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 zipfrom a non-seekable stream, it returns the empty string until theend of the zip has been reached, i.e. when GetNextEntry() returnsNULL.\membersection{wxZipInputStream::GetNextEntry}\label{wxzipinputstreamgetnextentry}\func{wxZipEntry*}{GetNextEntry}{\void}Closes the current entry if one is open, then reads the meta-data forthe 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 inthe zip. For zips on non-seekable streams returns the number of entriesreturned 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 specifiedby the {\it entry} object.{\it entry} should be from the same zip file, and the zip shouldbe on a seekable stream.\wxheading{See also}\helpref{Looking up an archive entry by name}{wxarcbyname}%% automatically generated by HelpGen $Revision: 1.13 $ 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 wxZipEntryobjects, using \helpref{wxZipEntry::SetNotifier()}{wxzipentrynotifier}.Setting a notifier is not usually necessary. It is used to handlecertain cases when modifying an zip in a pipeline (i.e. betweennon-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 whenan \helpref{wxZipEntry}{wxzipentry} object changes.%% automatically generated by HelpGen $Revision: 1.13 $ 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 createa new entry in the output zip, then the entry's data is written to thewxZipOutputStream. Another call to PutNextEntry() closes the currententry 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 valuewhich currently is equivalent to 6.If the parent stream is passed as a pointer then the new filter streamtakes 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 translatethe filename and comment fields to an 8-bit encoding. It has no effect on thestream's data.\membersection{wxZipOutputStream::\destruct{wxZipOutputStream}}\label{wxzipoutputstreamdtor}\func{}{\destruct{wxZipOutputStream}}{\void}The destructor calls \helpref{Close()}{wxzipoutputstreamclose} to finishwriting 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 newentry is created with \helpref{CopyEntry()}{wxzipoutputstreamcopyentry}or \helpref{PutNextEntry()}{wxzipoutputstreamputnextentry}, orwhen 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 entryin the zip. {\tt entry} is then opened in {\tt inputStream} and its contentscopied to this stream.CopyEntry() is much more efficient than transferring the data usingRead() and Write() since it will copy them without decompressing andrecompressing them.For zips on seekable streams, {\tt entry} must be from the same zip fileas {\tt stream}. For non-seekable streams, {\tt entry} must also be thelast 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 iscreated. It can be a value between 0 and 9 or -1 to use the default valuewhich 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} canalso be used to create directory entries, by supplying a name witha 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 entryin 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 thezip.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -