unit Chilkat.DirTree;

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

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

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TDirTree wraps CkDirTree via the C bridge layer. }
  TDirTree = class(TChilkatBase)
  private
    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  GetBaseDir: string;
    procedure SetBaseDir(AValue: string);
    function  GetDoneIterating: Boolean;
    function  GetFileSize32: Integer;
    function  GetFileSize64: Int64;
    function  GetFullPath: string;
    function  GetFullUncPath: string;
    function  GetIsDirectory: Boolean;
    function  GetRecurse: Boolean;
    procedure SetRecurse(AValue: Boolean);
    function  GetRelativePath: string;
    function  GetFileSizeStr: string;
    function  GetUncommonOptions: string;
    procedure SetUncommonOptions(AValue: string);
  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 BaseDir: string read GetBaseDir write SetBaseDir;
    property DoneIterating: Boolean read GetDoneIterating;
    property FileSize32: Integer read GetFileSize32;
    property FileSize64: Int64 read GetFileSize64;
    property FullPath: string read GetFullPath;
    property FullUncPath: string read GetFullUncPath;
    property IsDirectory: Boolean read GetIsDirectory;
    property Recurse: Boolean read GetRecurse write SetRecurse;
    property RelativePath: string read GetRelativePath;
    property FileSizeStr: string read GetFileSizeStr;
    property UncommonOptions: string read GetUncommonOptions write SetUncommonOptions;

    function  AdvancePosition: Boolean;
    function  BeginIterate: Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkDirTree_Create  = function(): Pointer; cdecl;
  TCkDirTree_Dispose = procedure(handle: Pointer); cdecl;
  TCkDirTree_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkDirTree_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkDirTree_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkDirTree_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkDirTree_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkDirTree_get_BaseDir = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_put_BaseDir = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkDirTree_get_DoneIterating = function(handle: Pointer): LongBool; cdecl;
  TCkDirTree_get_FileSize32 = function(handle: Pointer): Integer; cdecl;
  TCkDirTree_get_FileSize64 = function(handle: Pointer): Int64; cdecl;
  TCkDirTree_get_FullPath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_FullUncPath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_IsDirectory = function(handle: Pointer): LongBool; cdecl;
  TCkDirTree_get_Recurse = function(handle: Pointer): LongBool; cdecl;
  TCkDirTree_put_Recurse = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkDirTree_get_RelativePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_FileSizeStr = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_get_UncommonOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkDirTree_put_UncommonOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkDirTree_AdvancePosition = function(handle: Pointer): LongBool; cdecl;
  TCkDirTree_BeginIterate = function(handle: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkDirTree_Create:  TCkDirTree_Create  = nil;
  CkDirTree_Dispose: TCkDirTree_Dispose = nil;
  CkDirTree_get_LastErrorHtml: TCkDirTree_get_LastErrorHtml = nil;
  CkDirTree_get_LastErrorText: TCkDirTree_get_LastErrorText = nil;
  CkDirTree_get_LastErrorXml: TCkDirTree_get_LastErrorXml = nil;
  CkDirTree_get_Version: TCkDirTree_get_Version = nil;
  CkDirTree_get_DebugLogFilePath: TCkDirTree_get_DebugLogFilePath = nil;
  CkDirTree_put_DebugLogFilePath: TCkDirTree_put_DebugLogFilePath = nil;
  CkDirTree_get_VerboseLogging: TCkDirTree_get_VerboseLogging = nil;
  CkDirTree_put_VerboseLogging: TCkDirTree_put_VerboseLogging = nil;
  CkDirTree_get_LastMethodSuccess: TCkDirTree_get_LastMethodSuccess = nil;
  CkDirTree_put_LastMethodSuccess: TCkDirTree_put_LastMethodSuccess = nil;
  CkDirTree_get_BaseDir: TCkDirTree_get_BaseDir = nil;
  CkDirTree_put_BaseDir: TCkDirTree_put_BaseDir = nil;
  CkDirTree_get_DoneIterating: TCkDirTree_get_DoneIterating = nil;
  CkDirTree_get_FileSize32: TCkDirTree_get_FileSize32 = nil;
  CkDirTree_get_FileSize64: TCkDirTree_get_FileSize64 = nil;
  CkDirTree_get_FullPath: TCkDirTree_get_FullPath = nil;
  CkDirTree_get_FullUncPath: TCkDirTree_get_FullUncPath = nil;
  CkDirTree_get_IsDirectory: TCkDirTree_get_IsDirectory = nil;
  CkDirTree_get_Recurse: TCkDirTree_get_Recurse = nil;
  CkDirTree_put_Recurse: TCkDirTree_put_Recurse = nil;
  CkDirTree_get_RelativePath: TCkDirTree_get_RelativePath = nil;
  CkDirTree_get_FileSizeStr: TCkDirTree_get_FileSizeStr = nil;
  CkDirTree_get_UncommonOptions: TCkDirTree_get_UncommonOptions = nil;
  CkDirTree_put_UncommonOptions: TCkDirTree_put_UncommonOptions = nil;
  CkDirTree_AdvancePosition: TCkDirTree_AdvancePosition = nil;
  CkDirTree_BeginIterate: TCkDirTree_BeginIterate = nil;

constructor TDirTree.Create;
begin
  inherited Create;
  FHandle := CkDirTree_Create();
end;

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

function TDirTree.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkDirTree_get_LastErrorHtml(FHandle));
end;

