|
Fingerprint_Card
|
This class encapsulates the Tar Entry Header used in Tar Archives. The class also holds a number of tar constants, used mostly in headers. More...


Public Member Functions | |
| TarHeader () | |
| Initialise a default TarHeader instance. | |
| string | GetName () |
| Get the name of this entry. | |
| object | Clone () |
| Create a new TarHeader that is a copy of the current instance. | |
| void | ParseBuffer (byte[] header) |
| Parse TarHeader information from a header buffer. | |
| void | WriteHeader (byte[] outBuffer) |
| 'Write' header information to buffer provided, updating the check sum. | |
| override int | GetHashCode () |
| Get a hash code for the current object. | |
| override bool | Equals (object obj) |
| Determines if this instance is equal to the specified object. | |
Static Public Member Functions | |
| static long | ParseOctal (byte[] header, int offset, int length) |
| Parse an octal string from a header buffer. | |
| static StringBuilder | ParseName (byte[] header, int offset, int length) |
| Parse a name from a header buffer. | |
| static int | GetNameBytes (StringBuilder name, int nameOffset, byte[] buffer, int bufferOffset, int length) |
| Add name name to the buffer as a collection of bytes. | |
| static int | GetNameBytes (string name, int nameOffset, byte[] buffer, int bufferOffset, int length) |
| Add name name to the buffer as a collection of bytes. | |
| static int | GetNameBytes (StringBuilder name, byte[] buffer, int offset, int length) |
| Add an entry name to the buffer. | |
| static int | GetNameBytes (string name, byte[] buffer, int offset, int length) |
| Add an entry name to the buffer. | |
| static int | GetAsciiBytes (string toAdd, int nameOffset, byte[] buffer, int bufferOffset, int length) |
| Add a string to a buffer as a collection of ascii bytes. | |
| static int | GetOctalBytes (long value, byte[] buffer, int offset, int length) |
| Put an octal representation of a value into a buffer. | |
| static int | GetLongOctalBytes (long value, byte[] buffer, int offset, int length) |
| Put an octal representation of a value into a buffer. | |
Static Public Attributes | |
| const int | NAMELEN = 100 |
| The length of the name field in a header buffer. | |
| const int | MODELEN = 8 |
| The length of the mode field in a header buffer. | |
| const int | UIDLEN = 8 |
| The length of the user id field in a header buffer. | |
| const int | GIDLEN = 8 |
| The length of the group id field in a header buffer. | |
| const int | CHKSUMLEN = 8 |
| The length of the checksum field in a header buffer. | |
| const int | CHKSUMOFS = 148 |
| Offset of checksum in a header buffer. | |
| const int | SIZELEN = 12 |
| The length of the size field in a header buffer. | |
| const int | MAGICLEN = 6 |
| The length of the magic field in a header buffer. | |
| const int | VERSIONLEN = 2 |
| The length of the version field in a header buffer. | |
| const int | MODTIMELEN = 12 |
| The length of the modification time field in a header buffer. | |
| const int | UNAMELEN = 32 |
| The length of the user name field in a header buffer. | |
| const int | GNAMELEN = 32 |
| The length of the group name field in a header buffer. | |
| const int | DEVLEN = 8 |
| The length of the devices field in a header buffer. | |
| const byte | LF_OLDNORM = 0 |
| The "old way" of indicating a normal file. | |
| const byte | LF_NORMAL = (byte) '0' |
| Normal file type. | |
| const byte | LF_LINK = (byte) '1' |
| Link file type. | |
| const byte | LF_SYMLINK = (byte) '2' |
| Symbolic link file type. | |
| const byte | LF_CHR = (byte) '3' |
| Character device file type. | |
| const byte | LF_BLK = (byte) '4' |
| Block device file type. | |
| const byte | LF_DIR = (byte) '5' |
| Directory file type. | |
| const byte | LF_FIFO = (byte) '6' |
| FIFO (pipe) file type. | |
| const byte | LF_CONTIG = (byte) '7' |
| Contiguous file type. | |
| const byte | LF_GHDR = (byte) 'g' |
| Posix.1 2001 global extended header. | |
| const byte | LF_XHDR = (byte) 'x' |
| Posix.1 2001 extended header. | |
| const byte | LF_ACL = (byte) 'A' |
| Solaris access control list file type. | |
| const byte | LF_GNU_DUMPDIR = (byte) 'D' |
| GNU dir dump file type This is a dir entry that contains the names of files that were in the dir at the time the dump was made. | |
| const byte | LF_EXTATTR = (byte) 'E' |
| Solaris Extended Attribute File. | |
| const byte | LF_META = (byte) 'I' |
| Inode (metadata only) no file content. | |
| const byte | LF_GNU_LONGLINK = (byte) 'K' |
| Identifies the next file on the tape as having a long link name. | |
| const byte | LF_GNU_LONGNAME = (byte) 'L' |
| Identifies the next file on the tape as having a long name. | |
| const byte | LF_GNU_MULTIVOL = (byte) 'M' |
| Continuation of a file that began on another volume. | |
| const byte | LF_GNU_NAMES = (byte) 'N' |
| For storing filenames that dont fit in the main header (old GNU) | |
| const byte | LF_GNU_SPARSE = (byte) 'S' |
| GNU Sparse file. | |
| const byte | LF_GNU_VOLHDR = (byte) 'V' |
| GNU Tape/volume header ignore on extraction. | |
| const string | TMAGIC = "ustar " |
| The magic tag representing a POSIX tar archive. (includes trailing NULL) | |
| const string | GNU_TMAGIC = "ustar " |
| The magic tag representing an old GNU tar archive where version is included in magic and overwrites it. | |
Static Package Functions | |
| static void | SetValueDefaults (int userId, string userName, int groupId, string groupName) |
| Set defaults for values used when constructing a TarHeader instance. | |
| static void | RestoreSetValues () |
Static Package Attributes | |
| static int | userIdAsSet |
| static int | groupIdAsSet |
| static string | userNameAsSet |
| static string | groupNameAsSet = "None" |
| static int | defaultUserId |
| static int | defaultGroupId |
| static string | defaultGroupName = "None" |
| static string | defaultUser |
Properties | |
| string | Name [get, set] |
| Get/set the name for this tar entry. | |
| int | Mode [get, set] |
| Get/set the entry's Unix style permission mode. | |
| int | UserId [get, set] |
| The entry's user id. | |
| int | GroupId [get, set] |
| Get/set the entry's group id. | |
| long | Size [get, set] |
| Get/set the entry's size. | |
| DateTime | ModTime [get, set] |
| Get/set the entry's modification time. | |
| int | Checksum [get] |
| Get the entry's checksum. This is only valid/updated after writing or reading an entry. | |
| bool | IsChecksumValid [get] |
| Get value of true if the header checksum is valid, false otherwise. | |
| byte | TypeFlag [get, set] |
| Get/set the entry's type flag. | |
| string | LinkName [get, set] |
| The entry's link name. | |
| string | Magic [get, set] |
| Get/set the entry's magic tag. | |
| string | Version [get, set] |
| The entry's version. | |
| string | UserName [get, set] |
| The entry's user name. | |
| string | GroupName [get, set] |
| Get/set the entry's group name. | |
| int | DevMajor [get, set] |
| Get/set the entry's major device number. | |
| int | DevMinor [get, set] |
| Get/set the entry's minor device number. | |
Static Private Member Functions | |
| static int | GetCheckSumOctalBytes (long value, byte[] buffer, int offset, int length) |
| Add the checksum integer to header buffer. | |
| static int | ComputeCheckSum (byte[] buffer) |
| Compute the checksum for a tar entry header. The checksum field must be all spaces prior to this happening. | |
| static int | MakeCheckSum (byte[] buffer) |
| Make a checksum for a tar entry ignoring the checksum contents. | |
| static int | GetCTime (System.DateTime dateTime) |
| static DateTime | GetDateTimeFromCTime (long ticks) |
Private Attributes | |
| string | name |
| int | mode |
| int | userId |
| int | groupId |
| long | size |
| DateTime | modTime |
| int | checksum |
| bool | isChecksumValid |
| byte | typeFlag |
| string | linkName |
| string | magic |
| string | version |
| string | userName |
| string | groupName |
| int | devMajor |
| int | devMinor |
Static Private Attributes | |
| const long | timeConversionFactor = 10000000L |
| static readonly DateTime | dateTime1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0) |
This class encapsulates the Tar Entry Header used in Tar Archives. The class also holds a number of tar constants, used mostly in headers.
| ICSharpCode.SharpZipLib.Tar.TarHeader.TarHeader | ( | ) |
| object ICSharpCode.SharpZipLib.Tar.TarHeader.Clone | ( | ) |
Create a new TarHeader that is a copy of the current instance.
|
staticprivate |
Compute the checksum for a tar entry header.
The checksum field must be all spaces prior to this happening.
| buffer | The tar entry's header buffer. |

