unit Chilkat.HttpCurl;

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

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

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { THttpCurl wraps CkHttpCurl via the C bridge layer. }
  THttpCurl = 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  GetStatusCode: Integer;
    function  GetResponseBodyStr: string;
    function  GetResponseFilePath: string;
    procedure SetResponseFilePath(AValue: string);
    function  GetEnableBodyVars: Boolean;
    procedure SetEnableBodyVars(AValue: Boolean);
    function  GetFailReason: Integer;
    function  GetFailedCurl: string;
    function  GetHeartbeatMs: Integer;
    procedure SetHeartbeatMs(AValue: Integer);
    function  GetUncommonOptions: string;
    procedure SetUncommonOptions(AValue: string);
    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 StatusCode: Integer read GetStatusCode;
    property ResponseBodyStr: string read GetResponseBodyStr;
    property ResponseFilePath: string read GetResponseFilePath write SetResponseFilePath;
    property EnableBodyVars: Boolean read GetEnableBodyVars write SetEnableBodyVars;
    property FailReason: Integer read GetFailReason;
    property FailedCurl: string read GetFailedCurl;
    property HeartbeatMs: Integer read GetHeartbeatMs write SetHeartbeatMs;
    property UncommonOptions: string read GetUncommonOptions write SetUncommonOptions;

    { 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  DoYourThing(const targetCurl: string): Boolean;
    function  SetAuth(json: TChilkatBase): Boolean;
    function  ToRawRequest(const curlCommand: string; sb: TChilkatBase): Boolean;
    function  GetResponseSb(sb: TChilkatBase): Boolean;
    function  GetResponseBd(bd: TChilkatBase): Boolean;
    function  GetResponseJson(json: TChilkatBase): Boolean;
    function  GetResponseXml(xml: TChilkatBase): Boolean;
    function  GetResponseJarr(jarr: TChilkatBase): Boolean;
    procedure SetVar(const varName: string; const varValue: string);
    procedure AddTargetOutput(const jsonPath: string; const varName: string);
    procedure ClearVar(const varName: string);
    function  GetVar(const varName: string): string;
    function  AddFunction(const funcName: string; const curl: string): Boolean;
    function  AddOutput(const funcName: string; const jsonPath: string; const varName: string): Boolean;
    function  ExaminePlan(const curl: string; json: TChilkatBase): Boolean;
    procedure GetAllVars(json: TChilkatBase);
    procedure ClearTargetOutput(const varName: string);
    function  VarDefined(const varName: string): Boolean;
    function  AddOutput2(const funcName: string; const arrayPath: string; const wherePath: string; const whereValue: string; caseSensitive: Boolean; const subPath: string; const varName: string): Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkHttpCurl_Create  = function(): Pointer; cdecl;
  TCkHttpCurl_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;
  TCkHttpCurl_SetAbortCheckCallback   = procedure(handle: Pointer; cb: TCkBridgeAbortCheckCb; userData: Pointer); cdecl;
  TCkHttpCurl_SetPercentDoneCallback  = procedure(handle: Pointer; cb: TCkBridgePercentDoneCb; userData: Pointer); cdecl;
  TCkHttpCurl_SetProgressInfoCallback = procedure(handle: Pointer; cb: TCkBridgeProgressInfoCb; userData: Pointer); cdecl;
  TCkHttpCurl_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkHttpCurl_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkHttpCurl_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkHttpCurl_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkHttpCurl_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkHttpCurl_get_StatusCode = function(handle: Pointer): Integer; cdecl;
  TCkHttpCurl_get_ResponseBodyStr = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_get_ResponseFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_put_ResponseFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkHttpCurl_get_EnableBodyVars = function(handle: Pointer): LongBool; cdecl;
  TCkHttpCurl_put_EnableBodyVars = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkHttpCurl_get_FailReason = function(handle: Pointer): Integer; cdecl;
  TCkHttpCurl_get_FailedCurl = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_get_HeartbeatMs = function(handle: Pointer): Integer; cdecl;
  TCkHttpCurl_put_HeartbeatMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkHttpCurl_get_UncommonOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkHttpCurl_put_UncommonOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkHttpCurl_DoYourThing = function(handle: Pointer; targetCurl: PAnsiChar): LongBool; cdecl;
  TCkHttpCurl_SetAuth = function(handle: Pointer; json: Pointer): LongBool; cdecl;
  TCkHttpCurl_ToRawRequest = function(handle: Pointer; curlCommand: PAnsiChar; sb: Pointer): LongBool; cdecl;
  TCkHttpCurl_GetResponseSb = function(handle: Pointer; sb: Pointer): LongBool; cdecl;
  TCkHttpCurl_GetResponseBd = function(handle: Pointer; bd: Pointer): LongBool; cdecl;
  TCkHttpCurl_GetResponseJson = function(handle: Pointer; json: Pointer): LongBool; cdecl;
  TCkHttpCurl_GetResponseXml = function(handle: Pointer; xml: Pointer): LongBool; cdecl;
  TCkHttpCurl_GetResponseJarr = function(handle: Pointer; jarr: Pointer): LongBool; cdecl;
  TCkHttpCurl_SetVar = procedure(handle: Pointer; varName: PAnsiChar; varValue: PAnsiChar); cdecl;
  TCkHttpCurl_AddTargetOutput = procedure(handle: Pointer; jsonPath: PAnsiChar; varName: PAnsiChar); cdecl;
  TCkHttpCurl_ClearVar = procedure(handle: Pointer; varName: PAnsiChar); cdecl;
  TCkHttpCurl_GetVar = function(handle: Pointer; varName: PAnsiChar): PAnsiChar; cdecl;
  TCkHttpCurl_AddFunction = function(handle: Pointer; funcName: PAnsiChar; curl: PAnsiChar): LongBool; cdecl;
  TCkHttpCurl_AddOutput = function(handle: Pointer; funcName: PAnsiChar; jsonPath: PAnsiChar; varName: PAnsiChar): LongBool; cdecl;
  TCkHttpCurl_ExaminePlan = function(handle: Pointer; curl: PAnsiChar; json: Pointer): LongBool; cdecl;
  TCkHttpCurl_GetAllVars = procedure(handle: Pointer; json: Pointer); cdecl;
  TCkHttpCurl_ClearTargetOutput = procedure(handle: Pointer; varName: PAnsiChar); cdecl;
  TCkHttpCurl_VarDefined = function(handle: Pointer; varName: PAnsiChar): LongBool; cdecl;
  TCkHttpCurl_AddOutput2 = function(handle: Pointer; funcName: PAnsiChar; arrayPath: PAnsiChar; wherePath: PAnsiChar; whereValue: PAnsiChar; caseSensitive: LongBool; subPath: PAnsiChar; varName: PAnsiChar): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkHttpCurl_Create:  TCkHttpCurl_Create  = nil;
  CkHttpCurl_Dispose: TCkHttpCurl_Dispose = nil;
  CkHttpCurl_SetAbortCheckCallback:   TCkHttpCurl_SetAbortCheckCallback   = nil;
  CkHttpCurl_SetPercentDoneCallback:  TCkHttpCurl_SetPercentDoneCallback  = nil;
  CkHttpCurl_SetProgressInfoCallback: TCkHttpCurl_SetProgressInfoCallback = nil;
  CkHttpCurl_get_LastErrorHtml: TCkHttpCurl_get_LastErrorHtml = nil;
  CkHttpCurl_get_LastErrorText: TCkHttpCurl_get_LastErrorText = nil;
  CkHttpCurl_get_LastErrorXml: TCkHttpCurl_get_LastErrorXml = nil;
  CkHttpCurl_get_Version: TCkHttpCurl_get_Version = nil;
  CkHttpCurl_get_DebugLogFilePath: TCkHttpCurl_get_DebugLogFilePath = nil;
  CkHttpCurl_put_DebugLogFilePath: TCkHttpCurl_put_DebugLogFilePath = nil;
  CkHttpCurl_get_VerboseLogging: TCkHttpCurl_get_VerboseLogging = nil;
  CkHttpCurl_put_VerboseLogging: TCkHttpCurl_put_VerboseLogging = nil;
  CkHttpCurl_get_LastMethodSuccess: TCkHttpCurl_get_LastMethodSuccess = nil;
  CkHttpCurl_put_LastMethodSuccess: TCkHttpCurl_put_LastMethodSuccess = nil;
  CkHttpCurl_get_StatusCode: TCkHttpCurl_get_StatusCode = nil;
  CkHttpCurl_get_ResponseBodyStr: TCkHttpCurl_get_ResponseBodyStr = nil;
  CkHttpCurl_get_ResponseFilePath: TCkHttpCurl_get_ResponseFilePath = nil;
  CkHttpCurl_put_ResponseFilePath: TCkHttpCurl_put_ResponseFilePath = nil;
  CkHttpCurl_get_EnableBodyVars: TCkHttpCurl_get_EnableBodyVars = nil;
  CkHttpCurl_put_EnableBodyVars: TCkHttpCurl_put_EnableBodyVars = nil;
  CkHttpCurl_get_FailReason: TCkHttpCurl_get_FailReason = nil;
  CkHttpCurl_get_FailedCurl: TCkHttpCurl_get_FailedCurl = nil;
  CkHttpCurl_get_HeartbeatMs: TCkHttpCurl_get_HeartbeatMs = nil;
  CkHttpCurl_put_HeartbeatMs: TCkHttpCurl_put_HeartbeatMs = nil;
  CkHttpCurl_get_UncommonOptions: TCkHttpCurl_get_UncommonOptions = nil;
  CkHttpCurl_put_UncommonOptions: TCkHttpCurl_put_UncommonOptions = nil;
  CkHttpCurl_DoYourThing: TCkHttpCurl_DoYourThing = nil;
  CkHttpCurl_SetAuth: TCkHttpCurl_SetAuth = nil;
  CkHttpCurl_ToRawRequest: TCkHttpCurl_ToRawRequest = nil;
  CkHttpCurl_GetResponseSb: TCkHttpCurl_GetResponseSb = nil;
  CkHttpCurl_GetResponseBd: TCkHttpCurl_GetResponseBd = nil;
  CkHttpCurl_GetResponseJson: TCkHttpCurl_GetResponseJson = nil;
  CkHttpCurl_GetResponseXml: TCkHttpCurl_GetResponseXml = nil;
  CkHttpCurl_GetResponseJarr: TCkHttpCurl_GetResponseJarr = nil;
  CkHttpCurl_SetVar: TCkHttpCurl_SetVar = nil;
  CkHttpCurl_AddTargetOutput: TCkHttpCurl_AddTargetOutput = nil;
  CkHttpCurl_ClearVar: TCkHttpCurl_ClearVar = nil;
  CkHttpCurl_GetVar: TCkHttpCurl_GetVar = nil;
  CkHttpCurl_AddFunction: TCkHttpCurl_AddFunction = nil;
  CkHttpCurl_AddOutput: TCkHttpCurl_AddOutput = nil;
  CkHttpCurl_ExaminePlan: TCkHttpCurl_ExaminePlan = nil;
  CkHttpCurl_GetAllVars: TCkHttpCurl_GetAllVars = nil;
  CkHttpCurl_ClearTargetOutput: TCkHttpCurl_ClearTargetOutput = nil;
  CkHttpCurl_VarDefined: TCkHttpCurl_VarDefined = nil;
  CkHttpCurl_AddOutput2: TCkHttpCurl_AddOutput2 = nil;

constructor THttpCurl.Create;
begin
  inherited Create;
  FHandle := CkHttpCurl_Create();
end;

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

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

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

procedure THttpCurl.SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
begin
  FOnAbortCheck := AValue;
  if Assigned(AValue) then
    CkHttpCurl_SetAbortCheckCallback(FHandle, @THttpCurl_AbortCheckThunk, Self)
  else
    CkHttpCurl_SetAbortCheckCallback(FHandle, nil, nil);
end;

procedure THttpCurl.SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
begin
  FOnPercentDone := AValue;
  if Assigned(AValue) then
    CkHttpCurl_SetPercentDoneCallback(FHandle, @THttpCurl_PercentDoneThunk, Self)
  else
    CkHttpCurl_SetPercentDoneCallback(FHandle, nil, nil);
end;

procedure THttpCurl.SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
begin
  FOnProgressInfo := AValue;
  if Assigned(AValue) then
    CkHttpCurl_SetProgressInfoCallback(FHandle, @THttpCurl_ProgressInfoThunk, Self)
  else
    CkHttpCurl_SetProgressInfoCallback(FHandle, nil, nil);
end;

function THttpCurl.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkHttpCurl_get_LastErrorHtml(FHandle));
end;

