wxTarEntry Class Reference
[Archive supportStreams]

#include <wx/tarstrm.h>

Inheritance diagram for wxTarEntry:
Inheritance graph
[legend]

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)
 Gets/sets the entry's access 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
 Gets/sets the entry's access time stamp.
void SetDevMajor (int dev)
 Gets/sets the entry's access time stamp.
void SetDevMinor (int dev)
 Gets/sets the entry's access time stamp.
int GetGroupId () const
 The user ID and group ID that has permissions (see wxTarEntry::GetMode()) over this entry.
int GetUserId () const
 Gets/sets the entry's access time stamp.
void SetGroupId (int id)
 Gets/sets the entry's access time stamp.
void SetUserId (int id)
 Gets/sets the entry's access time stamp.
wxString GetGroupName () const
 The names of the user and group that has permissions (see wxTarEntry::GetMode()) over this entry.
wxString GetUserName () const
 Gets/sets the entry's access time stamp.
void SetGroupName (const wxString &group)
 Gets/sets the entry's access time stamp.
void SetUserName (const wxString &user)
 Gets/sets the entry's access time stamp.
wxString GetLinkName () const
 The filename of a previous entry in the tar that this entry is a link to.
void SetLinkName (const wxString &link)
 Gets/sets the entry's access time stamp.
int GetMode () const
 UNIX permission bits for this entry.
void SetMode (int mode)
 Gets/sets the entry's access time stamp.
void SetSize (wxFileOffset size)
 The size of the entry's data in bytes.
wxFileOffset GetSize () const
 Gets/sets the entry's access time stamp.
int GetTypeFlag () const
 Returns/Sets the type of the entry as a wxTarType value.
void SetTypeFlag (int type)
 Gets/sets the entry's access time stamp.

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.

List of all members.


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

Gets/sets the entry's access time stamp.

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

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.

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

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]

Gets/sets the entry's access time stamp.

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

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

Gets/sets the entry's access time stamp.

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

wxString wxTarEntry::GetUserName (  )  const

Gets/sets the entry's access time stamp.

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

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  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetDevMajor ( int  dev  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetDevMinor ( int  dev  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetGroupId ( int  id  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetGroupName ( const wxString group  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetLinkName ( const wxString link  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetMode ( int  mode  ) 

Gets/sets the entry's access time stamp.

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

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  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetUserId ( int  id  ) 

Gets/sets the entry's access time stamp.

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

void wxTarEntry::SetUserName ( const wxString user  ) 

Gets/sets the entry's access time stamp.

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

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]