unit Chilkat.Gzip;

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

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

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TGzip wraps CkGzip via the C bridge layer. }
  TGzip = 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  GetCompressionLevel: Integer;
    procedure SetCompressionLevel(AValue: Integer);
    function  GetExtraData: TBytes;
    procedure SetExtraData(AValue: TBytes);
    function  GetFilename: string;
    procedure SetFilename(AValue: string);
    function  GetHeartbeatMs: Integer;
    procedure SetHeartbeatMs(AValue: Integer);
    function  GetLastModStr: string;
    procedure SetLastModStr(AValue: string);
    function  GetUseCurrentDate: Boolean;
    procedure SetUseCurrentDate(AValue: Boolean);
    function  GetAbortCurrent: Boolean;
    procedure SetAbortCurrent(AValue: Boolean);
    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 CompressionLevel: Integer read GetCompressionLevel write SetCompressionLevel;
    property ExtraData: TBytes read GetExtraData write SetExtraData;
    property Filename: string read GetFilename write SetFilename;
    property HeartbeatMs: Integer read GetHeartbeatMs write SetHeartbeatMs;
    property LastModStr: string read GetLastModStr write SetLastModStr;
    property UseCurrentDate: Boolean read GetUseCurrentDate write SetUseCurrentDate;
    property AbortCurrent: Boolean read GetAbortCurrent write SetAbortCurrent;

    { 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  CompressFile(const srcPath: string; const destPath: string): Boolean;
    function  CompressFile2(const srcPath: string; const embeddedFilename: string; const destPath: string): Boolean;
    function  CompressStringENC(const inStr: string; const charset: string; const encoding: string): string;
    function  CompressStringToFile(const inStr: string; const destCharset: string; const destPath: string): Boolean;
    function  SetDt(dt: TChilkatBase): Boolean;
    function  UnTarGz(const gzPath: string; const destDir: string; bNoAbsolute: Boolean): Boolean;
    function  UncompressFile(const srcPath: string; const destPath: string): Boolean;
    function  UncompressFileToString(const srcPath: string; const charset: string): string;
    function  UncompressStringENC(const inStr: string; const charset: string; const encoding: string): string;
    function  XfdlToXml(const xfldData: string): string;
    function  UncompressBd(binDat: TChilkatBase): Boolean;
    function  CompressBd(binDat: TChilkatBase): Boolean;
    function  SetExtraData(const encodedData: string; const encoding: string): Boolean;
    function  CompressFileBd(const filePath: string; bd: TChilkatBase): Boolean;
    function  CompressSb(sb: TChilkatBase; const charset: string; bd: TChilkatBase): Boolean;
    function  IsGzip(bd: TChilkatBase): Boolean;
    function  UncompressBdToFile(bd: TChilkatBase; const filePath: string): Boolean;
    function  GetGzipInfo(const filePath: string; json: TChilkatBase): Boolean;
    function  GetGzipInfoBd(bd: TChilkatBase; json: TChilkatBase): Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkGzip_Create  = function(): Pointer; cdecl;
  TCkGzip_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;
  TCkGzip_SetAbortCheckCallback   = procedure(handle: Pointer; cb: TCkBridgeAbortCheckCb; userData: Pointer); cdecl;
  TCkGzip_SetPercentDoneCallback  = procedure(handle: Pointer; cb: TCkBridgePercentDoneCb; userData: Pointer); cdecl;
  TCkGzip_SetProgressInfoCallback = procedure(handle: Pointer; cb: TCkBridgeProgressInfoCb; userData: Pointer); cdecl;
  TCkGzip_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkGzip_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkGzip_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkGzip_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkGzip_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkGzip_get_Comment = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_put_Comment = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkGzip_get_CompressionLevel = function(handle: Pointer): Integer; cdecl;
  TCkGzip_put_CompressionLevel = procedure(handle: Pointer; value: Integer); cdecl;
  TCkGzip_get_ExtraData = function(handle: Pointer): Pointer; cdecl;
  TCkGzip_put_ExtraData = procedure(handle: Pointer; value: Pointer); cdecl;
  TCkGzip_get_Filename = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_put_Filename = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkGzip_get_HeartbeatMs = function(handle: Pointer): Integer; cdecl;
  TCkGzip_put_HeartbeatMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkGzip_get_LastModStr = function(handle: Pointer): PAnsiChar; cdecl;
  TCkGzip_put_LastModStr = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkGzip_get_UseCurrentDate = function(handle: Pointer): LongBool; cdecl;
  TCkGzip_put_UseCurrentDate = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkGzip_get_AbortCurrent = function(handle: Pointer): LongBool; cdecl;
  TCkGzip_put_AbortCurrent = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkGzip_CompressFile = function(handle: Pointer; srcPath: PAnsiChar; destPath: PAnsiChar): LongBool; cdecl;
  TCkGzip_CompressFile2 = function(handle: Pointer; srcPath: PAnsiChar; embeddedFilename: PAnsiChar; destPath: PAnsiChar): LongBool; cdecl;
  TCkGzip_CompressStringENC = function(handle: Pointer; inStr: PAnsiChar; charset: PAnsiChar; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkGzip_CompressStringToFile = function(handle: Pointer; inStr: PAnsiChar; destCharset: PAnsiChar; destPath: PAnsiChar): LongBool; cdecl;
  TCkGzip_SetDt = function(handle: Pointer; dt: Pointer): LongBool; cdecl;
  TCkGzip_UnTarGz = function(handle: Pointer; gzPath: PAnsiChar; destDir: PAnsiChar; bNoAbsolute: LongBool): LongBool; cdecl;
  TCkGzip_UncompressFile = function(handle: Pointer; srcPath: PAnsiChar; destPath: PAnsiChar): LongBool; cdecl;
  TCkGzip_UncompressFileToString = function(handle: Pointer; srcPath: PAnsiChar; charset: PAnsiChar): PAnsiChar; cdecl;
  TCkGzip_UncompressStringENC = function(handle: Pointer; inStr: PAnsiChar; charset: PAnsiChar; encoding: PAnsiChar): PAnsiChar; cdecl;
  TCkGzip_XfdlToXml = function(handle: Pointer; xfldData: PAnsiChar): PAnsiChar; cdecl;
  TCkGzip_UncompressBd = function(handle: Pointer; binDat: Pointer): LongBool; cdecl;
  TCkGzip_CompressBd = function(handle: Pointer; binDat: Pointer): LongBool; cdecl;
  TCkGzip_SetExtraData = function(handle: Pointer; encodedData: PAnsiChar; encoding: PAnsiChar): LongBool; cdecl;
  TCkGzip_CompressFileBd = function(handle: Pointer; filePath: PAnsiChar; bd: Pointer): LongBool; cdecl;
  TCkGzip_CompressSb = function(handle: Pointer; sb: Pointer; charset: PAnsiChar; bd: Pointer): LongBool; cdecl;
  TCkGzip_IsGzip = function(handle: Pointer; bd: Pointer): LongBool; cdecl;
  TCkGzip_UncompressBdToFile = function(handle: Pointer; bd: Pointer; filePath: PAnsiChar): LongBool; cdecl;
  TCkGzip_GetGzipInfo = function(handle: Pointer; filePath: PAnsiChar; json: Pointer): LongBool; cdecl;
  TCkGzip_GetGzipInfoBd = function(handle: Pointer; bd: Pointer; json: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkGzip_Create:  TCkGzip_Create  = nil;
  CkGzip_Dispose: TCkGzip_Dispose = nil;
  CkGzip_SetAbortCheckCallback:   TCkGzip_SetAbortCheckCallback   = nil;
  CkGzip_SetPercentDoneCallback:  TCkGzip_SetPercentDoneCallback  = nil;
  CkGzip_SetProgressInfoCallback: TCkGzip_SetProgressInfoCallback = nil;
  CkGzip_get_LastErrorHtml: TCkGzip_get_LastErrorHtml = nil;
  CkGzip_get_LastErrorText: TCkGzip_get_LastErrorText = nil;
  CkGzip_get_LastErrorXml: TCkGzip_get_LastErrorXml = nil;
  CkGzip_get_Version: TCkGzip_get_Version = nil;
  CkGzip_get_DebugLogFilePath: TCkGzip_get_DebugLogFilePath = nil;
  CkGzip_put_DebugLogFilePath: TCkGzip_put_DebugLogFilePath = nil;
  CkGzip_get_VerboseLogging: TCkGzip_get_VerboseLogging = nil;
  CkGzip_put_VerboseLogging: TCkGzip_put_VerboseLogging = nil;
  CkGzip_get_LastMethodSuccess: TCkGzip_get_LastMethodSuccess = nil;
  CkGzip_put_LastMethodSuccess: TCkGzip_put_LastMethodSuccess = nil;
  CkGzip_get_Comment: TCkGzip_get_Comment = nil;
  CkGzip_put_Comment: TCkGzip_put_Comment = nil;
  CkGzip_get_CompressionLevel: TCkGzip_get_CompressionLevel = nil;
  CkGzip_put_CompressionLevel: TCkGzip_put_CompressionLevel = nil;
  CkGzip_get_ExtraData: TCkGzip_get_ExtraData = nil;
  CkGzip_put_ExtraData: TCkGzip_put_ExtraData = nil;
  CkGzip_get_Filename: TCkGzip_get_Filename = nil;
  CkGzip_put_Filename: TCkGzip_put_Filename = nil;
  CkGzip_get_HeartbeatMs: TCkGzip_get_HeartbeatMs = nil;
  CkGzip_put_HeartbeatMs: TCkGzip_put_HeartbeatMs = nil;
  CkGzip_get_LastModStr: TCkGzip_get_LastModStr = nil;
  CkGzip_put_LastModStr: TCkGzip_put_LastModStr = nil;
  CkGzip_get_UseCurrentDate: TCkGzip_get_UseCurrentDate = nil;
  CkGzip_put_UseCurrentDate: TCkGzip_put_UseCurrentDate = nil;
  CkGzip_get_AbortCurrent: TCkGzip_get_AbortCurrent = nil;
  CkGzip_put_AbortCurrent: TCkGzip_put_AbortCurrent = nil;
  CkGzip_CompressFile: TCkGzip_CompressFile = nil;
  CkGzip_CompressFile2: TCkGzip_CompressFile2 = nil;
  CkGzip_CompressStringENC: TCkGzip_CompressStringENC = nil;
  CkGzip_CompressStringToFile: TCkGzip_CompressStringToFile = nil;
  CkGzip_SetDt: TCkGzip_SetDt = nil;
  CkGzip_UnTarGz: TCkGzip_UnTarGz = nil;
  CkGzip_UncompressFile: TCkGzip_UncompressFile = nil;
  CkGzip_UncompressFileToString: TCkGzip_UncompressFileToString = nil;
  CkGzip_UncompressStringENC: TCkGzip_UncompressStringENC = nil;
  CkGzip_XfdlToXml: TCkGzip_XfdlToXml = nil;
  CkGzip_UncompressBd: TCkGzip_UncompressBd = nil;
  CkGzip_CompressBd: TCkGzip_CompressBd = nil;
  CkGzip_SetExtraData: TCkGzip_SetExtraData = nil;
  CkGzip_CompressFileBd: TCkGzip_CompressFileBd = nil;
  CkGzip_CompressSb: TCkGzip_CompressSb = nil;
  CkGzip_IsGzip: TCkGzip_IsGzip = nil;
  CkGzip_UncompressBdToFile: TCkGzip_UncompressBdToFile = nil;
  CkGzip_GetGzipInfo: TCkGzip_GetGzipInfo = nil;
  CkGzip_GetGzipInfoBd: TCkGzip_GetGzipInfoBd = nil;

constructor TGzip.Create;
begin
  inherited Create;
  FHandle := CkGzip_Create();
end;

destructor TGzip.Destroy;
begin
  if FHandle <> nil then
    CkGzip_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 TGzip_AbortCheckThunk(userData: Pointer): Integer; cdecl;
var
  obj: TGzip;
begin
  Result := 0;
  obj := TGzip(userData);
  if Assigned(obj) and Assigned(obj.FOnAbortCheck) then
    if obj.FOnAbortCheck(obj) then Result := 1;
end;

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

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

procedure TGzip.SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
begin
  FOnAbortCheck := AValue;
  if Assigned(AValue) then
    CkGzip_SetAbortCheckCallback(FHandle, @TGzip_AbortCheckThunk, Self)
  else
    CkGzip_SetAbortCheckCallback(FHandle, nil, nil);
end;

procedure TGzip.SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
begin
  FOnPercentDone := AValue;
  if Assigned(AValue) then
    CkGzip_SetPercentDoneCallback(FHandle, @TGzip_PercentDoneThunk, Self)
  else
    CkGzip_SetPercentDoneCallback(FHandle, nil, nil);
end;

procedure TGzip.SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
begin
  FOnProgressInfo := AValue;
  if Assigned(AValue) then
    CkGzip_SetProgressInfoCallback(FHandle, @TGzip_ProgressInfoThunk, Self)
  else
    CkGzip_SetProgressInfoCallback(FHandle, nil, nil);
end;

function TGzip.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkGzip_get_LastErrorHtml(FHandle));
end;

function TGzip.GetLastErrorText: string;
begin
  Result := CkToStr(CkGzip_get_LastErrorText(FHandle));
end;

function TGzip.GetLastErrorXml: string;
begin
  Result := CkToStr(CkGzip_get_LastErrorXml(FHandle));
end;

function TGzip.GetVersion: string;
begin
  Result := CkToStr(CkGzip_get_Version(FHandle));
end;

function TGzip.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkGzip_get_DebugLogFilePath(FHandle));
end;

procedure TGzip.SetDebugLogFilePath(AValue: string);
begin
  CkGzip_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TGzip.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkGzip_get_VerboseLogging(FHandle));
