unit Chilkat.ZipEntry;

{
  Pascal wrapper for Chilkat ZipEntry.
  Auto-generated by PascalWrapperGenerator -- do not edit manually.
}

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TZipEntry wraps CkZipEntry via the C bridge layer. }
  TZipEntry = class(TChilkatBase)
  private
    FOnAbortCheck: TChilkatAbortCheckEvent;
    FOnPercentDone: TChilkatPercentDoneEvent;
    FOnProgressInfo: TChilkatProgressInfoEvent;
    function  GetLastErrorHtml: string;
    function  GetLastErrorText: string;
    function  GetLastErrorXml: string;
    function  GetVersion: string;
    function  GetDebugLogFilePath: string;
    procedure SetDebugLogFilePath(AValue: string);
    function  GetVerboseLogging: Boolean;
    procedure SetVerboseLogging(AValue: Boolean);
    function  GetLastMethodSuccess: Boolean;
    procedure SetLastMethodSuccess(AValue: Boolean);
    function  GetComment: string;
    procedure SetComment(AValue: string);
    function  GetCompressedLength: LongWord;
    function  GetCompressedLength64: Int64;
    function  GetCompressedLengthStr: string;
    function  GetCompressionLevel: Integer;
    procedure SetCompressionLevel(AValue: Integer);
    function  GetCompressionMethod: Integer;
    procedure SetCompressionMethod(AValue: Integer);
    function  GetCrc: Integer;
    function  GetEntryID: Integer;
    function  GetEntryType: Integer;
    function  GetFileDateTimeStr: string;
    procedure SetFileDateTimeStr(AValue: string);
    function  GetFileName: string;
    procedure SetFileName(AValue: string);
    function  GetFileNameHex: string;
    function  GetHeartbeatMs: Integer;
    procedure SetHeartbeatMs(AValue: Integer);
    function  GetIsDirectory: Boolean;
    function  GetTextFlag: Boolean;
    procedure SetTextFlag(AValue: Boolean);
    function  GetUncompressedLength: LongWord;
    function  GetUncompressedLength64: Int64;
    function  GetUncompressedLengthStr: string;
    function  GetIsAesEncrypted: Boolean;
    function  GetEncryptionKeyLen: Integer;
    procedure SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
    procedure SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
    procedure SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
  public
    constructor Create;
    destructor  Destroy; override;

    property LastErrorHtml: string read GetLastErrorHtml;
    property LastErrorText: string read GetLastErrorText;
    property LastErrorXml: string read GetLastErrorXml;
    property Version: string read GetVersion;
    property DebugLogFilePath: string read GetDebugLogFilePath write SetDebugLogFilePath;
    property VerboseLogging: Boolean read GetVerboseLogging write SetVerboseLogging;
    property LastMethodSuccess: Boolean read GetLastMethodSuccess write SetLastMethodSuccess;
    property Comment: string read GetComment write SetComment;
    property CompressedLength: LongWord read GetCompressedLength;
    property CompressedLength64: Int64 read GetCompressedLength64;
    property CompressedLengthStr: string read GetCompressedLengthStr;
    property CompressionLevel: Integer read GetCompressionLevel write SetCompressionLevel;
    property CompressionMethod: Integer read GetCompressionMethod write SetCompressionMethod;
    property Crc: Integer read GetCrc;
    property EntryID: Integer read GetEntryID;
    property EntryType: Integer read GetEntryType;
    property FileDateTimeStr: string read GetFileDateTimeStr write SetFileDateTimeStr;
    property FileName: string read GetFileName write SetFileName;
    property FileNameHex: string read GetFileNameHex;
    property HeartbeatMs: Integer read GetHeartbeatMs write SetHeartbeatMs;
    property IsDirectory: Boolean read GetIsDirectory;
    property TextFlag: Boolean read GetTextFlag write SetTextFlag;
    property UncompressedLength: LongWord read GetUncompressedLength;
    property UncompressedLength64: Int64 read GetUncompressedLength64;
    property UncompressedLengthStr: string read GetUncompressedLengthStr;
    property IsAesEncrypted: Boolean read GetIsAesEncrypted;
    property EncryptionKeyLen: Integer read GetEncryptionKeyLen;

    { Event callbacks.  Return True from OnAbortCheck / OnPercentDone
      to abort the running method.  Callbacks are invoked on the
      thread that called the Chilkat method.  The HeartbeatMs
      property controls the AbortCheck frequency. }
    property OnAbortCheck: TChilkatAbortCheckEvent read FOnAbortCheck write SetOnAbortCheck;
    property OnPercentDone: TChilkatPercentDoneEvent read FOnPercentDone write SetOnPercentDone;
    property OnProgressInfo: TChilkatProgressInfoEvent read FOnProgressInfo write SetOnProgressInfo;

    function  AppendString(const strContent: string; const charset: string): Boolean;
    function  CopyToBase64: string;
    function  CopyToHex: string;
    function  Extract(const dirPath: string): Boolean;
    function  ExtractInto(const dirPath: string): Boolean;
    function  ReplaceString(const strContent: string; const charset: string): Boolean;
    procedure SetDt(dt: TChilkatBase);
    function  UnzipToString(lineEndingBehavior: Integer; const srcCharset: string): string;
    function  UnzipToStream(toStream: TChilkatBase): Boolean;
    function  UnzipToBd(binData: TChilkatBase): Boolean;
    function  UnzipToSb(lineEndingBehavior: Integer; const srcCharset: string; sb: TChilkatBase): Boolean;
    function  GetNextMatch(const pattern: string): Boolean;
    function  GetNext: Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkZipEntry_Create  = function(): Pointer; cdecl;
  TCkZipEntry_Dispose = procedure(handle: Pointer); cdecl;
  TCkBridgeAbortCheckCb   = function(userData: Pointer): Integer; cdecl;
  TCkBridgePercentDoneCb  = function(pctDone: Integer; userData: Pointer): Integer; cdecl;
  TCkBridgeProgressInfoCb = procedure(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
  TCkZipEntry_SetAbortCheckCallback   = procedure(handle: Pointer; cb: TCkBridgeAbortCheckCb; userData: Pointer); cdecl;
  TCkZipEntry_SetPercentDoneCallback  = procedure(handle: Pointer; cb: TCkBridgePercentDoneCb; userData: Pointer); cdecl;
  TCkZipEntry_SetProgressInfoCallback = procedure(handle: Pointer; cb: TCkBridgeProgressInfoCb; userData: Pointer); cdecl;
  TCkZipEntry_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkZipEntry_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkZipEntry_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkZipEntry_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkZipEntry_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkZipEntry_get_Comment = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_put_Comment = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkZipEntry_get_CompressedLength = function(handle: Pointer): LongWord; cdecl;
  TCkZipEntry_get_CompressedLength64 = function(handle: Pointer): Int64; cdecl;
  TCkZipEntry_get_CompressedLengthStr = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_get_CompressionLevel = function(handle: Pointer): Integer; cdecl;
  TCkZipEntry_put_CompressionLevel = procedure(handle: Pointer; value: Integer); cdecl;
  TCkZipEntry_get_CompressionMethod = function(handle: Pointer): Integer; cdecl;
  TCkZipEntry_put_CompressionMethod = procedure(handle: Pointer; value: Integer); cdecl;
  TCkZipEntry_get_Crc = function(handle: Pointer): Integer; cdecl;
  TCkZipEntry_get_EntryID = function(handle: Pointer): Integer; cdecl;
  TCkZipEntry_get_EntryType = function(handle: Pointer): Integer; cdecl;
  TCkZipEntry_get_FileDateTimeStr = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_put_FileDateTimeStr = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkZipEntry_get_FileName = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_put_FileName = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkZipEntry_get_FileNameHex = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_get_HeartbeatMs = function(handle: Pointer): Integer; cdecl;
  TCkZipEntry_put_HeartbeatMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkZipEntry_get_IsDirectory = function(handle: Pointer): LongBool; cdecl;
  TCkZipEntry_get_TextFlag = function(handle: Pointer): LongBool; cdecl;
  TCkZipEntry_put_TextFlag = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkZipEntry_get_UncompressedLength = function(handle: Pointer): LongWord; cdecl;
  TCkZipEntry_get_UncompressedLength64 = function(handle: Pointer): Int64; cdecl;
  TCkZipEntry_get_UncompressedLengthStr = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_get_IsAesEncrypted = function(handle: Pointer): LongBool; cdecl;
  TCkZipEntry_get_EncryptionKeyLen = function(handle: Pointer): Integer; cdecl;
  TCkZipEntry_AppendString = function(handle: Pointer; strContent: PAnsiChar; charset: PAnsiChar): LongBool; cdecl;
  TCkZipEntry_CopyToBase64 = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_CopyToHex = function(handle: Pointer): PAnsiChar; cdecl;
  TCkZipEntry_Extract = function(handle: Pointer; dirPath: PAnsiChar): LongBool; cdecl;
  TCkZipEntry_ExtractInto = function(handle: Pointer; dirPath: PAnsiChar): LongBool; cdecl;
  TCkZipEntry_ReplaceString = function(handle: Pointer; strContent: PAnsiChar; charset: PAnsiChar): LongBool; cdecl;
  TCkZipEntry_SetDt = procedure(handle: Pointer; dt: Pointer); cdecl;
  TCkZipEntry_UnzipToString = function(handle: Pointer; lineEndingBehavior: Integer; srcCharset: PAnsiChar): PAnsiChar; cdecl;
  TCkZipEntry_UnzipToStream = function(handle: Pointer; toStream: Pointer): LongBool; cdecl;
  TCkZipEntry_UnzipToBd = function(handle: Pointer; binData: Pointer): LongBool; cdecl;
  TCkZipEntry_UnzipToSb = function(handle: Pointer; lineEndingBehavior: Integer; srcCharset: PAnsiChar; sb: Pointer): LongBool; cdecl;
  TCkZipEntry_GetNextMatch = function(handle: Pointer; pattern: PAnsiChar): LongBool; cdecl;
  TCkZipEntry_GetNext = function(handle: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkZipEntry_Create:  TCkZipEntry_Create  = nil;
  CkZipEntry_Dispose: TCkZipEntry_Dispose = nil;
  CkZipEntry_SetAbortCheckCallback:   TCkZipEntry_SetAbortCheckCallback   = nil;
  CkZipEntry_SetPercentDoneCallback:  TCkZipEntry_SetPercentDoneCallback  = nil;
  CkZipEntry_SetProgressInfoCallback: TCkZipEntry_SetProgressInfoCallback = nil;
  CkZipEntry_get_LastErrorHtml: TCkZipEntry_get_LastErrorHtml = nil;
  CkZipEntry_get_LastErrorText: TCkZipEntry_get_LastErrorText = nil;
  CkZipEntry_get_LastErrorXml: TCkZipEntry_get_LastErrorXml = nil;
  CkZipEntry_get_Version: TCkZipEntry_get_Version = nil;
  CkZipEntry_get_DebugLogFilePath: TCkZipEntry_get_DebugLogFilePath = nil;
  CkZipEntry_put_DebugLogFilePath: TCkZipEntry_put_DebugLogFilePath = nil;
  CkZipEntry_get_VerboseLogging: TCkZipEntry_get_VerboseLogging = nil;
  CkZipEntry_put_VerboseLogging: TCkZipEntry_put_VerboseLogging = nil;
  CkZipEntry_get_LastMethodSuccess: TCkZipEntry_get_LastMethodSuccess = nil;
  CkZipEntry_put_LastMethodSuccess: TCkZipEntry_put_LastMethodSuccess = nil;
  CkZipEntry_get_Comment: TCkZipEntry_get_Comment = nil;
  CkZipEntry_put_Comment: TCkZipEntry_put_Comment = nil;
  CkZipEntry_get_CompressedLength: TCkZipEntry_get_CompressedLength = nil;
  CkZipEntry_get_CompressedLength64: TCkZipEntry_get_CompressedLength64 = nil;
  CkZipEntry_get_CompressedLengthStr: TCkZipEntry_get_CompressedLengthStr = nil;
  CkZipEntry_get_CompressionLevel: TCkZipEntry_get_CompressionLevel = nil;
  CkZipEntry_put_CompressionLevel: TCkZipEntry_put_CompressionLevel = nil;
  CkZipEntry_get_CompressionMethod: TCkZipEntry_get_CompressionMethod = nil;
  CkZipEntry_put_CompressionMethod: TCkZipEntry_put_CompressionMethod = nil;
  CkZipEntry_get_Crc: TCkZipEntry_get_Crc = nil;
  CkZipEntry_get_EntryID: TCkZipEntry_get_EntryID = nil;
  CkZipEntry_get_EntryType: TCkZipEntry_get_EntryType = nil;
  CkZipEntry_get_FileDateTimeStr: TCkZipEntry_get_FileDateTimeStr = nil;
  CkZipEntry_put_FileDateTimeStr: TCkZipEntry_put_FileDateTimeStr = nil;
  CkZipEntry_get_FileName: TCkZipEntry_get_FileName = nil;
  CkZipEntry_put_FileName: TCkZipEntry_put_FileName = nil;
  CkZipEntry_get_FileNameHex: TCkZipEntry_get_FileNameHex = nil;
  CkZipEntry_get_HeartbeatMs: TCkZipEntry_get_HeartbeatMs = nil;
  CkZipEntry_put_HeartbeatMs: TCkZipEntry_put_HeartbeatMs = nil;
  CkZipEntry_get_IsDirectory: TCkZipEntry_get_IsDirectory = nil;
  CkZipEntry_get_TextFlag: TCkZipEntry_get_TextFlag = nil;
  CkZipEntry_put_TextFlag: TCkZipEntry_put_TextFlag = nil;
  CkZipEntry_get_UncompressedLength: TCkZipEntry_get_UncompressedLength = nil;
  CkZipEntry_get_UncompressedLength64: TCkZipEntry_get_UncompressedLength64 = nil;
  CkZipEntry_get_UncompressedLengthStr: TCkZipEntry_get_UncompressedLengthStr = nil;
  CkZipEntry_get_IsAesEncrypted: TCkZipEntry_get_IsAesEncrypted = nil;
  CkZipEntry_get_EncryptionKeyLen: TCkZipEntry_get_EncryptionKeyLen = nil;
  CkZipEntry_AppendString: TCkZipEntry_AppendString = nil;
  CkZipEntry_CopyToBase64: TCkZipEntry_CopyToBase64 = nil;
  CkZipEntry_CopyToHex: TCkZipEntry_CopyToHex = nil;
  CkZipEntry_Extract: TCkZipEntry_Extract = nil;
  CkZipEntry_ExtractInto: TCkZipEntry_ExtractInto = nil;
  CkZipEntry_ReplaceString: TCkZipEntry_ReplaceString = nil;
  CkZipEntry_SetDt: TCkZipEntry_SetDt = nil;
  CkZipEntry_UnzipToString: TCkZipEntry_UnzipToString = nil;
  CkZipEntry_UnzipToStream: TCkZipEntry_UnzipToStream = nil;
  CkZipEntry_UnzipToBd: TCkZipEntry_UnzipToBd = nil;
  CkZipEntry_UnzipToSb: TCkZipEntry_UnzipToSb = nil;
  CkZipEntry_GetNextMatch: TCkZipEntry_GetNextMatch = nil;
  CkZipEntry_GetNext: TCkZipEntry_GetNext = nil;

constructor TZipEntry.Create;
begin
  inherited Create;
  FHandle := CkZipEntry_Create();
end;

destructor TZipEntry.Destroy;
begin
  if FHandle <> nil then
    CkZipEntry_Dispose(FHandle);
  FHandle := nil;
  inherited;
end;

{ ---- Event callback thunks ---- }
{ Standalone cdecl functions registered with the C bridge.  The bridge
  passes back the userData pointer, which carries the Pascal object
  instance.  A non-zero return value aborts the running method. }

function TZipEntry_AbortCheckThunk(userData: Pointer): Integer; cdecl;
var
  obj: TZipEntry;
begin
  Result := 0;
  obj := TZipEntry(userData);
  if Assigned(obj) and Assigned(obj.FOnAbortCheck) then
    if obj.FOnAbortCheck(obj) then Result := 1;
end;

function TZipEntry_PercentDoneThunk(pctDone: Integer; userData: Pointer): Integer; cdecl;
var
  obj: TZipEntry;
begin
  Result := 0;
  obj := TZipEntry(userData);
  if Assigned(obj) and Assigned(obj.FOnPercentDone) then
    if obj.FOnPercentDone(obj, pctDone) then Result := 1;
end;

procedure TZipEntry_ProgressInfoThunk(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
var
  obj: TZipEntry;
begin
  obj := TZipEntry(userData);
  if Assigned(obj) and Assigned(obj.FOnProgressInfo) then
    obj.FOnProgressInfo(obj, CkToStr(name), CkToStr(value));
end;

procedure TZipEntry.SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
begin
  FOnAbortCheck := AValue;
  if Assigned(AValue) then
    CkZipEntry_SetAbortCheckCallback(FHandle, @TZipEntry_AbortCheckThunk, Self)
  else
    CkZipEntry_SetAbortCheckCallback(FHandle, nil, nil);
end;

procedure TZipEntry.SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
begin
  FOnPercentDone := AValue;
  if Assigned(AValue) then
    CkZipEntry_SetPercentDoneCallback(FHandle, @TZipEntry_PercentDoneThunk, Self)
  else
    CkZipEntry_SetPercentDoneCallback(FHandle, nil, nil);
end;

procedure TZipEntry.SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
begin
  FOnProgressInfo := AValue;
  if Assigned(AValue) then
    CkZipEntry_SetProgressInfoCallback(FHandle, @TZipEntry_ProgressInfoThunk, Self)
  else
    CkZipEntry_SetProgressInfoCallback(FHandle, nil, nil);
end;

function TZipEntry.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkZipEntry_get_LastErrorHtml(FHandle));
end;

function TZipEntry.GetLastErrorText: string;
begin
  Result := CkToStr(CkZipEntry_get_LastErrorText(FHandle));
end;

function TZipEntry.GetLastErrorXml: string;
begin
  Result := CkToStr(CkZipEntry_get_LastErrorXml(FHandle));
end;

function TZipEntry.GetVersion: string;
begin
  Result := CkToStr(CkZipEntry_get_Version(FHandle));
end;

function TZipEntry.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkZipEntry_get_DebugLogFilePath(FHandle));
end;

procedure TZipEntry.SetDebugLogFilePath(AValue: string);
begin
  CkZipEntry_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TZipEntry.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkZipEntry_get_VerboseLogging(FHandle));