function THttpCurl.GetLastErrorText: string;
begin
  Result := CkToStr(CkHttpCurl_get_LastErrorText(FHandle));
end;

function THttpCurl.GetLastErrorXml: string;
begin
  Result := CkToStr(CkHttpCurl_get_LastErrorXml(FHandle));
end;

function THttpCurl.GetVersion: string;
begin
  Result := CkToStr(CkHttpCurl_get_Version(FHandle));
end;

function THttpCurl.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkHttpCurl_get_DebugLogFilePath(FHandle));
end;

procedure THttpCurl.SetDebugLogFilePath(AValue: string);
begin
  CkHttpCurl_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function THttpCurl.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkHttpCurl_get_VerboseLogging(FHandle));
end;

procedure THttpCurl.SetVerboseLogging(AValue: Boolean);
begin
  CkHttpCurl_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function THttpCurl.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkHttpCurl_get_LastMethodSuccess(FHandle));
end;

procedure THttpCurl.SetLastMethodSuccess(AValue: Boolean);
begin
  CkHttpCurl_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function THttpCurl.GetStatusCode: Integer;
begin
  Result := CkHttpCurl_get_StatusCode(FHandle);
end;

function THttpCurl.GetResponseBodyStr: string;
begin
  Result := CkToStr(CkHttpCurl_get_ResponseBodyStr(FHandle));