| override bool ICSharpCode.SharpZipLib.Tar.TarHeader.Equals | ( | object | obj | ) |
Determines if this instance is equal to the specified object.
| obj | The object to compare with. |

|
static |
Add a string to a buffer as a collection of ascii bytes.
| toAdd | The string to add |
| nameOffset | The offset of the first character to add. |
| buffer | The buffer to add to. |
| bufferOffset | The offset to start adding at. |
| length | The number of ascii characters to add. |

|
staticprivate |
Add the checksum integer to header buffer.
| value | |
| buffer | The header buffer to set the checksum for |
| offset | The offset into the buffer for the checksum |
| length | The number of header bytes to update. It's formatted differently from the other fields: it has 6 digits, a null, then a space – rather than digits, a space, then a null. The final space is already there, from checksumming |


|
staticprivate |

|
staticprivate |

| override int ICSharpCode.SharpZipLib.Tar.TarHeader.GetHashCode | ( | ) |
Get a hash code for the current object.
|
static |
Put an octal representation of a value into a buffer.
| value | Value to be convert to octal |
| buffer | The buffer to update |
| offset | The offset into the buffer to store the value |
| length | The length of the octal string |


| string ICSharpCode.SharpZipLib.Tar.TarHeader.GetName | ( | ) |
Get the name of this entry.
|
static |
Add an entry name to the buffer.
| name | The name to add |
| buffer | The buffer to add to |
| offset | The offset into the buffer from which to start adding |
| length | The number of header bytes to add |

