Fingerprint_Card
Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.Tar.TarEntry Class Reference

This class represents an entry in a Tar archive. It consists of the entry's header, as well as the entry's File. Entries can be instantiated in one of three ways, depending on how they are to be used. More...

Inheritance diagram for ICSharpCode.SharpZipLib.Tar.TarEntry:
Collaboration diagram for ICSharpCode.SharpZipLib.Tar.TarEntry:

Public Member Functions

 TarEntry (byte[] headerBuffer)
 Construct an entry from an archive's header bytes. File is set to null.
 TarEntry (TarHeader header)
 Construct a TarEntry using the header header provided.
object Clone ()
 Clone this tar entry.
override bool Equals (object obj)
 Determine if the two entries are equal. Equality is determined by the header names being equal.
override int GetHashCode ()
 Derive a Hash value for the current Object
bool IsDescendent (TarEntry toTest)
 Determine if the given entry is a descendant of this entry. Descendancy is determined by the name of the descendant starting with this entry's name.
void SetIds (int userId, int groupId)
 Convenience method to set this entry's group and user ids.
void SetNames (string userName, string groupName)
 Convenience method to set this entry's group and user names.
void GetFileTarHeader (TarHeader header, string file)
 Fill in a TarHeader with information from a File.
TarEntry[] GetDirectoryEntries ()
 Get entries for all files present in this entries directory. If this entry doesnt represent a directory zero entries are returned.
void WriteEntryHeader (byte[] outBuffer)
 Write an entry's header information to a header buffer.

Static Public Member Functions

static TarEntry CreateTarEntry (string name)
 Construct an entry with only a name name. This allows the programmer to construct the entry's header "by hand".
static TarEntry CreateEntryFromFile (string fileName)
 Construct an entry for a file. File is set to file, and the header is constructed from information from the file.
static void AdjustEntryName (byte[] buffer, string newName)
 Convenience method that will modify an entry's name directly in place in an entry header buffer byte array.
static void NameTarHeader (TarHeader header, string name)
 Fill in a TarHeader given only the entry's name.

Properties

TarHeader TarHeader [get]
 Get this entry's header.
string Name [get, set]
 Get/Set this entry's name.
int UserId [get, set]
 Get/set this entry's user id.
int GroupId [get, set]
 Get/set this entry's group id.
string UserName [get, set]
 Get/set this entry's user name.
string GroupName [get, set]
 Get/set this entry's group name.
DateTime ModTime [get, set]
 Get/Set the modification time for this entry.
string File [get]
 Get this entry's file.
long Size [get, set]
 Get/set this entry's recorded file size.
bool IsDirectory [get]
 Return true if this entry represents a directory, false otherwise.

Private Member Functions

 TarEntry ()
 Initialise a default instance of TarEntry.

Private Attributes

string file
 The name of the file this entry represents or null if the entry is not based on a file.
TarHeader header
 The entry's header information.

Detailed Description

This class represents an entry in a Tar archive. It consists of the entry's header, as well as the entry's File. Entries can be instantiated in one of three ways, depending on how they are to be used.

TarEntries that are created from the header bytes read from an archive are instantiated with the TarEntry( byte[] ) constructor. These entries will be used when extracting from or listing the contents of an archive. These entries have their header filled in using the header bytes. They also set the File to null, since they reference an archive entry not a file.

TarEntries that are created from files that are to be written into an archive are instantiated with the CreateEntryFromFile(string) pseudo constructor. These entries have their header filled in using the File's information. They also keep a reference to the File for convenience when writing entries.

Finally, TarEntries can be constructed from nothing but a name. This allows the programmer to construct the entry by hand, for instance when only an InputStream is available for writing to the archive, and the header information is constructed from other information. In this case the header fields are set to defaults and the File is set to null.

TarHeader

Constructor & Destructor Documentation

◆ TarEntry() [1/3]

ICSharpCode.SharpZipLib.Tar.TarEntry.TarEntry ( )
private

Initialise a default instance of TarEntry.

Here is the caller graph for this function:

◆ TarEntry() [2/3]

ICSharpCode.SharpZipLib.Tar.TarEntry.TarEntry ( byte[] headerBuffer)

Construct an entry from an archive's header bytes. File is set to null.

Parameters
headerBufferThe header bytes from a tar archive entry.

◆ TarEntry() [3/3]

ICSharpCode.SharpZipLib.Tar.TarEntry.TarEntry ( TarHeader header)

Construct a TarEntry using the header header provided.

Parameters
headerHeader details for entry

Member Function Documentation

◆ AdjustEntryName()

void ICSharpCode.SharpZipLib.Tar.TarEntry.AdjustEntryName ( byte[] buffer,
string newName )
static

Convenience method that will modify an entry's name directly in place in an entry header buffer byte array.

Parameters
bufferThe buffer containing the entry header to modify.
newNameThe new name to place into the header buffer.

◆ Clone()

object ICSharpCode.SharpZipLib.Tar.TarEntry.Clone ( )

Clone this tar entry.

Returns
Returns a clone of this entry.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateEntryFromFile()

