ICSharpCode::SharpZipLib::Zip::ZipEntry Class Reference

This class represents an entry in a zip archive. This can be a file or a directory ZipFile and ZipInputStream will give you instances of this class as information about the members in an archive. ZipOutputStream uses an instance of this class when creating an entry in a Zip file.

Author of the original java version : Jochen Hoenicke. More...

List of all members.

Public Member Functions

 ZipEntry (string name)
 Creates a zip entry with the given name.
 ZipEntry (ZipEntry e)
 Creates a copy of the given zip entry.
object Clone ()
override string ToString ()

Static Public Member Functions

static string CleanName (string name, bool relativePath)
 Cleans a name making it conform to Zip file conventions. Devices names ('c:\') and UNC share names ('\server') are removed and forward slashes ('\') are converted to back slashes ('/').
static string CleanName (string name)
 
Parameters:
name Name to clean


Properties

bool IsCrypted
 Get/Set flag indicating if entry is encrypted. A simple helper routine to aid interpretation of Flagsflags.
int Flags
 Get/Set general purpose bit flag for entry.
int ZipFileIndex
 Get/Set index of this entry in Zip file.
int Offset
 Get/set offset for use in central header.
int ExternalFileAttributes
 Get/Set external file attributes as an integer. The values of this are operating system dependant see HostSystemHostSystem for details.
int VersionMadeBy
 Get the version made by for this entry or zero if unknown. The value / 10 indicates the major version number, and the value mod 10 is the minor version number.
int HostSystem
 Gets the compatability information for the ExternalFileAttributesexternal file attribute If the external file attributes are compatible with MS-DOS and can be read by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value will be non-zero and identify the host system on which the attributes are compatible.
int Version
 Get minimum Zip feature version required to extract this entry.
bool RequiresZip64
 Gets a value indicating if the entry requires Zip64 extensions to be stored.
long DosTime
 Get/Set DosTime.
DateTime DateTime
 Gets/Sets the time of last modification of the entry.
string Name
 Returns the entry name. The path components in the entry should always separated by slashes ('/'). Dos device names like C: should also be removed. See CleanNameCleanName.
long Size
 
long CompressedSize
 
long Crc
 
CompressionMethod CompressionMethod
 ICSharpCode::SharpZipLib::Zip::CompressionMethod::Stored
byte[] ExtraData
 
string Comment
 
bool IsDirectory
bool IsFile

Private Member Functions

internal ZipEntry (string name, int versionRequiredToExtract)
 Creates a zip entry with the given name and version required to extract.
internal ZipEntry (string name, int versionRequiredToExtract, int madeByInfo)
 Initializes an entry with the given name and made by information.

Private Attributes

ushort known = 0
int externalFileAttributes = -1
ushort versionMadeBy
string name
ulong size
ulong compressedSize
ushort versionToExtract
uint crc
uint dosTime
CompressionMethod method = CompressionMethod.Deflated
byte[] extra = null
string comment = null
int flags
int zipFileIndex = -1
int offset

Static Private Attributes

static int KNOWN_SIZE = 1
static int KNOWN_CSIZE = 2
static int KNOWN_CRC = 4
static int KNOWN_TIME = 8
static int KNOWN_EXTERN_ATTRIBUTES = 16


Detailed Description

This class represents an entry in a zip archive. This can be a file or a directory ZipFile and ZipInputStream will give you instances of this class as information about the members in an archive. ZipOutputStream uses an instance of this class when creating an entry in a Zip file.

Author of the original java version : Jochen Hoenicke.

Definition at line 55 of file ZipEntry.cs.


Constructor & Destructor Documentation

ICSharpCode::SharpZipLib::Zip::ZipEntry::ZipEntry string  name  )  [inline]
 

Creates a zip entry with the given name.

Parameters:
name The name for this entry. Can include directory components. The convention for names is 'unix' style paths with no device names and path elements separated by '/' characters. This is not enforced see CleanNameCleanName on how to ensure names are valid if this is desired.
Exceptions:
ArgumentNullException The name passed is null

Definition at line 251 of file ZipEntry.cs.

internal ICSharpCode::SharpZipLib::Zip::ZipEntry::ZipEntry string  name,
int  versionRequiredToExtract
[inline, private]
 

Creates a zip entry with the given name and version required to extract.

Parameters:
name The name for this entry. Can include directory components. The convention for names is 'unix' style paths with no device names and path elements separated by '/' characters. This is not enforced see CleanNameCleanName on how to ensure names are valid if this is desired.
versionRequiredToExtract The minimum 'feature version' required this entry
Exceptions:
ArgumentNullException The name passed is null