|
static |
Add name name to the buffer as a collection of bytes.
| name | The name to add |
| nameOffset | The offset of the first character |
| buffer | The buffer to add to |
| bufferOffset | The index of the first byte to add |
| length | The number of characters/bytes to add |
|
static |
Add an entry name to the buffer.
| name | The name to add |
| buffer | The buffer to add to |
| offset | The offset into the buffer from which to start adding |
| length | The number of header bytes to add |

|
static |
Add name name to the buffer as a collection of bytes.
| name | The name to add |
| nameOffset | The offset of the first character |
| buffer | The buffer to add to |
| bufferOffset | The index of the first byte to add |
| length | The number of characters/bytes to add |


|
static |
Put an octal representation of a value into a buffer.
| value | the value to be converted to octal |
| buffer | buffer to store the octal string |
| offset | The offset into the buffer where the value starts |
| length | The length of the octal string to create |

|
staticprivate |
Make a checksum for a tar entry ignoring the checksum contents.
| buffer | The tar entry's header buffer. |

| void ICSharpCode.SharpZipLib.Tar.TarHeader.ParseBuffer | ( | byte[] | header | ) |
Parse TarHeader information from a header buffer.
| header | The tar entry header buffer to get information from. |


|
static |
Parse a name from a header buffer.
| header | The header buffer from which to parse. |
| offset | The offset into the buffer from which to parse. |
| length | The number of header bytes to parse. |

|
static |
Parse an octal string from a header buffer.
| header | The header buffer from which to parse. |
| offset | The offset into the buffer from which to parse. |
| length | The number of header bytes to parse. |
|
staticpackage |

