JVCL Help:TJvSearchFiles

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Class Hierarchy

TJvSearchFiles
run\JvSearchFiles.pas


Summary

Enables you to search for files and directories.

run\JvSearchFiles.pas


Pascal

 run\JvSearchFiles.pas
 TJvSearchFiles = class(TJvComponent);


Description

  1. JVCLInfo

Use TJvSearchFiles to perform a search operation for files and directories.
First use the properties of TJvSearchFiles to specify how and what to search for:

  • Use RootDirectory to specify the start directory for the search.
  • Use DirOption to specify whether the component must only scan the start directory, must also scan in valid - as specified by DirParams - sub-directories or must scan in all sub-directories.
  • Use ErrorResponse to specify how a TJvSearchFiles component should react on errors.
  • Use FileParams to specify which files are included in the search result. Include soSearchFilesin Options to actually search for files.
  • Use DirParams to specify which directories are included in the search result. If DirOption is set tdoExcludeInvalidDirs or doExcludeCompleteInvalidDirs then DirParams also limits the search to sub-directories that match to the parameters specified by DirParams. Include soSearchDirs in Options to actually search for directories.
  • Use Options to specify various behavioral properties of the search component.

Some work can be done by the component or by the user:

  • TJvSearchFiles can store all found files and directories in Files and Directories resp., or this can be done by the user in response of OnFindFile and OnFindDirectory events. Include soOwnerData in Options to let the component not store found files and directories.
  • FileParams and DirParams can be used to limit the search result to files and directories that match the parameters described by these objects, or this can be done by the user in response of the OnCheck event.

After setting these properties you can call Search to start the search operation. Now the following events will be triggered during the search operation:

While searching the component updates the TotalDirectories, TotalFiles, and TotalFileSize properties, if a file or directory is found.
Eventually the search operation will end with result False, if an error occurred or the user did abort the operation, or otherwise with result True.
For examples on how to search for specific file, look here.

run\JvSearchFiles.pas


About

Navigation

run\JvSearchFiles.pas



Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page