wxArchiveEntry Class Reference
[Archive support]

#include <wx/archive.h>

Inheritance diagram for wxArchiveEntry:

wxObject wxTarEntry wxZipEntry

List of all members.


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 the following exceptions:

Library:  wxBase

Category:  Archive support

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

Public Member Functions

wxArchiveEntryClone () const
virtual wxDateTime GetDateTime () const =0
virtual void SetDateTime (const wxDateTime &dt)=0
virtual wxString GetName (wxPathFormat format=wxPATH_NATIVE) const =0
virtual void SetName (const wxString &name, wxPathFormat format=wxPATH_NATIVE)=0
virtual wxFileOffset GetSize () const =0
virtual void SetSize (wxFileOffset size)=0
virtual wxPathFormat GetInternalFormat () const =0
virtual wxString GetInternalName () const =0
virtual wxFileOffset GetOffset () const =0
virtual bool IsDir () const =0
virtual void SetIsDir (bool isDir=true)=0
virtual bool IsReadOnly () const =0
virtual void SetIsReadOnly (bool isReadOnly=true)=0
void SetNotifier (wxArchiveNotifier &notifier)
virtual void UnsetNotifier ()

Member Function Documentation

wxArchiveEntry* wxArchiveEntry::Clone (  )  const

Returns a copy of this entry object.

Reimplemented in wxZipEntry.

virtual wxDateTime wxArchiveEntry::GetDateTime (  )  const [pure virtual]

Gets the entry's timestamp.

virtual void wxArchiveEntry::SetDateTime ( const wxDateTime dt  )  [pure virtual]

Sets the entry's timestamp.

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.

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()

virtual wxFileOffset wxArchiveEntry::GetSize (  )  const [pure virtual]

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

Implemented in wxTarEntry.

virtual void wxArchiveEntry::SetSize ( wxFileOffset  size  )  [pure virtual]

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

virtual wxPathFormat wxArchiveEntry::GetInternalFormat (  )  const [pure virtual]

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

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

virtual wxFileOffset wxArchiveEntry::GetOffset (  )  const [pure virtual]

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

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.

virtual void wxArchiveEntry::SetIsDir ( bool  isDir = true  )  [pure virtual]

Marks this entry as a directory if isDir is true. See IsDir() for more info.

virtual bool wxArchiveEntry::IsReadOnly (  )  const [pure virtual]

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

virtual void wxArchiveEntry::SetIsReadOnly ( bool  isReadOnly = true  )  [pure virtual]

Sets this entry as a read-only file.

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

virtual void wxArchiveEntry::UnsetNotifier (  )  [virtual]

Unsets the notifier eventually attached to this entry.

Reimplemented in wxZipEntry.



wxWidgets logo

[ top ]