end;

procedure TZipEntry.SetVerboseLogging(AValue: Boolean);
begin
  CkZipEntry_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TZipEntry.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkZipEntry_get_LastMethodSuccess(FHandle));
end;

procedure TZipEntry.SetLastMethodSuccess(AValue: Boolean);
begin
  CkZipEntry_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TZipEntry.GetComment: string;
begin
  Result := CkToStr(CkZipEntry_get_Comment(FHandle));
end;

procedure TZipEntry.SetComment(AValue: string);
begin
  CkZipEntry_put_Comment(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TZipEntry.GetCompressedLength: LongWord;
begin
  Result := CkZipEntry_get_CompressedLength(FHandle);
end;

function TZipEntry.GetCompressedLength64: Int64;
begin
  Result := CkZipEntry_get_CompressedLength64(FHandle);
end;

function TZipEntry.GetCompressedLengthStr: string;
begin
  Result := CkToStr(CkZipEntry_get_CompressedLengthStr(FHandle));
end;

function TZipEntry.GetCompressionLevel: Integer;
begin
  Result := CkZipEntry_get_CompressionLevel(FHandle);
end;

procedure TZipEntry.SetCompressionLevel(AValue: Integer);
begin
  CkZipEntry_put_CompressionLevel(FHandle, AValue);
end;

function TZipEntry.GetCompressionMethod: Integer;
begin
  Result := CkZipEntry_get_CompressionMethod(FHandle);
end;

procedure TZipEntry.SetCompressionMethod(AValue: Integer);
begin
  CkZipEntry_put_CompressionMethod(FHandle, AValue);
end;

function TZipEntry.GetCrc: Integer;
begin
  Result := CkZipEntry_get_Crc(FHandle);
end;

function TZipEntry.GetEntryID: Integer;
begin
  Result := CkZipEntry_get_EntryID(FHandle);
end;

function TZipEntry.GetEntryType: Integer;
begin
  Result := CkZipEntry_get_EntryType(FHandle);
end;

function TZipEntry.GetFileDateTimeStr: string;
begin
  Result := CkToStr(CkZipEntry_get_FileDateTimeStr(FHandle));
end;

procedure TZipEntry.SetFileDateTimeStr(AValue: string);
begin
  CkZipEntry_put_FileDateTimeStr(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TZipEntry.GetFileName: string;
begin
  Result := CkToStr(CkZipEntry_get_FileName(FHandle));
end;

procedure TZipEntry.SetFileName(AValue: string);
begin
  CkZipEntry_put_FileName(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TZipEntry.GetFileNameHex: string;
begin
  Result := CkToStr(CkZipEntry_get_FileNameHex(FHandle));
end;

function TZipEntry.GetHeartbeatMs: Integer;
begin
  Result := CkZipEntry_get_HeartbeatMs(FHandle);
end;

procedure TZipEntry.SetHeartbeatMs(AValue: Integer);
begin
  CkZipEntry_put_HeartbeatMs(FHandle, AValue);
end;

function TZipEntry.GetIsDirectory: Boolean;
begin
  Result := Boolean(CkZipEntry_get_IsDirectory(FHandle));
end;

function TZipEntry.GetTextFlag: Boolean;
begin
  Result := Boolean(CkZipEntry_get_TextFlag(FHandle));
end;

procedure TZipEntry.SetTextFlag(AValue: Boolean);
begin
  CkZipEntry_put_TextFlag(FHandle, LongBool(AValue));
end;

function TZipEntry.GetUncompressedLength: LongWord;
begin
  Result := CkZipEntry_get_UncompressedLength(FHandle);
end;

function TZipEntry.GetUncompressedLength64: Int64;
begin
  Result := CkZipEntry_get_UncompressedLength64(FHandle);
end;

function TZipEntry.GetUncompressedLengthStr: string;
begin
  Result := CkToStr(CkZipEntry_get_UncompressedLengthStr(FHandle));
end;

function TZipEntry.GetIsAesEncrypted: Boolean;
begin
  Result := Boolean(CkZipEntry_get_IsAesEncrypted(FHandle));
end;

function TZipEntry.GetEncryptionKeyLen: Integer;
begin
  Result := CkZipEntry_get_EncryptionKeyLen(FHandle);
end;

function TZipEntry.AppendString(const strContent: string; const charset: string): Boolean;
begin
  Result := Boolean(CkZipEntry_AppendString(FHandle, PAnsiChar(StrToCk(strContent)), PAnsiChar(StrToCk(charset))));
end;

function TZipEntry.CopyToBase64: string;
begin
  Result := CkToStr(CkZipEntry_CopyToBase64(FHandle));
end;

function TZipEntry.CopyToHex: string;
begin
  Result := CkToStr(CkZipEntry_CopyToHex(FHandle));
end;

function TZipEntry.Extract(const dirPath: string): Boolean;
begin
  Result := Boolean(CkZipEntry_Extract(FHandle, PAnsiChar(StrToCk(dirPath))));
end;

function TZipEntry.ExtractInto(const dirPath: string): Boolean;
begin
  Result := Boolean(CkZipEntry_ExtractInto(FHandle, PAnsiChar(StrToCk(dirPath))));
end;

function TZipEntry.ReplaceString(const strContent: string; const charset: string): Boolean;
begin
  Result := Boolean(CkZipEntry_ReplaceString(FHandle, PAnsiChar(StrToCk(strContent)), PAnsiChar(StrToCk(charset))));
end;

procedure TZipEntry.SetDt(dt: TChilkatBase);
begin
  CkZipEntry_SetDt(FHandle, dt.Handle);
end;

function TZipEntry.UnzipToString(lineEndingBehavior: Integer; const srcCharset: string): string;
begin
  Result := CkToStr(CkZipEntry_UnzipToString(FHandle, lineEndingBehavior, PAnsiChar(StrToCk(srcCharset))));
end;

function TZipEntry.UnzipToStream(toStream: TChilkatBase): Boolean;
begin
  Result := Boolean(CkZipEntry_UnzipToStream(FHandle, toStream.Handle));
end;

function TZipEntry.UnzipToBd(binData: TChilkatBase): Boolean;
begin
  Result := Boolean(CkZipEntry_UnzipToBd(FHandle, binData.Handle));
end;

function TZipEntry.UnzipToSb(lineEndingBehavior: Integer; const srcCharset: string; sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkZipEntry_UnzipToSb(FHandle, lineEndingBehavior, PAnsiChar(StrToCk(srcCharset)), sb.Handle));
end;

function TZipEntry.GetNextMatch(const pattern: string): Boolean;
begin
  Result := Boolean(CkZipEntry_GetNextMatch(FHandle, PAnsiChar(StrToCk(pattern))));
end;

function TZipEntry.GetNext: Boolean;
begin
  Result := Boolean(CkZipEntry_GetNext(FHandle));
end;

initialization
  Chilkat_GetProcedureAddress(CkZipEntry_Create,  'CkZipEntry_Create');
  Chilkat_GetProcedureAddress(CkZipEntry_Dispose, 'CkZipEntry_Dispose');
  Chilkat_GetProcedureAddress(CkZipEntry_SetAbortCheckCallback, 'CkZipEntry_SetAbortCheckCallback');
  Chilkat_GetProcedureAddress(CkZipEntry_SetPercentDoneCallback, 'CkZipEntry_SetPercentDoneCallback');
  Chilkat_GetProcedureAddress(CkZipEntry_SetProgressInfoCallback, 'CkZipEntry_SetProgressInfoCallback');
  Chilkat_GetProcedureAddress(CkZipEntry_get_LastErrorHtml, 'CkZipEntry_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkZipEntry_get_LastErrorText, 'CkZipEntry_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkZipEntry_get_LastErrorXml, 'CkZipEntry_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkZipEntry_get_Version, 'CkZipEntry_get_Version');
  Chilkat_GetProcedureAddress(CkZipEntry_get_DebugLogFilePath, 'CkZipEntry_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkZipEntry_put_DebugLogFilePath, 'CkZipEntry_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkZipEntry_get_VerboseLogging, 'CkZipEntry_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkZipEntry_put_VerboseLogging, 'CkZipEntry_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkZipEntry_get_LastMethodSuccess, 'CkZipEntry_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkZipEntry_put_LastMethodSuccess, 'CkZipEntry_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkZipEntry_get_Comment, 'CkZipEntry_get_Comment');
  Chilkat_GetProcedureAddress(CkZipEntry_put_Comment, 'CkZipEntry_put_Comment');
  Chilkat_GetProcedureAddress(CkZipEntry_get_CompressedLength, 'CkZipEntry_get_CompressedLength');
  Chilkat_GetProcedureAddress(CkZipEntry_get_CompressedLength64, 'CkZipEntry_get_CompressedLength64');
  Chilkat_GetProcedureAddress(CkZipEntry_get_CompressedLengthStr, 'CkZipEntry_get_CompressedLengthStr');
  Chilkat_GetProcedureAddress(CkZipEntry_get_CompressionLevel, 'CkZipEntry_get_CompressionLevel');
  Chilkat_GetProcedureAddress(CkZipEntry_put_CompressionLevel, 'CkZipEntry_put_CompressionLevel');
  Chilkat_GetProcedureAddress(CkZipEntry_get_CompressionMethod, 'CkZipEntry_get_CompressionMethod');
  Chilkat_GetProcedureAddress(CkZipEntry_put_CompressionMethod, 'CkZipEntry_put_CompressionMethod');
  Chilkat_GetProcedureAddress(CkZipEntry_get_Crc, 'CkZipEntry_get_Crc');
  Chilkat_GetProcedureAddress(CkZipEntry_get_EntryID, 'CkZipEntry_get_EntryID');
  Chilkat_GetProcedureAddress(CkZipEntry_get_EntryType, 'CkZipEntry_get_EntryType');
  Chilkat_GetProcedureAddress(CkZipEntry_get_FileDateTimeStr, 'CkZipEntry_get_FileDateTimeStr');
  Chilkat_GetProcedureAddress(CkZipEntry_put_FileDateTimeStr, 'CkZipEntry_put_FileDateTimeStr');
  Chilkat_GetProcedureAddress(CkZipEntry_get_FileName, 'CkZipEntry_get_FileName');
  Chilkat_GetProcedureAddress(CkZipEntry_put_FileName, 'CkZipEntry_put_FileName');
  Chilkat_GetProcedureAddress(CkZipEntry_get_FileNameHex, 'CkZipEntry_get_FileNameHex');
  Chilkat_GetProcedureAddress(CkZipEntry_get_HeartbeatMs, 'CkZipEntry_get_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkZipEntry_put_HeartbeatMs, 'CkZipEntry_put_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkZipEntry_get_IsDirectory, 'CkZipEntry_get_IsDirectory');
  Chilkat_GetProcedureAddress(CkZipEntry_get_TextFlag, 'CkZipEntry_get_TextFlag');
  Chilkat_GetProcedureAddress(CkZipEntry_put_TextFlag, 'CkZipEntry_put_TextFlag');
  Chilkat_GetProcedureAddress(CkZipEntry_get_UncompressedLength, 'CkZipEntry_get_UncompressedLength');
  Chilkat_GetProcedureAddress(CkZipEntry_get_UncompressedLength64, 'CkZipEntry_get_UncompressedLength64');
  Chilkat_GetProcedureAddress(CkZipEntry_get_UncompressedLengthStr, 'CkZipEntry_get_UncompressedLengthStr');
  Chilkat_GetProcedureAddress(CkZipEntry_get_IsAesEncrypted, 'CkZipEntry_get_IsAesEncrypted');
  Chilkat_GetProcedureAddress(CkZipEntry_get_EncryptionKeyLen, 'CkZipEntry_get_EncryptionKeyLen');
  Chilkat_GetProcedureAddress(CkZipEntry_AppendString, 'CkZipEntry_AppendString');
  Chilkat_GetProcedureAddress(CkZipEntry_CopyToBase64, 'CkZipEntry_CopyToBase64');
  Chilkat_GetProcedureAddress(CkZipEntry_CopyToHex, 'CkZipEntry_CopyToHex');
  Chilkat_GetProcedureAddress(CkZipEntry_Extract, 'CkZipEntry_Extract');
  Chilkat_GetProcedureAddress(CkZipEntry_ExtractInto, 'CkZipEntry_ExtractInto');
  Chilkat_GetProcedureAddress(CkZipEntry_ReplaceString, 'CkZipEntry_ReplaceString');
  Chilkat_GetProcedureAddress(CkZipEntry_SetDt, 'CkZipEntry_SetDt');
  Chilkat_GetProcedureAddress(CkZipEntry_UnzipToString, 'CkZipEntry_UnzipToString');
  Chilkat_GetProcedureAddress(CkZipEntry_UnzipToStream, 'CkZipEntry_UnzipToStream');
  Chilkat_GetProcedureAddress(CkZipEntry_UnzipToBd, 'CkZipEntry_UnzipToBd');
  Chilkat_GetProcedureAddress(CkZipEntry_UnzipToSb, 'CkZipEntry_UnzipToSb');
  Chilkat_GetProcedureAddress(CkZipEntry_GetNextMatch, 'CkZipEntry_GetNextMatch');
  Chilkat_GetProcedureAddress(CkZipEntry_GetNext, 'CkZipEntry_GetNext');

end.