TarEntry ICSharpCode.SharpZipLib.Tar.TarEntry.CreateEntryFromFile ( string fileName)
static

Construct an entry for a file. File is set to file, and the header is constructed from information from the file.

Parameters
fileNameThe file name that the entry represents.
Returns
Returns the newly created TarEntry
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTarEntry()

TarEntry ICSharpCode.SharpZipLib.Tar.TarEntry.CreateTarEntry ( string name)
static

Construct an entry with only a name name. This allows the programmer to construct the entry's header "by hand".

Parameters
nameThe name to use for the entry
Returns
Returns the newly created TarEntry
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Equals()

override bool ICSharpCode.SharpZipLib.Tar.TarEntry.Equals ( object obj)

Determine if the two entries are equal. Equality is determined by the header names being equal.

Parameters
objThe Object to compare with the current Object.
Returns
True if the entries are equal; false if not.
Here is the call graph for this function:

◆ GetDirectoryEntries()

TarEntry[] ICSharpCode.SharpZipLib.Tar.TarEntry.GetDirectoryEntries ( )

Get entries for all files present in this entries directory. If this entry doesnt represent a directory zero entries are returned.

Returns
An array of TarEntry's for this entry's children.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFileTarHeader()

void ICSharpCode.SharpZipLib.Tar.TarEntry.GetFileTarHeader ( TarHeader header,
string file )

Fill in a TarHeader with information from a File.

Parameters
headerThe TarHeader to fill in.
fileThe file from which to get the header information.
Here is the caller graph for this function:

◆ GetHashCode()

override int ICSharpCode.SharpZipLib.Tar.TarEntry.GetHashCode ( )

Derive a Hash value for the current Object

Returns
A Hash code for the current Object

◆ IsDescendent()

bool ICSharpCode.SharpZipLib.Tar.TarEntry.IsDescendent ( TarEntry toTest)

Determine if the given entry is a descendant of this entry. Descendancy is determined by the name of the descendant starting with this entry's name.

Parameters
toTestEntry to be checked as a descendent of this.
Returns
True if entry is a descendant of this.
Here is the call graph for this function:

◆ NameTarHeader()

void ICSharpCode.SharpZipLib.Tar.TarEntry.NameTarHeader ( TarHeader header,
string name )
static

Fill in a TarHeader given only the entry's name.

Parameters
headerThe TarHeader to fill in.
nameThe tar entry name.

◆ SetIds()

void ICSharpCode.SharpZipLib.Tar.TarEntry.SetIds ( int userId,
int groupId )

Convenience method to set this entry's group and user ids.

Parameters
userIdThis entry's new user id.
groupIdThis entry's new group id.

◆ SetNames()

void ICSharpCode.SharpZipLib.Tar.TarEntry.SetNames ( string userName,
string groupName )

Convenience method to set this entry's group and user names.

Parameters
userNameThis entry's new user name.
groupNameThis entry's new group name.

◆ WriteEntryHeader()

void ICSharpCode.SharpZipLib.Tar.TarEntry.WriteEntryHeader ( byte[] outBuffer)

Write an entry's header information to a header buffer.

Parameters
outBufferThe tar entry header buffer to fill in.
Here is the caller graph for this function:

Member Data Documentation

◆ file

string ICSharpCode.SharpZipLib.Tar.TarEntry.file
private

The name of the file this entry represents or null if the entry is not based on a file.

◆ header

TarHeader ICSharpCode.SharpZipLib.Tar.TarEntry.header
private

The entry's header information.

Property Documentation

◆ File

string ICSharpCode.SharpZipLib.Tar.TarEntry.File
get

Get this entry's file.

Returns
This entry's file.

◆ GroupId

int ICSharpCode.SharpZipLib.Tar.TarEntry.GroupId
getset

Get/set this entry's group id.

◆ GroupName

string ICSharpCode.SharpZipLib.Tar.TarEntry.GroupName
getset

Get/set this entry's group name.

◆ IsDirectory

bool ICSharpCode.SharpZipLib.Tar.TarEntry.IsDirectory
get

Return true if this entry represents a directory, false otherwise.

Returns
True if this entry is a directory.

◆ ModTime

DateTime ICSharpCode.SharpZipLib.Tar.TarEntry.ModTime
getset

Get/Set the modification time for this entry.

◆ Name

string ICSharpCode.SharpZipLib.Tar.TarEntry.Name
getset

Get/Set this entry's name.

◆ Size

long ICSharpCode.SharpZipLib.Tar.TarEntry.Size
getset

Get/set this entry's recorded file size.

◆ TarHeader

TarHeader ICSharpCode.SharpZipLib.Tar.TarEntry.TarHeader
get

Get this entry's header.

Returns
This entry's TarHeader.

◆ UserId

int ICSharpCode.SharpZipLib.Tar.TarEntry.UserId
getset

Get/set this entry's user id.

◆ UserName

string ICSharpCode.SharpZipLib.Tar.TarEntry.UserName
getset

Get/set this entry's user name.


The documentation for this class was generated from the following file: