[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'FileUtil' (#lazutils)

TFileSearcher

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements an iterator used to search for files or directories.

Declaration

Source position: fileutil.pas line 127

type TFileSearcher = class(TFileIterator)

protected

  procedure DoDirectoryEnter; virtual;

  

Signals the OnDirectoryEnter event handler (when assigned).

  procedure DoDirectoryFound; virtual;

  

Signals the OnDirectoryFound event handler (when assigned).

  procedure DoFileFound; virtual;

  

Signals the OnFileFound event handler (when assigned).

public

  constructor Create;

  

Constructor for the class instance.

  procedure Search();

  

Searches for files or directories in the specified path(s) using the specified options.

  property MaskSeparator: Char; [rw]

  

Character used as a delimiter between file masks.

  property PathSeparator: Char; [rw]

  

Character used as a delimiter between directory paths.

  property FollowSymLink: Boolean; [rw]

  

Indicates if a search process directory paths that are symbolic links.

  property FileAttribute: Word; [rw]

  

File attribute needed for any file considered a match in the Search method.

  property DirectoryAttribute: Word; [rw]

  

File attribute needed for directories considered a match in the Search method.

  property OnDirectoryFound: TDirectoryFoundEvent; [rw]

  

Event handler signalled when a new directory is found in the Search method.

  property OnFileFound: TFileFoundEvent; [rw]

  

Event handler signalled when a file matching the file mask is found in the Search method.

  property OnDirectoryEnter: TDirectoryEnterEvent; [rw]

  

Event handler signalled when a new directory is processed in the Search method.

end;

Inheritance

TFileSearcher

  

Implements an iterator used to search for files or directories.

|

TFileIterator

  

Implements an iterator for file and directory names on the local file system.

|

TObject

Description

TFileSearcher is a TFileIterator descendant used to search for files or directories that match a search mask in a given directory path. TFileSearcher extends the ancestor class with additional properties, methods, and events needed to search and process files or directories on the local file system.

It implements the Search method to perform a search using the specified path(s) and file mask(s).

Use MaskSeparator to specify the delimiter used to separate a list of mask values passed to the method. Use PathSeparator to specify the delimiter used to separate a list of file paths passed to the method.

Use FileAttribute and DirectoryAttribute to specify the file system attributes needed for files or directories considered a match in the Search method. Use FollowSymLink to indicate whether symbolic links on the file system are followed in the Search method.

Use the OnFileFound, OnDirectoryFound, and OnDirectoryEnter event handlers to perform the actions needed for files or directories found using the Search method.

TFileSearcher is the ancestor class for more specialized descendants like TListFileSearcher and TListDirectoriesSearcher.

See also

TFileIterator

  

Implements an iterator for file and directory names on the local file system.

TListFileSearcher

  

Stores file names matching a search criteria in a TStrings class instance.

TListDirectoriesSearcher

  

Stores directory names matching a given search criteria in a TStrings class instance.


Version 3.2 Generated 2024-02-25 Home