Class TDirectoryScan (unit TDirScan)

Inherits from

TComponent

Constructors


constructor Create(Owner: TComponent);

+ 1 includes '.


Functions

procedure Cancel;

Protected declarations

function Execute: Boolean;

function FindFirst32(PathSpec: string; File32Info: WIN32_FIND_DATA): Boolean; var DirFilePath: PChar; File32Handle: longint; File32Data: WIN32_FIND_DATA; begin GetMem(DirFilePath, 256); try StrPCopy(DirFilePath, PathSpec); File32Handle := W32FindFirstFile(DirFilePath, File32Data, id_W32FindFirstFile); if File32Handle = -1 then {INVALID_HANDLE_VALUE := -1 per Windows.

function DoSearch16: Boolean;

Perform the scan of the directory tree.

function DoSearch32: Boolean;

In case an exception short-circuited the find loop with directories still in the list

function FileAcceptable(Path: string): Boolean;


function FilenameMatch(SearchSpec, FileToMatch: string): Boolean;

In case path list is not cleared already

function GleanFileExt(InputString: string; var ExtString: string): integer;

For Win32, returns last period and anything after it as a valid extension

Properties

property Busy : Boolean


property Directory : string


property FileSpec : string

property CurDirectory: string read FCurDirectory;

property Subdirectories : Boolean


Events

event OnDirectoryFound : TDirectoryFound


event OnFileFound : TFileFound


event OnProgress : TNotifyEvent


event OnVerifyFile : TVerifyFile

property TotalCount: Integer read FTotalCount;

Variables

FCancelled : Boolean;


FCurDirectory : string;


FDirPath : string;


FFileSpec : string;


FFileType : TFileTypeSet;


FOnDirectoryFound : TDirectoryFound;


FOnFileFound : TFileFound;


FOnProgress : TNotifyEvent;


FOnVerifyFile : TVerifyFile;


FProcessing : Boolean;


FSubdirectories : Boolean;


FTotalCount : Integer;


NoLongNames : Boolean;



Constructors


constructor Create(Owner: TComponent);

+ 1 includes '.'


Functions


procedure Cancel;

Protected declarations


function Execute: Boolean;

function FindFirst32(PathSpec: string; File32Info: WIN32_FIND_DATA): Boolean; var DirFilePath: PChar; File32Handle: longint; File32Data: WIN32_FIND_DATA; begin GetMem(DirFilePath, 256); try StrPCopy(DirFilePath, PathSpec); File32Handle := W32FindFirstFile(DirFilePath, File32Data, id_W32FindFirstFile); if File32Handle = -1 then {INVALID_HANDLE_VALUE := -1 per Windows.pas for Delphi 2 & 3} { Result := -1 else { begin Result := 0; {File was found} { W32FindClose(File32Handle, id_W32FindClose); end; finally FreeMem(DirFilePath, 256); end; end;


function DoSearch16: Boolean;

Perform the scan of the directory tree. Returns TRUE if at least one matching file was located, FALSE if no files were located.


function DoSearch32: Boolean;

In case an exception short-circuited the find loop with directories still in the list


function FileAcceptable(Path: string): Boolean;


function FilenameMatch(SearchSpec, FileToMatch: string): Boolean;

In case path list is not cleared already


function GleanFileExt(InputString: string; var ExtString: string): integer;

For Win32, returns last period and anything after it as a valid extension


Properties


property Busy : Boolean


property Directory : string


property FileSpec : string

property CurDirectory: string read FCurDirectory;


property Subdirectories : Boolean


Events


event OnDirectoryFound : TDirectoryFound


event OnFileFound : TFileFound


event OnProgress : TNotifyEvent


event OnVerifyFile : TVerifyFile

property TotalCount: Integer read FTotalCount;


Variables


FCancelled : Boolean;


FCurDirectory : string;


FDirPath : string;


FFileSpec : string;


FFileType : TFileTypeSet;


FOnDirectoryFound : TDirectoryFound;


FOnFileFound : TFileFound;


FOnProgress : TNotifyEvent;


FOnVerifyFile : TVerifyFile;


FProcessing : Boolean;


FSubdirectories : Boolean;


FTotalCount : Integer;


NoLongNames : Boolean;