function TDirTree.GetLastErrorText: string;
begin
  Result := CkToStr(CkDirTree_get_LastErrorText(FHandle));
end;

function TDirTree.GetLastErrorXml: string;
begin
  Result := CkToStr(CkDirTree_get_LastErrorXml(FHandle));
end;

function TDirTree.GetVersion: string;
begin
  Result := CkToStr(CkDirTree_get_Version(FHandle));
end;

function TDirTree.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkDirTree_get_DebugLogFilePath(FHandle));
end;

procedure TDirTree.SetDebugLogFilePath(AValue: string);
begin
  CkDirTree_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TDirTree.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkDirTree_get_VerboseLogging(FHandle));
end;

procedure TDirTree.SetVerboseLogging(AValue: Boolean);
begin
  CkDirTree_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TDirTree.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkDirTree_get_LastMethodSuccess(FHandle));
end;

procedure TDirTree.SetLastMethodSuccess(AValue: Boolean);
begin
  CkDirTree_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TDirTree.GetBaseDir: string;
begin
  Result := CkToStr(CkDirTree_get_BaseDir(FHandle));
end;

procedure TDirTree.SetBaseDir(AValue: string);
begin
  CkDirTree_put_BaseDir(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TDirTree.GetDoneIterating: Boolean;
begin
  Result := Boolean(CkDirTree_get_DoneIterating(FHandle));
end;

function TDirTree.GetFileSize32: Integer;
begin
  Result := CkDirTree_get_FileSize32(FHandle);
end;

function TDirTree.GetFileSize64: Int64;
begin
  Result := CkDirTree_get_FileSize64(FHandle);
end;

function TDirTree.GetFullPath: string;
begin
  Result := CkToStr(CkDirTree_get_FullPath(FHandle));
end;

function TDirTree.GetFullUncPath: string;
begin
  Result := CkToStr(CkDirTree_get_FullUncPath(FHandle));
end;

function TDirTree.GetIsDirectory: Boolean;
begin
  Result := Boolean(CkDirTree_get_IsDirectory(FHandle));
end;

function TDirTree.GetRecurse: Boolean;
begin
  Result := Boolean(CkDirTree_get_Recurse(FHandle));
end;

procedure TDirTree.SetRecurse(AValue: Boolean);
begin
  CkDirTree_put_Recurse(FHandle, LongBool(AValue));
end;

function TDirTree.GetRelativePath: string;
begin
  Result := CkToStr(CkDirTree_get_RelativePath(FHandle));
end;

function TDirTree.GetFileSizeStr: string;
begin
  Result := CkToStr(CkDirTree_get_FileSizeStr(FHandle));
end;

function TDirTree.GetUncommonOptions: string;
begin
  Result := CkToStr(CkDirTree_get_UncommonOptions(FHandle));
end;

procedure TDirTree.SetUncommonOptions(AValue: string);
begin
  CkDirTree_put_UncommonOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TDirTree.AdvancePosition: Boolean;
begin
  Result := Boolean(CkDirTree_AdvancePosition(FHandle));
end;

function TDirTree.BeginIterate: Boolean;
begin
  Result := Boolean(CkDirTree_BeginIterate(FHandle));
end;

initialization
  Chilkat_GetProcedureAddress(CkDirTree_Create,  'CkDirTree_Create');
  Chilkat_GetProcedureAddress(CkDirTree_Dispose, 'CkDirTree_Dispose');
  Chilkat_GetProcedureAddress(CkDirTree_get_LastErrorHtml, 'CkDirTree_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkDirTree_get_LastErrorText, 'CkDirTree_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkDirTree_get_LastErrorXml, 'CkDirTree_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkDirTree_get_Version, 'CkDirTree_get_Version');
  Chilkat_GetProcedureAddress(CkDirTree_get_DebugLogFilePath, 'CkDirTree_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkDirTree_put_DebugLogFilePath, 'CkDirTree_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkDirTree_get_VerboseLogging, 'CkDirTree_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkDirTree_put_VerboseLogging, 'CkDirTree_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkDirTree_get_LastMethodSuccess, 'CkDirTree_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkDirTree_put_LastMethodSuccess, 'CkDirTree_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkDirTree_get_BaseDir, 'CkDirTree_get_BaseDir');
  Chilkat_GetProcedureAddress(CkDirTree_put_BaseDir, 'CkDirTree_put_BaseDir');
  Chilkat_GetProcedureAddress(CkDirTree_get_DoneIterating, 'CkDirTree_get_DoneIterating');
  Chilkat_GetProcedureAddress(CkDirTree_get_FileSize32, 'CkDirTree_get_FileSize32');
  Chilkat_GetProcedureAddress(CkDirTree_get_FileSize64, 'CkDirTree_get_FileSize64');
  Chilkat_GetProcedureAddress(CkDirTree_get_FullPath, 'CkDirTree_get_FullPath');
  Chilkat_GetProcedureAddress(CkDirTree_get_FullUncPath, 'CkDirTree_get_FullUncPath');
  Chilkat_GetProcedureAddress(CkDirTree_get_IsDirectory, 'CkDirTree_get_IsDirectory');
  Chilkat_GetProcedureAddress(CkDirTree_get_Recurse, 'CkDirTree_get_Recurse');
  Chilkat_GetProcedureAddress(CkDirTree_put_Recurse, 'CkDirTree_put_Recurse');
  Chilkat_GetProcedureAddress(CkDirTree_get_RelativePath, 'CkDirTree_get_RelativePath');
  Chilkat_GetProcedureAddress(CkDirTree_get_FileSizeStr, 'CkDirTree_get_FileSizeStr');
  Chilkat_GetProcedureAddress(CkDirTree_get_UncommonOptions, 'CkDirTree_get_UncommonOptions');
  Chilkat_GetProcedureAddress(CkDirTree_put_UncommonOptions, 'CkDirTree_put_UncommonOptions');
  Chilkat_GetProcedureAddress(CkDirTree_AdvancePosition, 'CkDirTree_AdvancePosition');
  Chilkat_GetProcedureAddress(CkDirTree_BeginIterate, 'CkDirTree_BeginIterate');

end.
