Version: 3.1.0
wxTarEntry Class Reference

#include <wx/tarstrm.h>

+ Inheritance diagram for wxTarEntry:

Detailed Description

Holds the meta-data for an entry in a tar.

Field availability

The tar format stores all the meta-data for an entry ahead of its data, therefore GetNextEntry() always returns a fully populated wxTarEntry object, both when reading from seekable and non-seekable streams.

Library:  wxBase
Category:  Archive support, Streams
See Also
Archive Formats, wxTarInputStream, wxTarOutputStream

Public Member Functions

 wxTarEntry (const wxString &name=wxEmptyString, const wxDateTime &dt=wxDateTime::Now(), wxFileOffset size=wxInvalidOffset)
 Constructor.
 
 wxTarEntry (const wxTarEntry &entry)
 Copy constructor.
 
wxString GetInternalName () const
 Returns the entry's filename in the internal format used within the archive.
 
wxTarEntryoperator operator= (const wxTarEntry &entry)
 Assignment operator.
 
wxDateTime GetAccessTime () const
 Gets/sets the entry's access time stamp.
 
void SetAccessTime (const wxDateTime &dt)
 Gets/sets the entry's access time stamp.
 
wxDateTime GetCreateTime () const
 The entry's creation time stamp.
 
void SetCreateTime (const wxDateTime &dt)
 The entry's creation time stamp.
 
int GetDevMajor () const
 OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.
 
int GetDevMinor () const
 OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.
 
void SetDevMajor (int dev)
 OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.
 
void SetDevMinor (int dev)
 OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.
 
int GetGroupId () const
 The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.
 
int GetUserId () const
 The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.
 
void SetGroupId (int id)
 The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.
 
void SetUserId (int id)
 The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.
 
wxString GetGroupName () const
 The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.
 
wxString GetUserName () const
 The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.
 
void SetGroupName (const wxString &group)
 The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.
 
void SetUserName (const wxString &user)
 The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.
 
wxString GetLinkName () const
 The filename of a previous entry in the tar that this entry is a link to.
 
void SetLinkName (const wxString &link)
 The filename of a previous entry in the tar that this entry is a link to.
 
int GetMode () const
 UNIX permission bits for this entry.
 
void SetMode (int mode)
 UNIX permission bits for this entry.
 
void SetSize (wxFileOffset size)
 The size of the entry's data in bytes.
 
wxFileOffset GetSize () const
 The size of the entry's data in bytes.
 
int GetTypeFlag () const
 Returns/Sets the type of the entry as a wxTarType value.
 
void SetTypeFlag (int type)
 Returns/Sets the type of the entry as a wxTarType value.
 
- Public Member Functions inherited from wxArchiveEntry
wxArchiveEntryClone () const
 Returns a copy of this entry object.
 
virtual wxDateTime GetDateTime () const =0
 Gets the entry's timestamp.
 
virtual void SetDateTime (const wxDateTime &dt)=0
 Sets the entry's timestamp.
 
virtual wxString GetName (wxPathFormat format=wxPATH_NATIVE) const =0
 Returns the entry's name, by default in the native format.
 
virtual void SetName (const wxString &name, wxPathFormat format=wxPATH_NATIVE)=0
 Sets the entry's name.
 
virtual wxPathFormat GetInternalFormat () const =0
 Returns the path format used internally within the archive to store filenames.
 
virtual wxFileOffset GetOffset () const =0
 Returns a numeric value unique to the entry within the archive.
 
virtual bool IsDir () const =0
 Returns true if this is a directory entry.
 
virtual void SetIsDir (bool isDir=true)=0
 Marks this entry as a directory if isDir is true.
 
virtual bool IsReadOnly () const =0
 Returns true if the entry is a read-only file.
 
virtual void SetIsReadOnly (bool isReadOnly=true)=0
 Sets this entry as a read-only file.
 
void SetNotifier (wxArchiveNotifier &notifier)
 Sets the notifier (see wxArchiveNotifier) for this entry.
 
virtual void UnsetNotifier ()
 Unsets the notifier eventually attached to this entry.
 
- Public Member Functions inherited from wxObject
 wxObject ()
 Default ctor; initializes to NULL the internal reference data.
 
 wxObject (const wxObject &other)
 Copy ctor.
 
virtual ~wxObject ()
 Destructor.
 
virtual wxClassInfoGetClassInfo () const
 This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
 
wxObjectRefDataGetRefData () const
 Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
 
bool IsKindOf (const wxClassInfo *info) const
 Determines whether this class is a subclass of (or the same class as) the given class.
 
bool IsSameAs (const wxObject &obj) const
 Returns true if this object has the same data pointer as obj.
 
void Ref (const wxObject &clone)
 Makes this object refer to the data in clone.
 
void SetRefData (wxObjectRefData *data)
 Sets the wxObject::m_refData pointer.
 
void UnRef ()
 Decrements the reference count in the associated data, and if it is zero, deletes the data.
 
void UnShare ()
 This is the same of AllocExclusive() but this method is public.
 
void operator delete (void *buf)
 The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
 
void * operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
 The new operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
 

Static Public Member Functions

static wxString GetInternalName (const wxString &name, wxPathFormat format=wxPATH_NATIVE, bool *pIsDir=NULL)
 A static member that translates a filename into the internal format used within the archive.
 

Additional Inherited Members

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

Constructor & Destructor Documentation

wxTarEntry::wxTarEntry ( const wxString name = wxEmptyString,
const wxDateTime dt = wxDateTime::Now(),
wxFileOffset  size = wxInvalidOffset 
)

Constructor.

The tar archive format stores the entry's size ahead of the entry's data. Therefore when creating an archive on a non-seekable stream it is necessary to supply the correct size when each entry is created.