Definition at line 270 of file ZipEntry.cs.

internal ICSharpCode::SharpZipLib::Zip::ZipEntry::ZipEntry string  name,
int  versionRequiredToExtract,
int  madeByInfo
[inline, private]
 

Initializes an entry with the given name and made by information.

Parameters:
name Name for this entry
madeByInfo Version and HostSystem Information
versionRequiredToExtract Minimum required zip feature version required to extract this entry
Exceptions:
ArgumentNullException The name passed is null
ArgumentOutOfRangeException versionRequiredToExtract should be 0 (auto-calculate) or > 10

This constructor is used by the ZipFile class when reading from the central header It is not generally useful, use the constructor specifying the name only.

Definition at line 290 of file ZipEntry.cs.

ICSharpCode::SharpZipLib::Zip::ZipEntry::ZipEntry ZipEntry  e  )  [inline]
 

Creates a copy of the given zip entry.

Parameters:
e The entry to copy.

Definition at line 316 of file ZipEntry.cs.

References comment, compressedSize, crc, dosTime, externalFileAttributes, ExtraData, flags, known, method, name, size, versionMadeBy, and versionToExtract.


Member Function Documentation

static string ICSharpCode::SharpZipLib::Zip::ZipEntry::CleanName string  name  )  [inline, static]
 

Parameters:
name Name to clean

Definition at line 490 of file ZipEntry.cs.

static string ICSharpCode::SharpZipLib::Zip::ZipEntry::CleanName string  name,
bool  relativePath
[inline, static]
 

Cleans a name making it conform to Zip file conventions. Devices names ('c:\') and UNC share names ('\server') are removed and forward slashes ('\') are converted to back slashes ('/').

Parameters:
name Name to clean
relativePath Make names relative if true or absolute if false

Definition at line 456 of file ZipEntry.cs.

object ICSharpCode::SharpZipLib::Zip::ZipEntry::Clone  )  [inline]
 

Definition at line 720 of file ZipEntry.cs.

override string ICSharpCode::SharpZipLib::Zip::ZipEntry::ToString  )  [inline]
 

Definition at line 728 of file ZipEntry.cs.


Member Data Documentation

string ICSharpCode::SharpZipLib::Zip::ZipEntry::comment = null [private]
 

Definition at line 78 of file ZipEntry.cs.

Referenced by ZipEntry().

ulong ICSharpCode::SharpZipLib::Zip::ZipEntry::compressedSize [private]
 

Definition at line 71 of file ZipEntry.cs.

Referenced by ZipEntry().

uint ICSharpCode::SharpZipLib::Zip::ZipEntry::crc [private]
 

Definition at line 73 of file ZipEntry.cs.

Referenced by ZipEntry().

uint ICSharpCode::SharpZipLib::Zip::ZipEntry::dosTime [private]
 

Definition at line 74 of file ZipEntry.cs.

Referenced by ZipEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::externalFileAttributes = -1 [private]
 

Definition at line 64 of file ZipEntry.cs.

Referenced by ZipEntry().

byte [] ICSharpCode::SharpZipLib::Zip::ZipEntry::extra = null [private]
 

Definition at line 77 of file ZipEntry.cs.

int ICSharpCode::SharpZipLib::Zip::ZipEntry::flags [private]
 

Definition at line 80 of file ZipEntry.cs.

Referenced by ZipEntry().

ushort ICSharpCode::SharpZipLib::Zip::ZipEntry::known = 0 [private]
 

Definition at line 63 of file ZipEntry.cs.

Referenced by ZipEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::KNOWN_CRC = 4 [static, private]
 

Definition at line 59 of file ZipEntry.cs.

int ICSharpCode::SharpZipLib::Zip::ZipEntry::KNOWN_CSIZE = 2 [static, private]
 

Definition at line 58 of file ZipEntry.cs.

int ICSharpCode::SharpZipLib::Zip::ZipEntry::KNOWN_EXTERN_ATTRIBUTES = 16 [static, private]
 

Definition at line 61 of file ZipEntry.cs.

int ICSharpCode::SharpZipLib::Zip::ZipEntry::KNOWN_SIZE = 1 [static, private]
 

Definition at line 57 of file ZipEntry.cs.

int ICSharpCode::SharpZipLib::Zip::ZipEntry::KNOWN_TIME = 8 [static, private]
 

Definition at line 60 of file ZipEntry.cs.