end;

function THttpCurl.GetResponseFilePath: string;
begin
  Result := CkToStr(CkHttpCurl_get_ResponseFilePath(FHandle));
end;

procedure THttpCurl.SetResponseFilePath(AValue: string);
begin
  CkHttpCurl_put_ResponseFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function THttpCurl.GetEnableBodyVars: Boolean;
begin
  Result := Boolean(CkHttpCurl_get_EnableBodyVars(FHandle));
end;

procedure THttpCurl.SetEnableBodyVars(AValue: Boolean);
begin
  CkHttpCurl_put_EnableBodyVars(FHandle, LongBool(AValue));
end;

function THttpCurl.GetFailReason: Integer;
begin
  Result := CkHttpCurl_get_FailReason(FHandle);
end;

function THttpCurl.GetFailedCurl: string;
begin
  Result := CkToStr(CkHttpCurl_get_FailedCurl(FHandle));
end;

function THttpCurl.GetHeartbeatMs: Integer;
begin
  Result := CkHttpCurl_get_HeartbeatMs(FHandle);
end;

procedure THttpCurl.SetHeartbeatMs(AValue: Integer);
begin
  CkHttpCurl_put_HeartbeatMs(FHandle, AValue);
end;

function THttpCurl.GetUncommonOptions: string;
begin
  Result := CkToStr(CkHttpCurl_get_UncommonOptions(FHandle));