|
staticpackage |
Set defaults for values used when constructing a TarHeader instance.
| userId | Value to apply as a default for userId. |
| userName | Value to apply as a default for userName. |
| groupId | Value to apply as a default for groupId. |
| groupName | Value to apply as a default for groupName. |

| void ICSharpCode.SharpZipLib.Tar.TarHeader.WriteHeader | ( | byte[] | outBuffer | ) |
'Write' header information to buffer provided, updating the check sum.
| outBuffer | output buffer for header information |


|
private |
|
static |
The length of the checksum field in a header buffer.
|
static |
Offset of checksum in a header buffer.
|
staticprivate |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
static |
The length of the devices field in a header buffer.
|
private |
|
private |
|
static |
The length of the group id field in a header buffer.
|
static |
The length of the group name field in a header buffer.
|
static |
The magic tag representing an old GNU tar archive where version is included in magic and overwrites it.
|
private |
|
staticpackage |
|
private |
|
staticpackage |
|
private |
|
static |
Solaris access control list file type.
|
static |
Block device file type.
|
static |
Character device file type.
|
static |
Contiguous file type.
|
static |
Directory file type.
|
static |
Solaris Extended Attribute File.
|
static |
FIFO (pipe) file type.
|
static |
Posix.1 2001 global extended header.
|
static |
GNU dir dump file type This is a dir entry that contains the names of files that were in the dir at the time the dump was made.
|
static |
Identifies the next file on the tape as having a long link name.
|
static |
Identifies the next file on the tape as having a long name.
|
static |
Continuation of a file that began on another volume.
|
static |
For storing filenames that dont fit in the main header (old GNU)
|
static |
GNU Sparse file.
|
static |
GNU Tape/volume header ignore on extraction.
|
static |
Link file type.
|
static |
Inode (metadata only) no file content.
|
static |
Normal file type.
|
static |
The "old way" of indicating a normal file.
|
static |
Symbolic link file type.
|
static |
Posix.1 2001 extended header.
|
private |
|
private |
|
static |
The length of the magic field in a header buffer.
|
private |
|
static |
The length of the mode field in a header buffer.
|
private |
|
static |
The length of the modification time field in a header buffer.
|
private |
|
static |
The length of the name field in a header buffer.
|
private |
|
static |
The length of the size field in a header buffer.
|
staticprivate |
|
static |
The magic tag representing a POSIX tar archive. (includes trailing NULL)
|
private |
|
static |
The length of the user id field in a header buffer.
|
static |
The length of the user name field in a header buffer.
|
private |
|
staticpackage |
|
private |
|
staticpackage |
|
private |
|
static |
The length of the version field in a header buffer.
|
get |
Get the entry's checksum. This is only valid/updated after writing or reading an entry.
|
getset |
Get/set the entry's major device number.
|
getset |
Get/set the entry's minor device number.
|
getset |
Get/set the entry's group id.
This is only directly relevant to linux/unix systems. The default value is zero.
|
getset |
Get/set the entry's group name.
This is only directly relevant to unix systems.
|
get |
Get value of true if the header checksum is valid, false otherwise.
|
getset |
The entry's link name.
| ArgumentNullException | Thrown when attempting to set LinkName to null. |
|
getset |
Get/set the entry's magic tag.
| ArgumentNullException | Thrown when attempting to set Magic to null. |
|
getset |
Get/set the entry's Unix style permission mode.
|
getset |
Get/set the entry's modification time.
The modification time is only accurate to within a second.
| ArgumentOutOfRangeException | Thrown when setting the date time to less than 1/1/1970. |
|
getset |
Get/set the name for this tar entry.
| ArgumentNullException | Thrown when attempting to set the property to null. |
|
getset |
Get/set the entry's size.
| ArgumentOutOfRangeException | Thrown when setting the size to less than zero. |
|
getset |
Get/set the entry's type flag.
|
getset |
The entry's user id.
This is only directly relevant to unix systems. The default is zero.
|
getset |
The entry's user name.
|
getset |
The entry's version.
| ArgumentNullException | Thrown when attempting to set Version to null. |