CompressionMethod ICSharpCode::SharpZipLib::Zip::ZipEntry::method = CompressionMethod.Deflated [private]
 

Definition at line 76 of file ZipEntry.cs.

Referenced by ZipEntry().

string ICSharpCode::SharpZipLib::Zip::ZipEntry::name [private]
 

Definition at line 69 of file ZipEntry.cs.

Referenced by ZipEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::offset [private]
 

Definition at line 83 of file ZipEntry.cs.

ulong ICSharpCode::SharpZipLib::Zip::ZipEntry::size [private]
 

Definition at line 70 of file ZipEntry.cs.

Referenced by ZipEntry().

ushort ICSharpCode::SharpZipLib::Zip::ZipEntry::versionMadeBy [private]
 

Definition at line 66 of file ZipEntry.cs.

Referenced by ZipEntry().

ushort ICSharpCode::SharpZipLib::Zip::ZipEntry::versionToExtract [private]
 

Definition at line 72 of file ZipEntry.cs.

Referenced by ZipEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::zipFileIndex = -1 [private]
 

Definition at line 82 of file ZipEntry.cs.


Property Documentation

string ICSharpCode::SharpZipLib::Zip::ZipEntry::Comment [get, set]
 

Definition at line 661 of file ZipEntry.cs.

long ICSharpCode::SharpZipLib::Zip::ZipEntry::CompressedSize [get, set]
 

Definition at line 526 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry().

CompressionMethod ICSharpCode::SharpZipLib::Zip::ZipEntry::CompressionMethod [get, set]
 

ICSharpCode::SharpZipLib::Zip::CompressionMethod::Stored

Definition at line 569 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::GetOutputStream(), ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry(), and ICSharpCode::SharpZipLib::Zip::ZipFile::TestLocalHeader().

long ICSharpCode::SharpZipLib::Zip::ZipEntry::Crc [get, set]
 

Definition at line 548 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::CheckClassicPassword(), ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitEncryptionStream(), ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry(), and ICSharpCode::SharpZipLib::Zip::ZipFile::TestLocalHeader().

DateTime ICSharpCode::SharpZipLib::Zip::ZipEntry::DateTime [get, set]
 

Gets/Sets the time of last modification of the entry.

Definition at line 411 of file ZipEntry.cs.

long ICSharpCode::SharpZipLib::Zip::ZipEntry::DosTime [get, set]
 

Get/Set DosTime.

Definition at line 393 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::CheckClassicPassword(), ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitEncryptionStream(), and ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::ExternalFileAttributes [get, set]
 

Get/Set external file attributes as an integer. The values of this are operating system dependant see HostSystemHostSystem for details.

Definition at line 171 of file ZipEntry.cs.

byte [] ICSharpCode::SharpZipLib::Zip::ZipEntry::ExtraData [get, set]
 

Definition at line 587 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry(), and ZipEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::Flags [get, set]
 

Get/Set general purpose bit flag for entry.

General purpose bit flag
Bit 0: If set, indicates the file is encrypted
Bit 1-2 Only used for compression type 6 Imploding, and 8, 9 deflating
Imploding:
Bit 1 if set indicates an 8K sliding dictionary was used. If clear a 4k dictionary was used
Bit 2 if set indicates 3 Shannon-Fanno trees were used to encode the sliding dictionary, 2 otherwise

Deflating:
Bit 2 Bit 1
0 0 Normal compression was used
0 1 Maximum compression was used
1 0 Fast compression was used
1 1 Super fast compression was used

Bit 3: If set, the fields crc-32, compressed size and uncompressed size are were not able to be written during zip file creation The correct values are held in a data descriptor immediately following the compressed data.
Bit 4: Reserved for use by PKZIP for enhanced deflating
Bit 5: If set indicates the file contains compressed patch data
Bit 6: If set indicates strong encryption was used.
Bit 7-15: Unused or reserved

Definition at line 128 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::CheckClassicPassword(), ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitDecryptionStream(), ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitEncryptionStream(), ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry(), and ICSharpCode::SharpZipLib::Zip::ZipFile::TestLocalHeader().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::HostSystem [get]
 

Gets the compatability information for the ExternalFileAttributesexternal file attribute If the external file attributes are compatible with MS-DOS and can be read by PKZIP for DOS version 2.04g then this value will be zero. Otherwise the value will be non-zero and identify the host system on which the attributes are compatible.

