diff --git a/docs/xml/lazutils/fileutil.xml b/docs/xml/lazutils/fileutil.xml index 05c6c22ebe..cdc5b51f11 100644 --- a/docs/xml/lazutils/fileutil.xml +++ b/docs/xml/lazutils/fileutil.xml @@ -1368,6 +1368,86 @@ File iterator with the directory information for the event. + + + +Specifies an event handler signalled when a file name matching a search +criteria is found in TFileSearcher. + + +

+TQueryFileFoundEvent is the type used to implement the +OnQueryFileFound event handler in TFileSearcher. It allows a a file name to be +examined to determine whether it can be accepted in the file iterator. An +application must implement a handler routine using the signature in +TQueryFileFoundEvent to respond to the notification event. +

+

+Set the Accept argument to True if the file name in Fn can be +used by the file iterator. +

+
+ + + + +
+ + +Iterator class instance (TFileIterator) for the notification. + + + + +File name for the notification. + + + + +True to accept the file name. False to reject it. + + + + + + +Specifies an event handler signalled when a directory name matching a search +criteria is found in TFileSearcher. + + +

+TQueryDirectoryFoundEvent is the type used to implement the OnQueryFileFound +event handler in TFileSearcher. It allows a a directory name to be +examined to determine whether it can be accepted in the iterator. An +application must implement a handler routine using the signature in +TQueryDirectoryFoundEvent to respond to the notification event. +

+

+Set the Accept argument to True if the file name in Fn can be +used by the file iterator. +

+
+ + + + +
+ + +Iterator class instance (TFileIterator) for the notification. + + + + +Directory name for the notification. + + + + +True to accept the directory name. False to reject it. + + + Implements an iterator used to search for files or directories. @@ -1420,6 +1500,8 @@ TFileSearcher is the ancestor class for more specialized descendants like + + @@ -1446,6 +1528,87 @@ Signals the OnFileFound event handler (when assigned). + + + +Performs actions needed to accept or reject a file name processed in the +Search method. + + +

+DoQueryFileFound signals the OnQueryFileFound event handler (when +assigned) to allow the application to decide if the Fn argument +contains a file name which can be used in the class. An application must +implement and assign a handler routine to OnQueryFileFound to respond to the +notification. +

+

+DoQueryFileFound is called during execution of the Search method when a file +name is found using the search path and search mask passed to the method. +Set Accept to True if the file name can be used in the class +to signal the OnFileFound event handler. +

+
+ +
+ + +File name passed to OnQueryFileFound event handler. + + + + +Returns True if the specified file name can be used. Returns +False if the specified file name should be omitted. + + + + + + +Performs actions needed to accept or reject a directory name processed in the +Search method. + + +

+DoQueryDirectoryFound signals the OnQueryDirectoryFound event +handler (when assigned) to allow the application to decide if the +Dir argument contains a directory name which can be used in the +class. An application must implement and assign a handler routine to +OnQueryDirectoryFound to respond to the notification. +

+

+OnQueryDirectoryFound is called during execution of the Search method when a +directory name is found using the search path and search mask passed to the +method. Set Accept to True if the directory name can be used +in the class to signal the OnDirectoryFound event handler. +

+
+ + + + + + + + + + + + +
+ + +Directory name passed to the OnQueryDirectoryFound event handler. + + + + +Returns True if the specified directory can be used. Returns +False if the specified directory should be omitted. + + + Constructor for the class instance. @@ -1474,10 +1637,11 @@ in the following properties: + -Searches for files or directories in the specified path(s) using the -specified options. +Searches for files or directories in the specified path(s) using the specified +options.

@@ -1514,10 +1678,10 @@ part of the file specification. It is not trimmed, and will most likely prevent a match for the mask value.

-The value in the CaseSensitive argument is used to add or remove -mask options for the search mask in ASearchMask. Set CaseSensitive to -True before calling Search to perform file name comparisons with case -sensitivity. +ASearchPath contains the locations examined in the method, and can +contain multiple path names separated by the PathSeparator +character. Each delimited path value in ASearchPath is resolved +using ResolveDots and processed in the method.

ASearchSubDirs includes subdirectories found in ASearchPath in the @@ -1525,38 +1689,69 @@ search process when set to True. When set to False only the specified paths are searched and their subdirectories are ignored.

-Set the value in FileAttribute to control the file attributes +CaseSensitive determines whether case sensitive comparisons are +performed for paths, files, and directories processed in the method. The +default value is False. +

+

+ASearchSubDirs determines whether subdirectories found in the search +path are processed in the method. The default value is True and includes +subdirectories. +

+

+Use the FileAttribute property to control the file attributes included in the search process. The default value (faAnyFile) allows all files to be considered.

-Set the value in DirectoryAttribute to control whether directory +Use the DirectoryAttribute property to control whether directory names are included in the search process. The default value -(faDirectory) includes directory names. +(faDirectory) includes directories.

-Set the value in FollowSymLink to indicate whether symbolic links +Use the FollowSymLink property to indicate whether symbolic links in the file system are followed in the method.

-When a matching file is found, the OnFileFound event is signalled. For -directories, the OnDirectoryFound event is signalled. When a new directory is -processed in the method, the OnDirectoryEnter events is signalled. -Applications must assign a handler for the events to respond to the +Search processes each of the path values found in ASearchPath. FindFirstUTF8 is +called to get file and directory attributes examined in the process. Values in +FileAttribute and DirectoryAttribute are checked to determine which directories +and files are available in the method. +

+

+The OnQueryFileFound and OnQueryDirectoryFound events handlers are signalled +(when assigned) to allow the application to include or exclude each directory +or file found in the process. +

+

+When a matching file is found, the OnFileFound event is signalled. When a +matching directory is found, the OnDirectoryFound event is signalled. When a +new directory is processed in the method, the OnDirectoryEnter events is +signalled. +

+

+Applications must assign a handler routine for these events to respond to the notifications. You can abort the search process by calling the Stop method in the handlers for these events.

+

+Search is used in the implement of convenience routines like CopyFile, +CopyDirTree, FindAllFiles, and FindAllDirectories. +

-Calls RaiseSearchingError to raise an exception if the Search method has -already been called and has not completed. +An Exception is raised if Search is called and a previous call to the method is +already running.

- + + + + @@ -1853,6 +2048,70 @@ in the Search method.
+ + + +Event handler signalled to accept or reject a file name found using the class. + + +

+OnQueryFileFound is a TQueryFileFoundEvent property with +the event handler signalled to accept or reject a specific file name found in +the Search method. OnQueryFileFound is signalled (when assigned) from the +DoQueryFileFound method called during execution of the Search method. +

+

+An application can implement and assign a handler routine to respond to the +notification. Use the parameters in the +TQueryFileFoundEvent implementation to examine a specific file name, +and set the return value which indicates whether the file name is accepted or +rejected. +

+
+ +Added in LCL version 4.0. + + + + + + + +
+ + + + +Event handler signalled to accept or reject a directory name found using the +class. + + +

+OnQueryDirectoryFound is a TQueryDirectoryFoundEvent +property with the event handler signalled to accept or reject a specific +directory path found in the Search method. OnQueryDirectoryFound is signalled +(when assigned) from the DoQueryDirectoryFound method called during execution +of the Search method. +

+

+An application can implement and assign a handler routine to respond to the +notification. Use the parameters in the +TQueryDirectoryFoundEvent implementation to examine a specific path +name (directory), and set the return value which indicates whether the +directory is accepted or rejected. +

+
+ +Added in LCL version 4.0. + + + + + + + +
+ Stores file names matching a search criteria in a TStrings class instance.