TChilkatZipEntry2 Delphi Reference

TChilkatZipEntry2

Represents a single file or directory entry within a Chilkat Zip object.

Object Creation

var
obj: IChilkatZipEntry2;
...
begin
// This object is never explicitly created.
// It is returned by various TChilkatZip2 methods.
obj := zipObject.someMethod(...);

Properties

property Comment: WideString

The comment stored within the Zip for this entry.

property CompressedLength: Integer readonly

The size in bytes of this entry's file data when compression is applied

property CompressedLengthStr: WideString readonly

The size in decimal string format of this file when Zip compression is applied.

property CompressionLevel: Integer

The compression level. 0 = no compression, while 9 = maximum compression. The default is 6.

property CompressionMethod: Integer

Set to 0 for no compression, or 8 for the Deflate algorithm. The Deflate algorithm is the default algorithm of the most popular Zip utility programs, such as WinZip

property Crc: Integer readonly

The CRC for the zip entry.

property EntryID: Integer readonly

The unique ID assigned by Zip.NET while the object is instantiated in memory.

property EntryType: Integer readonly

Indicates the origin of the entry. There are three possible values: (0) an entry in an existing Zip file, (1) a file on disk referenced by Zip.NET and to be added to the Zip, and (2) an entry created directly from data in memory.

property FileDateTime: TDateTime

The last-modified time of the Zip entry.

property FileName: WideString

The file name of the Zip entry.

property IsDirectory: Integer readonly

True if the Zip entry is a directory, false if it is a file.

property LastErrorHtml: WideString readonly

Error information in HTML format for the last method called.

property LastErrorText: WideString readonly

Error information in plain-text format for the last method called.

property LastErrorXml: WideString readonly

Error information in XML format for the last method called.

property UncompressedLength: Integer readonly

The size in bytes of this entry's file data when uncompressed.

property UncompressedLengthStr: WideString readonly

The size in bytes (in decimal string format) of this zip entry's data when uncompressed.

Methods

procedure AppendData(data: OleVariant);

Appends binary data to the zip entry's file contents.

function Copy(): OleVariant;

Returns the compressed data as a byte array.

Returns a zero-length byte array (as an OleVariant) on failure.
An empty array will have a VarArrayHighBound of -1 meaning 0 elements.

function CopyToBase64(): WideString;

Returns the compressed data as a Base64-encoded string. This data can be re-added to a Zip by calling Zip.AppendBase64.

Returns a zero-length WideString on failure

function CopyToHex(): WideString;

Returns the compressed data as a hexidecimal encoded string. This data can be re-added to a Zip by calling Zip.AppendHex.

Returns a zero-length WideString on failure

function Extract(dirPath: WideString): Integer;

Unzips this entry into the specified base directory. The file is unzipped to the subdirectory according to the relative path stored with the entry in the Zip. Use ExtractInto to unzip into a specific directory regardless of the path information stored in the Zip.

function ExtractInto(dirPath: WideString): Integer;

Unzip a file into a specific directory

function Inflate(): OleVariant;

Inflate a file within a Zip directly into memory.

Returns a zero-length byte array (as an OleVariant) on failure.
An empty array will have a VarArrayHighBound of -1 meaning 0 elements.

function InflateToString(addCR: Integer): WideString;

Inflate and return the uncompressed data as a string. Line-endings are modified to include or not include carriage-returns based on KeepCR. If KeepCR = False, then bare linefeeds are returned, otherwise CRLFs are returned.

Returns a zero-length WideString on failure

function InflateToString2(): WideString;

Unzip a file directly into memory as a string, and leave line-endings unmodified.

Returns a zero-length WideString on failure

function InflateToString3(srcCharset: WideString): WideString;

Inflates a character data from a specified character encoding (such as iso-8859-1, or Shift_JIS) and returns the inflated data as a Unicode string.

Returns a zero-length WideString on failure

function NextEntry(): TChilkatZipEntry2;

Return the next entry (file or directory) within the Zip

Returns a null reference on failure

procedure ReplaceData(data: OleVariant);

Replaces the zip entry's existing contents with new data.

procedure SaveLastError(filename: WideString);

Saves the last error information to an XML formatted file.