end;

procedure TGzip.SetVerboseLogging(AValue: Boolean);
begin
  CkGzip_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TGzip.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkGzip_get_LastMethodSuccess(FHandle));
end;

procedure TGzip.SetLastMethodSuccess(AValue: Boolean);
begin
  CkGzip_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TGzip.GetComment: string;
begin
  Result := CkToStr(CkGzip_get_Comment(FHandle));
end;

procedure TGzip.SetComment(AValue: string);
begin
  CkGzip_put_Comment(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TGzip.GetCompressionLevel: Integer;
begin
  Result := CkGzip_get_CompressionLevel(FHandle);
end;

procedure TGzip.SetCompressionLevel(AValue: Integer);
begin
  CkGzip_put_CompressionLevel(FHandle, AValue);
end;

function TGzip.GetExtraData: TBytes;
begin
  Result := CkGzip_get_ExtraData(FHandle);
end;

procedure TGzip.SetExtraData(AValue: TBytes);
begin
  CkGzip_put_ExtraData(FHandle, AValue);
end;

function TGzip.GetFilename: string;
begin
  Result := CkToStr(CkGzip_get_Filename(FHandle));
end;

procedure TGzip.SetFilename(AValue: string);
begin
  CkGzip_put_Filename(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TGzip.GetHeartbeatMs: Integer;
begin
  Result := CkGzip_get_HeartbeatMs(FHandle);
end;

procedure TGzip.SetHeartbeatMs(AValue: Integer);
begin
  CkGzip_put_HeartbeatMs(FHandle, AValue);
end;

function TGzip.GetLastModStr: string;
begin
  Result := CkToStr(CkGzip_get_LastModStr(FHandle));
end;

procedure TGzip.SetLastModStr(AValue: string);
begin
  CkGzip_put_LastModStr(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TGzip.GetUseCurrentDate: Boolean;
begin
  Result := Boolean(CkGzip_get_UseCurrentDate(FHandle));
end;

procedure TGzip.SetUseCurrentDate(AValue: Boolean);
begin
  CkGzip_put_UseCurrentDate(FHandle, LongBool(AValue));
end;

function TGzip.GetAbortCurrent: Boolean;
begin
  Result := Boolean(CkGzip_get_AbortCurrent(FHandle));
end;

procedure TGzip.SetAbortCurrent(AValue: Boolean);
begin
  CkGzip_put_AbortCurrent(FHandle, LongBool(AValue));
end;

function TGzip.CompressFile(const srcPath: string; const destPath: string): Boolean;
begin
  Result := Boolean(CkGzip_CompressFile(FHandle, PAnsiChar(StrToCk(srcPath)), PAnsiChar(StrToCk(destPath))));
end;

function TGzip.CompressFile2(const srcPath: string; const embeddedFilename: string; const destPath: string): Boolean;
begin
  Result := Boolean(CkGzip_CompressFile2(FHandle, PAnsiChar(StrToCk(srcPath)), PAnsiChar(StrToCk(embeddedFilename)), PAnsiChar(StrToCk(destPath))));
end;

function TGzip.CompressStringENC(const inStr: string; const charset: string; const encoding: string): string;
begin
  Result := CkToStr(CkGzip_CompressStringENC(FHandle, PAnsiChar(StrToCk(inStr)), PAnsiChar(StrToCk(charset)), PAnsiChar(StrToCk(encoding))));
end;

function TGzip.CompressStringToFile(const inStr: string; const destCharset: string; const destPath: string): Boolean;
begin
  Result := Boolean(CkGzip_CompressStringToFile(FHandle, PAnsiChar(StrToCk(inStr)), PAnsiChar(StrToCk(destCharset)), PAnsiChar(StrToCk(destPath))));
end;

function TGzip.SetDt(dt: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_SetDt(FHandle, dt.Handle));
end;

function TGzip.UnTarGz(const gzPath: string; const destDir: string; bNoAbsolute: Boolean): Boolean;
begin
  Result := Boolean(CkGzip_UnTarGz(FHandle, PAnsiChar(StrToCk(gzPath)), PAnsiChar(StrToCk(destDir)), LongBool(bNoAbsolute)));
end;

function TGzip.UncompressFile(const srcPath: string; const destPath: string): Boolean;
begin
  Result := Boolean(CkGzip_UncompressFile(FHandle, PAnsiChar(StrToCk(srcPath)), PAnsiChar(StrToCk(destPath))));
end;

function TGzip.UncompressFileToString(const srcPath: string; const charset: string): string;
begin
  Result := CkToStr(CkGzip_UncompressFileToString(FHandle, PAnsiChar(StrToCk(srcPath)), PAnsiChar(StrToCk(charset))));
end;

function TGzip.UncompressStringENC(const inStr: string; const charset: string; const encoding: string): string;
begin
  Result := CkToStr(CkGzip_UncompressStringENC(FHandle, PAnsiChar(StrToCk(inStr)), PAnsiChar(StrToCk(charset)), PAnsiChar(StrToCk(encoding))));
end;

function TGzip.XfdlToXml(const xfldData: string): string;
begin
  Result := CkToStr(CkGzip_XfdlToXml(FHandle, PAnsiChar(StrToCk(xfldData))));
end;

function TGzip.UncompressBd(binDat: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_UncompressBd(FHandle, binDat.Handle));
end;

function TGzip.CompressBd(binDat: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_CompressBd(FHandle, binDat.Handle));
end;

function TGzip.SetExtraData(const encodedData: string; const encoding: string): Boolean;
begin
  Result := Boolean(CkGzip_SetExtraData(FHandle, PAnsiChar(StrToCk(encodedData)), PAnsiChar(StrToCk(encoding))));
end;

function TGzip.CompressFileBd(const filePath: string; bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_CompressFileBd(FHandle, PAnsiChar(StrToCk(filePath)), bd.Handle));
end;

function TGzip.CompressSb(sb: TChilkatBase; const charset: string; bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_CompressSb(FHandle, sb.Handle, PAnsiChar(StrToCk(charset)), bd.Handle));
end;

function TGzip.IsGzip(bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_IsGzip(FHandle, bd.Handle));
end;

function TGzip.UncompressBdToFile(bd: TChilkatBase; const filePath: string): Boolean;
begin
  Result := Boolean(CkGzip_UncompressBdToFile(FHandle, bd.Handle, PAnsiChar(StrToCk(filePath))));
end;

function TGzip.GetGzipInfo(const filePath: string; json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_GetGzipInfo(FHandle, PAnsiChar(StrToCk(filePath)), json.Handle));
end;

function TGzip.GetGzipInfoBd(bd: TChilkatBase; json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkGzip_GetGzipInfoBd(FHandle, bd.Handle, json.Handle));
end;

initialization
  Chilkat_GetProcedureAddress(CkGzip_Create,  'CkGzip_Create');
  Chilkat_GetProcedureAddress(CkGzip_Dispose, 'CkGzip_Dispose');
  Chilkat_GetProcedureAddress(CkGzip_SetAbortCheckCallback, 'CkGzip_SetAbortCheckCallback');
  Chilkat_GetProcedureAddress(CkGzip_SetPercentDoneCallback, 'CkGzip_SetPercentDoneCallback');
  Chilkat_GetProcedureAddress(CkGzip_SetProgressInfoCallback, 'CkGzip_SetProgressInfoCallback');
  Chilkat_GetProcedureAddress(CkGzip_get_LastErrorHtml, 'CkGzip_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkGzip_get_LastErrorText, 'CkGzip_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkGzip_get_LastErrorXml, 'CkGzip_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkGzip_get_Version, 'CkGzip_get_Version');
  Chilkat_GetProcedureAddress(CkGzip_get_DebugLogFilePath, 'CkGzip_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkGzip_put_DebugLogFilePath, 'CkGzip_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkGzip_get_VerboseLogging, 'CkGzip_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkGzip_put_VerboseLogging, 'CkGzip_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkGzip_get_LastMethodSuccess, 'CkGzip_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkGzip_put_LastMethodSuccess, 'CkGzip_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkGzip_get_Comment, 'CkGzip_get_Comment');
  Chilkat_GetProcedureAddress(CkGzip_put_Comment, 'CkGzip_put_Comment');
  Chilkat_GetProcedureAddress(CkGzip_get_CompressionLevel, 'CkGzip_get_CompressionLevel');
  Chilkat_GetProcedureAddress(CkGzip_put_CompressionLevel, 'CkGzip_put_CompressionLevel');
  Chilkat_GetProcedureAddress(CkGzip_get_ExtraData, 'CkGzip_get_ExtraData');
  Chilkat_GetProcedureAddress(CkGzip_put_ExtraData, 'CkGzip_put_ExtraData');
  Chilkat_GetProcedureAddress(CkGzip_get_Filename, 'CkGzip_get_Filename');
  Chilkat_GetProcedureAddress(CkGzip_put_Filename, 'CkGzip_put_Filename');
  Chilkat_GetProcedureAddress(CkGzip_get_HeartbeatMs, 'CkGzip_get_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkGzip_put_HeartbeatMs, 'CkGzip_put_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkGzip_get_LastModStr, 'CkGzip_get_LastModStr');
  Chilkat_GetProcedureAddress(CkGzip_put_LastModStr, 'CkGzip_put_LastModStr');
  Chilkat_GetProcedureAddress(CkGzip_get_UseCurrentDate, 'CkGzip_get_UseCurrentDate');
  Chilkat_GetProcedureAddress(CkGzip_put_UseCurrentDate, 'CkGzip_put_UseCurrentDate');
  Chilkat_GetProcedureAddress(CkGzip_get_AbortCurrent, 'CkGzip_get_AbortCurrent');
  Chilkat_GetProcedureAddress(CkGzip_put_AbortCurrent, 'CkGzip_put_AbortCurrent');
  Chilkat_GetProcedureAddress(CkGzip_CompressFile, 'CkGzip_CompressFile');
  Chilkat_GetProcedureAddress(CkGzip_CompressFile2, 'CkGzip_CompressFile2');
  Chilkat_GetProcedureAddress(CkGzip_CompressStringENC, 'CkGzip_CompressStringENC');
  Chilkat_GetProcedureAddress(CkGzip_CompressStringToFile, 'CkGzip_CompressStringToFile');
  Chilkat_GetProcedureAddress(CkGzip_SetDt, 'CkGzip_SetDt');
  Chilkat_GetProcedureAddress(CkGzip_UnTarGz, 'CkGzip_UnTarGz');
  Chilkat_GetProcedureAddress(CkGzip_UncompressFile, 'CkGzip_UncompressFile');
  Chilkat_GetProcedureAddress(CkGzip_UncompressFileToString, 'CkGzip_UncompressFileToString');
  Chilkat_GetProcedureAddress(CkGzip_UncompressStringENC, 'CkGzip_UncompressStringENC');
  Chilkat_GetProcedureAddress(CkGzip_XfdlToXml, 'CkGzip_XfdlToXml');
  Chilkat_GetProcedureAddress(CkGzip_UncompressBd, 'CkGzip_UncompressBd');
  Chilkat_GetProcedureAddress(CkGzip_CompressBd, 'CkGzip_CompressBd');
  Chilkat_GetProcedureAddress(CkGzip_SetExtraData, 'CkGzip_SetExtraData');
  Chilkat_GetProcedureAddress(CkGzip_CompressFileBd, 'CkGzip_CompressFileBd');
  Chilkat_GetProcedureAddress(CkGzip_CompressSb, 'CkGzip_CompressSb');
  Chilkat_GetProcedureAddress(CkGzip_IsGzip, 'CkGzip_IsGzip');
  Chilkat_GetProcedureAddress(CkGzip_UncompressBdToFile, 'CkGzip_UncompressBdToFile');
  Chilkat_GetProcedureAddress(CkGzip_GetGzipInfo, 'CkGzip_GetGzipInfo');
  Chilkat_GetProcedureAddress(CkGzip_GetGzipInfoBd, 'CkGzip_GetGzipInfoBd');

end.
