wxTarEntry Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
wxTarEntry Class Reference
Class List by Category » Archive support | Class List by Category » Streams

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/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= (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
wxArchiveEntry * | Clone () 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 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).
wxObjectRefData * | GetRefData () 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 wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it.
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.
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data.

## Constructor & Destructor Documentation

## ◆ wxTarEntry() [1/2]

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() [2/2]

wxTarEntry::wxTarEntry | ( | const wxTarEntry & | entry | ) |

Copy constructor.

## Member Function Documentation

## ◆ GetAccessTime()

wxDateTime wxTarEntry::GetAccessTime | ( |  | ) | const

Gets/sets the entry's access time stamp.

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

## ◆ GetCreateTime()

wxDateTime wxTarEntry::GetCreateTime | ( |  | ) | const

The entry's creation time stamp.

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

## ◆ GetDevMajor()

int wxTarEntry::GetDevMajor | ( |  | ) | const

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

## ◆ GetDevMinor()

int wxTarEntry::GetDevMinor | ( |  | ) | const

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

## ◆ GetGroupId()

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.

## ◆ GetGroupName()

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.

## ◆ GetInternalName() [1/2]

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.

## ◆ GetInternalName() [2/2]

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

## ◆ GetLinkName()

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.

## ◆ GetMode()

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.

## ◆ GetSize()

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.

## ◆ GetTypeFlag()

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.

## ◆ GetUserId()

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.

## ◆ GetUserName()

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.

## ◆ operator=()

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

Assignment operator.

## ◆ SetAccessTime()

void wxTarEntry::SetAccessTime | ( | const wxDateTime & | dt | ) |

Gets/sets the entry's access time stamp.

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

## ◆ SetCreateTime()

void wxTarEntry::SetCreateTime | ( | const wxDateTime & | dt | ) |

The entry's creation time stamp.

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

## ◆ SetDevMajor()

void wxTarEntry::SetDevMajor | ( | int | dev | ) |

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

## ◆ SetDevMinor()

void wxTarEntry::SetDevMinor | ( | int | dev | ) |

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

## ◆ SetGroupId()

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.

## ◆ SetGroupName()

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.

## ◆ SetLinkName()

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.

## ◆ SetMode()

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.

## ◆ SetSize()

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.

## ◆ SetTypeFlag()

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.

## ◆ SetUserId()

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.

## ◆ SetUserName()

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.