An abstract base class which serves as a common interface to archive entry classes such as wxZipEntry. These hold the meta-data (filename, timestamp, etc.), for entries in archive files such as zips and tars.
Derived from
Include files
<wx/archive.h>
See also
Archive formats such as zip
Generic archive programming
wxArchiveInputStream
wxArchiveOutputStream
wxArchiveNotifier
Non-seekable streams
This information applies only when reading archives from non-seekable streams. When the stream is seekable GetNextEntry() returns a fully populated wxArchiveEntry. See 'Archives on non-seekable streams' for more information.
For generic programming, when the worst case must be assumed, you can rely on all the fields of wxArchiveEntry being fully populated when GetNextEntry() returns, with the the following exceptions:
GetSize() | Guaranteed to be available after the entry has been read to Eof(), or CloseEntry() has been called |
IsReadOnly() | Guaranteed to be available after the end of the archive has been reached, i.e. after GetNextEntry() returns NULL and Eof() is true |
Members
wxArchiveEntry::Clone
wxArchiveEntry::Get/SetDateTime
wxArchiveEntry::GetInternalFormat
wxArchiveEntry::GetInternalName
wxArchiveEntry::Get/SetName
wxArchiveEntry::GetOffset
wxArchiveEntry::Get/SetSize
wxArchiveEntry::IsDir/SetIsDir
wxArchiveEntry::IsReadOnly/SetIsReadOnly
wxArchiveEntry::Set/UnsetNotifier
wxArchiveEntry* Clone() const
Returns a copy of this entry object.
wxDateTime GetDateTime() const
void SetDateTime(const wxDateTime& dt)
The entry's timestamp.
wxPathFormat GetInternalFormat() const
Returns the path format used internally within the archive to store filenames.
wxString GetInternalName() const
Returns the entry's filename in the internal format used within the archive. The name can include directory components, i.e. it can be a full path.
The names of directory entries are returned without any trailing path separator. This gives a canonical name that can be used in comparisons.
See also
Looking up an archive entry by name
wxString GetName(wxPathFormat format = wxPATH_NATIVE) const
void SetName(const wxString& name, wxPathFormat format = wxPATH_NATIVE)
The entry's name, by default in the native format. The name can include directory components, i.e. it can be a full path.
If this is a directory entry, (i.e. if IsDir() is true) then GetName() returns the name with a trailing path separator.
Similarly, setting a name with a trailing path separator sets IsDir().
off_t GetOffset() const
Returns a numeric value unique to the entry within the archive.
off_t GetSize() const
void SetSize(off_t size)
The size of the entry's data in bytes.
bool IsDir() const
void SetIsDir(bool isDir = true)
True if this is a directory entry.
Directory entries are entries with no data, which are used to store the meta-data of directories. They also make it possible for completely empty directories to be stored.
The names of entries within an archive can be complete paths, and unarchivers typically create whatever directories are necessary as they restore files, even if the archive contains no explicit directory entries.
bool IsReadOnly() const
void SetIsReadOnly(bool isReadOnly = true)
True if the entry is a read-only file.
void SetNotifier(wxArchiveNotifier& notifier)
void UnsetNotifier()
Sets the notifier for this entry. Whenever the wxArchiveInputStream updates this entry, it will then invoke the associated notifier's OnEntryUpdated method.
Setting a notifier is not usually necessary. It is used to handle certain cases when modifying an archive in a pipeline (i.e. between non-seekable streams).
See also
Archives on non-seekable streams
wxArchiveNotifier