The values for this as defined in the Zip File format and by others are shown below. The values are somewhat misleading in some cases as they are not all used as shown. You should consult the relevant documentation to obtain up to date and correct information. The modified appnote by the infozip group is particularly helpful as it documents a lot of peculiarities. The document is however a little dated.

  • 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)
  • 1 - Amiga
  • 2 - OpenVMS
  • 3 - Unix
  • 4 - VM/CMS
  • 5 - Atari ST
  • 6 - OS/2 HPFS
  • 7 - Macintosh
  • 8 - Z-System
  • 9 - CP/M
  • 10 - Windows NTFS
  • 11 - MVS (OS/390 - Z/OS)
  • 12 - VSE
  • 13 - Acorn Risc
  • 14 - VFAT
  • 15 - Alternate MVS
  • 16 - BeOS
  • 17 - Tandem
  • 18 - OS/400
  • 19 - OS/X (Darwin)
  • 99 - WinZip AES
  • remainder - unused

Definition at line 235 of file ZipEntry.cs.

bool ICSharpCode::SharpZipLib::Zip::ZipEntry::IsCrypted [get, set]
 

Get/Set flag indicating if entry is encrypted. A simple helper routine to aid interpretation of Flagsflags.

Definition at line 89 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::GetOutputStream(), and ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry().

bool ICSharpCode::SharpZipLib::Zip::ZipEntry::IsDirectory [get]
 

Definition at line 682 of file ZipEntry.cs.

bool ICSharpCode::SharpZipLib::Zip::ZipEntry::IsFile [get]
 

Definition at line 703 of file ZipEntry.cs.

string ICSharpCode::SharpZipLib::Zip::ZipEntry::Name [get]
 

Returns the entry name. The path components in the entry should always separated by slashes ('/'). Dos device names like C: should also be removed. See CleanNameCleanName.

Definition at line 443 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitDecryptionStream(), ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitEncryptionStream(), ICSharpCode::SharpZipLib::Zip::FastZip::ExtractEntry(), ICSharpCode::SharpZipLib::Zip::FastZip::ExtractZip(), ICSharpCode::SharpZipLib::Zip::ZipFile::GetInputStream(), ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry(), and ICSharpCode::SharpZipLib::Zip::ZipFile::TestLocalHeader().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::Offset [get, set]
 

Get/set offset for use in central header.

Definition at line 153 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry(), and ICSharpCode::SharpZipLib::Zip::ZipFile::TestLocalHeader().

bool ICSharpCode::SharpZipLib::Zip::ZipEntry::RequiresZip64 [get]
 

Gets a value indicating if the entry requires Zip64 extensions to be stored.

Definition at line 384 of file ZipEntry.cs.

long ICSharpCode::SharpZipLib::Zip::ZipEntry::Size [get, set]
 

Definition at line 504 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::Version [get]
 

Get minimum Zip feature version required to extract this entry.

Minimum features are defined as:
1.0 - Default value
1.1 - File is a volume label
2.0 - File is a folder/directory
2.0 - File is compressed using Deflate compression
2.0 - File is encrypted using traditional encryption
2.1 - File is compressed using Deflate64
2.5 - File is compressed using PKWARE DCL Implode
2.7 - File is a patch data set
4.5 - File uses Zip64 format extensions
4.6 - File is compressed using BZIP2 compression
5.0 - File is encrypted using DES
5.0 - File is encrypted using 3DES
5.0 - File is encrypted using original RC2 encryption
5.0 - File is encrypted using RC4 encryption
5.1 - File is encrypted using AES encryption
5.1 - File is encrypted using corrected RC2 encryption
5.1 - File is encrypted using corrected RC2-64 encryption
6.1 - File is encrypted using non-OAEP key wrapping
6.2 - Central directory encryption (not confirmed yet)

Definition at line 361 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitDecryptionStream(), ICSharpCode::SharpZipLib::Zip::ZipFile::CreateAndInitEncryptionStream(), and ICSharpCode::SharpZipLib::Zip::ZipOutputStream::PutNextEntry().

int ICSharpCode::SharpZipLib::Zip::ZipEntry::VersionMadeBy [get]
 

Get the version made by for this entry or zero if unknown. The value / 10 indicates the major version number, and the value mod 10 is the minor version number.

Definition at line 191 of file ZipEntry.cs.

int ICSharpCode::SharpZipLib::Zip::ZipEntry::ZipFileIndex [get, set]
 

Get/Set index of this entry in Zip file.

Definition at line 141 of file ZipEntry.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::ZipFile::GetInputStream().


The documentation for this class was generated from the following file:
Generated on Fri Jun 23 21:50:06 2006 for OblivionModTranslator by  doxygen 1.4.6-NO