end;

procedure THttpCurl.SetUncommonOptions(AValue: string);
begin
  CkHttpCurl_put_UncommonOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function THttpCurl.DoYourThing(const targetCurl: string): Boolean;
begin
  Result := Boolean(CkHttpCurl_DoYourThing(FHandle, PAnsiChar(StrToCk(targetCurl))));
end;

function THttpCurl.SetAuth(json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_SetAuth(FHandle, json.Handle));
end;

function THttpCurl.ToRawRequest(const curlCommand: string; sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_ToRawRequest(FHandle, PAnsiChar(StrToCk(curlCommand)), sb.Handle));
end;

function THttpCurl.GetResponseSb(sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_GetResponseSb(FHandle, sb.Handle));
end;

function THttpCurl.GetResponseBd(bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_GetResponseBd(FHandle, bd.Handle));
end;

function THttpCurl.GetResponseJson(json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_GetResponseJson(FHandle, json.Handle));
end;

function THttpCurl.GetResponseXml(xml: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_GetResponseXml(FHandle, xml.Handle));
end;

function THttpCurl.GetResponseJarr(jarr: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_GetResponseJarr(FHandle, jarr.Handle));
end;

procedure THttpCurl.SetVar(const varName: string; const varValue: string);
begin
  CkHttpCurl_SetVar(FHandle, PAnsiChar(StrToCk(varName)), PAnsiChar(StrToCk(varValue)));
