Public Member Functions | Static Public Member Functions

# wxTarEntry Class Reference
[Archive support, Streams]

`#include <wx/tarstrm.h>`

Inheritance diagram for wxTarEntry:
[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.
wxTarEntry & | operator 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.
## 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

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.

|  | [ top ]