| Version: 3.3.1

Public Member Functions | List of all members
wxArchiveEntry Class Referenceabstract
Class List by Category » Archive support | Class List by Category » Streams

`#include <wx/archive.h>`

Inheritance diagram for wxArchiveEntry:
[legend]

## Detailed Description

This is 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.

# About 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 wxArchiveInputStream::GetNextEntry() returns, with 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 nullptr and Eof() is true.

##

Library: wxBase
Category: Archive support, Streams

See also
  Archive Formats, Generic Archive Programming, wxArchiveInputStream, wxArchiveOutputStream, wxArchiveNotifier

## Public Member Functions
wxArchiveEntry * | Clone () const
| Returns a copy of this entry object. More...
virtual wxDateTime | GetDateTime () const =0
| Gets the entry's timestamp. More...
virtual void | SetDateTime (const wxDateTime &dt)=0
| Sets the entry's timestamp. More...
virtual wxString | GetName (wxPathFormat format=wxPATH_NATIVE) const =0
| Returns the entry's name, by default in the native format. More...
virtual void | SetName (const wxString &name, wxPathFormat format=wxPATH_NATIVE)=0
| Sets the entry's name. More...
virtual wxFileOffset | GetSize () const =0
| Returns the size of the entry's data in bytes. More...
virtual void | SetSize (wxFileOffset size)=0
| Sets the size of the entry's data in bytes. More...
virtual wxPathFormat | GetInternalFormat () const =0
| Returns the path format used internally within the archive to store filenames. More...
virtual wxString | GetInternalName () const =0
| Returns the entry's filename in the internal format used within the archive. More...
virtual wxFileOffset | GetOffset () const =0
| Returns a numeric value unique to the entry within the archive. More...
virtual bool | IsDir () const =0
| Returns true if this is a directory entry. More...
virtual void | SetIsDir (bool isDir=true)=0
| Marks this entry as a directory if isDir is true. More...
virtual bool | IsReadOnly () const =0
| Returns true if the entry is a read-only file. More...
virtual void | SetIsReadOnly (bool isReadOnly=true)=0
| Sets this entry as a read-only file. More...
void | SetNotifier (wxArchiveNotifier &notifier)
| Sets the notifier (see wxArchiveNotifier) for this entry. More...
virtual void | UnsetNotifier ()
| Unsets the notifier eventually attached to this entry. More...
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to nullptr the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=nullptr, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Additional Inherited Members
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data. More...

## Member Function Documentation

## ◆ Clone()

wxArchiveEntry* wxArchiveEntry::Clone | ( |  | ) | const

Returns a copy of this entry object.

## ◆ GetDateTime()

virtual wxDateTime wxArchiveEntry::GetDateTime | ( |  | ) | const
| pure virtual

Gets the entry's timestamp.

## ◆ GetInternalFormat()

virtual wxPathFormat wxArchiveEntry::GetInternalFormat | ( |  | ) | const
| pure virtual

Returns the path format used internally within the archive to store filenames.

## ◆ GetInternalName()

virtual wxString wxArchiveEntry::GetInternalName | ( |  | ) | const
| pure virtual

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

Implemented in wxZipEntry, and wxTarEntry.

## ◆ GetName()

virtual wxString wxArchiveEntry::GetName | ( | wxPathFormat | format = `wxPATH_NATIVE` | ) | const
| pure virtual

Returns 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 the returned string is the name with a trailing path separator.

## ◆ GetOffset()

virtual wxFileOffset wxArchiveEntry::GetOffset | ( |  | ) | const
| pure virtual

Returns a numeric value unique to the entry within the archive.

## ◆ GetSize()

virtual wxFileOffset wxArchiveEntry::GetSize | ( |  | ) | const
| pure virtual

Returns the size of the entry's data in bytes.

Implemented in wxTarEntry.

## ◆ IsDir()

virtual bool wxArchiveEntry::IsDir | ( |  | ) | const
| pure virtual

Returns 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.

Note
  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.

## ◆ IsReadOnly()

virtual bool wxArchiveEntry::IsReadOnly | ( |  | ) | const
| pure virtual

Returns true if the entry is a read-only file.

## ◆ SetDateTime()

virtual void wxArchiveEntry::SetDateTime | ( | const wxDateTime & | dt | ) |
| pure virtual

Sets the entry's timestamp.

## ◆ SetIsDir()

virtual void wxArchiveEntry::SetIsDir | ( | bool | isDir = `true` | ) |
| pure virtual

Marks this entry as a directory if isDir is true.

See IsDir() for more info.

## ◆ SetIsReadOnly()

virtual void wxArchiveEntry::SetIsReadOnly | ( | bool | isReadOnly = `true` | ) |
| pure virtual

Sets this entry as a read-only file.

## ◆ SetName()

virtual void wxArchiveEntry::SetName | ( | const wxString & | name,
|  | wxPathFormat | format = `wxPATH_NATIVE`
| ) |  |
| pure virtual

Sets the entry's name.

Setting a name with a trailing path separator sets IsDir().

See also
  GetName()

## ◆ SetNotifier()

void wxArchiveEntry::SetNotifier | ( | wxArchiveNotifier & | notifier | ) |

Sets the notifier (see wxArchiveNotifier) for this entry.

Whenever the wxArchiveInputStream updates this entry, it will then invoke the associated notifier's wxArchiveNotifier::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).

## ◆ SetSize()

virtual void wxArchiveEntry::SetSize | ( | wxFileOffset | size | ) |
| pure virtual

Sets the size of the entry's data in bytes.

Implemented in wxTarEntry.

## ◆ UnsetNotifier()

virtual void wxArchiveEntry::UnsetNotifier | ( |  | ) |
| virtual

Unsets the notifier eventually attached to this entry.

Reimplemented in wxZipEntry.