wxTarEntry::wxTarEntry ( const wxTarEntry entry)

Copy constructor.

Member Function Documentation

wxDateTime wxTarEntry::GetAccessTime ( ) const

Gets/sets the entry's access time stamp.

See also wxArchiveEntry::GetDateTime() and wxArchiveEntry::SetDateTime().

wxDateTime wxTarEntry::GetCreateTime ( ) const

The entry's creation time stamp.

See also wxArchiveEntry::GetDateTime() and wxArchiveEntry::SetDateTime().

int wxTarEntry::GetDevMajor ( ) const

OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.

int wxTarEntry::GetDevMinor ( ) const

OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.

int wxTarEntry::GetGroupId ( ) const

The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.

These values aren't usually useful unless the file will only be restored to the same system it originated from. wxTarEntry::GetGroupName() and wxTarEntry::GetUserName() can be used instead.

wxString wxTarEntry::GetGroupName ( ) const

The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.

These are not present in very old tars.

wxString wxTarEntry::GetInternalName ( ) const
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.

Implements wxArchiveEntry.

static wxString wxTarEntry::GetInternalName ( const wxString name,
wxPathFormat  format = wxPATH_NATIVE,
bool *  pIsDir = NULL 
)
static

A static member that translates a filename into the internal format used within the archive.

If the third parameter is provided, the bool pointed to is set to indicate whether the name looks like a directory name (i.e. has a trailing path separator).

wxString wxTarEntry::GetLinkName ( ) const

The filename of a previous entry in the tar that this entry is a link to.

Only meaningful when wxTarEntry::GetTypeFlag() is set to wxTAR_LNKTYPE or wxTAR_SYMTYPE.

int wxTarEntry::GetMode ( ) const

UNIX permission bits for this entry.

Giving read, write and execute permissions to the file's user and group (see GetGroupName() and GetUserName()) and to others.

The integer is one or more wxPosixPermissions flags OR-combined.

wxFileOffset wxTarEntry::GetSize ( ) const
virtual

The size of the entry's data in bytes.

The tar archive format stores the entry's size ahead of the entry's data. Therefore when creating an archive on a non-seekable stream it is necessary to supply the correct size when each entry is created.

For seekable streams this is not necessary as wxTarOutputStream will attempt to seek back and fix the entry's header when the entry is closed, though it is still more efficient if the size is given beforehand.

Implements wxArchiveEntry.

int wxTarEntry::GetTypeFlag ( ) const

Returns/Sets the type of the entry as a wxTarType value.

When creating archives use only one of wxTarType values. When reading archives, GetTypeFlag() may return a value which does not match any value of wxTarType; in this case the returned value should be treated as wxTAR_REGTYPE.

int wxTarEntry::GetUserId ( ) const

The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.

These values aren't usually useful unless the file will only be restored to the same system it originated from. wxTarEntry::GetGroupName() and wxTarEntry::GetUserName() can be used instead.

wxString wxTarEntry::GetUserName ( ) const

The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.

These are not present in very old tars.

wxTarEntry& wxTarEntry::operator operator= ( const wxTarEntry entry)

Assignment operator.

void wxTarEntry::SetAccessTime ( const wxDateTime dt)

Gets/sets the entry's access time stamp.

See also wxArchiveEntry::GetDateTime() and wxArchiveEntry::SetDateTime().

void wxTarEntry::SetCreateTime ( const wxDateTime dt)

The entry's creation time stamp.

See also wxArchiveEntry::GetDateTime() and wxArchiveEntry::SetDateTime().

void wxTarEntry::SetDevMajor ( int  dev)

OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.

void wxTarEntry::SetDevMinor ( int  dev)

OS specific IDs defining a device; these are only meaningful when wxTarEntry::GetTypeFlag() is wxTAR_CHRTYPE or wxTAR_BLKTYPE.

void wxTarEntry::SetGroupId ( int  id)

The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.

These values aren't usually useful unless the file will only be restored to the same system it originated from. wxTarEntry::GetGroupName() and wxTarEntry::GetUserName() can be used instead.

void wxTarEntry::SetGroupName ( const wxString group)

The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.

These are not present in very old tars.

void wxTarEntry::SetLinkName ( const wxString link)

The filename of a previous entry in the tar that this entry is a link to.

Only meaningful when wxTarEntry::GetTypeFlag() is set to wxTAR_LNKTYPE or wxTAR_SYMTYPE.

void wxTarEntry::SetMode ( int  mode)

UNIX permission bits for this entry.

Giving read, write and execute permissions to the file's user and group (see GetGroupName() and GetUserName()) and to others.

The integer is one or more wxPosixPermissions flags OR-combined.

void wxTarEntry::SetSize ( wxFileOffset  size)
virtual

The size of the entry's data in bytes.

The tar archive format stores the entry's size ahead of the entry's data. Therefore when creating an archive on a non-seekable stream it is necessary to supply the correct size when each entry is created.

For seekable streams this is not necessary as wxTarOutputStream will attempt to seek back and fix the entry's header when the entry is closed, though it is still more efficient if the size is given beforehand.

Implements wxArchiveEntry.

void wxTarEntry::SetTypeFlag ( int  type)

Returns/Sets the type of the entry as a wxTarType value.

When creating archives use only one of wxTarType values. When reading archives, GetTypeFlag() may return a value which does not match any value of wxTarType; in this case the returned value should be treated as wxTAR_REGTYPE.

void wxTarEntry::SetUserId ( int  id)

The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.

These values aren't usually useful unless the file will only be restored to the same system it originated from. wxTarEntry::GetGroupName() and wxTarEntry::GetUserName() can be used instead.

void wxTarEntry::SetUserName ( const wxString user)

The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.

These are not present in very old tars.