end;

procedure THttpCurl.AddTargetOutput(const jsonPath: string; const varName: string);
begin
  CkHttpCurl_AddTargetOutput(FHandle, PAnsiChar(StrToCk(jsonPath)), PAnsiChar(StrToCk(varName)));
end;

procedure THttpCurl.ClearVar(const varName: string);
begin
  CkHttpCurl_ClearVar(FHandle, PAnsiChar(StrToCk(varName)));
end;

function THttpCurl.GetVar(const varName: string): string;
begin
  Result := CkToStr(CkHttpCurl_GetVar(FHandle, PAnsiChar(StrToCk(varName))));
end;

function THttpCurl.AddFunction(const funcName: string; const curl: string): Boolean;
begin
  Result := Boolean(CkHttpCurl_AddFunction(FHandle, PAnsiChar(StrToCk(funcName)), PAnsiChar(StrToCk(curl))));
end;

function THttpCurl.AddOutput(const funcName: string; const jsonPath: string; const varName: string): Boolean;
begin
  Result := Boolean(CkHttpCurl_AddOutput(FHandle, PAnsiChar(StrToCk(funcName)), PAnsiChar(StrToCk(jsonPath)), PAnsiChar(StrToCk(varName))));
end;

function THttpCurl.ExaminePlan(const curl: string; json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkHttpCurl_ExaminePlan(FHandle, PAnsiChar(StrToCk(curl)), json.Handle));
end;

procedure THttpCurl.GetAllVars(json: TChilkatBase);
begin
  CkHttpCurl_GetAllVars(FHandle, json.Handle);
end;

procedure THttpCurl.ClearTargetOutput(const varName: string);
begin
  CkHttpCurl_ClearTargetOutput(FHandle, PAnsiChar(StrToCk(varName)));
end;

function THttpCurl.VarDefined(const varName: string): Boolean;
begin
  Result := Boolean(CkHttpCurl_VarDefined(FHandle, PAnsiChar(StrToCk(varName))));
end;

function THttpCurl.AddOutput2(const funcName: string; const arrayPath: string; const wherePath: string; const whereValue: string; caseSensitive: Boolean; const subPath: string; const varName: string): Boolean;
begin
  Result := Boolean(CkHttpCurl_AddOutput2(FHandle, PAnsiChar(StrToCk(funcName)), PAnsiChar(StrToCk(arrayPath)), PAnsiChar(StrToCk(wherePath)), PAnsiChar(StrToCk(whereValue)), LongBool(caseSensitive), PAnsiChar(StrToCk(subPath)), PAnsiChar(StrToCk(varName))));
end;

