zipstrm.tex
来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 714 行 · 第 1/2 页
TEX
714 行
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: 1.10 $ 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}}
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.
\func{}{wxZipInputStream}{\param{const wxString\& }{archive}, \param{const wxString\& }{file}}
Compatibility constructor.
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: 1.10 $ 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: 1.10 $ 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}}
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.
In a Unicode build the third parameter {\tt conv} is used to translate
the filename and comment fields to Unicode. 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 successfully.
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.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?