initialization
  Chilkat_GetProcedureAddress(CkHttpCurl_Create,  'CkHttpCurl_Create');
  Chilkat_GetProcedureAddress(CkHttpCurl_Dispose, 'CkHttpCurl_Dispose');
  Chilkat_GetProcedureAddress(CkHttpCurl_SetAbortCheckCallback, 'CkHttpCurl_SetAbortCheckCallback');
  Chilkat_GetProcedureAddress(CkHttpCurl_SetPercentDoneCallback, 'CkHttpCurl_SetPercentDoneCallback');
  Chilkat_GetProcedureAddress(CkHttpCurl_SetProgressInfoCallback, 'CkHttpCurl_SetProgressInfoCallback');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_LastErrorHtml, 'CkHttpCurl_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_LastErrorText, 'CkHttpCurl_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_LastErrorXml, 'CkHttpCurl_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_Version, 'CkHttpCurl_get_Version');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_DebugLogFilePath, 'CkHttpCurl_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkHttpCurl_put_DebugLogFilePath, 'CkHttpCurl_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_VerboseLogging, 'CkHttpCurl_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkHttpCurl_put_VerboseLogging, 'CkHttpCurl_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_LastMethodSuccess, 'CkHttpCurl_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkHttpCurl_put_LastMethodSuccess, 'CkHttpCurl_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_StatusCode, 'CkHttpCurl_get_StatusCode');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_ResponseBodyStr, 'CkHttpCurl_get_ResponseBodyStr');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_ResponseFilePath, 'CkHttpCurl_get_ResponseFilePath');
  Chilkat_GetProcedureAddress(CkHttpCurl_put_ResponseFilePath, 'CkHttpCurl_put_ResponseFilePath');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_EnableBodyVars, 'CkHttpCurl_get_EnableBodyVars');
  Chilkat_GetProcedureAddress(CkHttpCurl_put_EnableBodyVars, 'CkHttpCurl_put_EnableBodyVars');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_FailReason, 'CkHttpCurl_get_FailReason');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_FailedCurl, 'CkHttpCurl_get_FailedCurl');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_HeartbeatMs, 'CkHttpCurl_get_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkHttpCurl_put_HeartbeatMs, 'CkHttpCurl_put_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkHttpCurl_get_UncommonOptions, 'CkHttpCurl_get_UncommonOptions');
  Chilkat_GetProcedureAddress(CkHttpCurl_put_UncommonOptions, 'CkHttpCurl_put_UncommonOptions');
  Chilkat_GetProcedureAddress(CkHttpCurl_DoYourThing, 'CkHttpCurl_DoYourThing');
  Chilkat_GetProcedureAddress(CkHttpCurl_SetAuth, 'CkHttpCurl_SetAuth');
  Chilkat_GetProcedureAddress(CkHttpCurl_ToRawRequest, 'CkHttpCurl_ToRawRequest');
  Chilkat_GetProcedureAddress(CkHttpCurl_GetResponseSb, 'CkHttpCurl_GetResponseSb');
  Chilkat_GetProcedureAddress(CkHttpCurl_GetResponseBd, 'CkHttpCurl_GetResponseBd');
  Chilkat_GetProcedureAddress(CkHttpCurl_GetResponseJson, 'CkHttpCurl_GetResponseJson');
  Chilkat_GetProcedureAddress(CkHttpCurl_GetResponseXml, 'CkHttpCurl_GetResponseXml');
  Chilkat_GetProcedureAddress(CkHttpCurl_GetResponseJarr, 'CkHttpCurl_GetResponseJarr');
  Chilkat_GetProcedureAddress(CkHttpCurl_SetVar, 'CkHttpCurl_SetVar');
  Chilkat_GetProcedureAddress(CkHttpCurl_AddTargetOutput, 'CkHttpCurl_AddTargetOutput');
  Chilkat_GetProcedureAddress(CkHttpCurl_ClearVar, 'CkHttpCurl_ClearVar');
  Chilkat_GetProcedureAddress(CkHttpCurl_GetVar, 'CkHttpCurl_GetVar');
  Chilkat_GetProcedureAddress(CkHttpCurl_AddFunction, 'CkHttpCurl_AddFunction');
  Chilkat_GetProcedureAddress(CkHttpCurl_AddOutput, 'CkHttpCurl_AddOutput');
  Chilkat_GetProcedureAddress(CkHttpCurl_ExaminePlan, 'CkHttpCurl_ExaminePlan');
  Chilkat_GetProcedureAddress(CkHttpCurl_GetAllVars, 'CkHttpCurl_GetAllVars');
  Chilkat_GetProcedureAddress(CkHttpCurl_ClearTargetOutput, 'CkHttpCurl_ClearTargetOutput');
  Chilkat_GetProcedureAddress(CkHttpCurl_VarDefined, 'CkHttpCurl_VarDefined');
  Chilkat_GetProcedureAddress(CkHttpCurl_AddOutput2, 'CkHttpCurl_AddOutput2');

end.
