?? easyfilesearch.pas
字號:
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.SetExcludedFiles
* Purpose : Set the new exclued files
* Arguments : NewExcluded > new files to exclude
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (14/10/2002) : Creation
*****************************************************************************}
procedure TEasyFileSearch.SetExcludedFiles(NewExcluded : TStrings);
begin
fExcludedFiles.Clear;
fExcludedFiles.Assign(NewExcluded);
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.GetExcludedFiles
* Purpose : Return the current ExcludedFiles
* Arguments : NONE
* Result : Return the current ExcludedFiles
*****************************************************************************
* Alexandre GAMBIER (14/10/2002) : Creation
*****************************************************************************}
function TEasyFileSearch.GetExcludedFiles : TStrings;
begin
Result := fExcludedFiles;
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.SetFilesName
* Purpose : Set the new filesnames
* Arguments : NewFileNames > new filenames to add
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (28/10/2002) : Creation
*****************************************************************************}
procedure TEasyFileSearch.SetFileNames(NewFileNames : TStrings);
begin
fFileNames.Clear;
fFileNames.Assign(NewFileNames);
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.GetFileNames
* Purpose : Return the current filenames
* Arguments : NONE
* Result : Returns the current filenames
*****************************************************************************
* Alexandre GAMBIER (28/10/2002) : Creation
*****************************************************************************}
function TEasyFileSearch.GetFileNames : TStrings;
begin
Result := fFileNames;
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.Search
* Purpose : Start Search Operation
* Arguments : NONE
* Result : True if ok
*****************************************************************************
* Alexandre GAMBIER (25/09/2002) : Creation
*****************************************************************************}
function TEasyFileSearch.Search : Boolean;
begin
{ Initialize search criteria }
ConvertSearchOptions;
{ Initialise filter criteria }
ConvertFilterOptions;
{ start search operation }
Result := SearchEngine.Search;
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.ConvertSearchOptions
* Purpose : Convert search options for the search engine
* Arguments : NONE
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (25/09/2002) : Creation
*****************************************************************************}
procedure TEasyFileSearch.ConvertSearchOptions;
begin
with SearchEngine do
begin
SearchOptions.IncludeSubfolder := okIncludeSubfolder in fSearchOptions;
SearchOptions.LookForReadOnlyFile := okLookForReadOnlyFile in fSearchOptions;
SearchOptions.LookForHiddenFile := okLookForHiddenFile in fSearchOptions;
SearchOptions.LookForSystemFile := okLookForSystemFile in fSearchOptions;
SearchOptions.LookForDirectory := okLookForDirectory in fSearchOptions;
SearchOptions.LookForArchiveFile := okLookForArchiveFile in fSearchOptions;
SearchOptions.LookForAnyFile := okLookForAnyFile in fSearchOptions;
end;
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.SetRootPath
* Purpose : Initialize the root path
* Arguments : NewRootPath > new root path to use
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (27/09/2002) : Creation
*****************************************************************************}
procedure TEasyFileSearch.SetRootPath(NewRootPath : String);
begin
SearchEngine.RootPath := NewRootPath;
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.GetRootPath
* Purpose : Give the current Root path
* Arguments : NONE
* Result : Return the root path
*****************************************************************************
* Alexandre GAMBIER (25/09/2002) : Creation
*****************************************************************************}
function TEasyFileSearch.GetRootPath : String;
begin
Result := SearchEngine.RootPath;
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.ConvertFilterOptions
* Purpose :
* Arguments :
* Result :
*****************************************************************************
* Alexandre GAMBIER (27/09/2002) : Creation
* Alexandre GAMBIER (14/10/2002) : Add exclude filters
*****************************************************************************}
procedure TEasyFileSearch.ConvertFilterOptions;
begin
with SearchEngine do
begin
{ Date }
DateOptions.FilterOnDate := fkFilterOnDate in fFilterKind;
DateOptions.FilterAccessKind := fDateFilterFileAccess;
DateOptions.DateFilterKind := fDateFilterKind;
DateOptions.FirstDate := fDateFilterFirstDate;
DateOptions.SecondDate := fDateFilterSecondDate;
{ Size }
SizeOptions.FilterOnSize := fkFilterOnSize in fFilterKind;
SizeOptions.SizeFilterKind := fSizeFilterKind;
SizeOptions.Size := fSizeFilterSize;
{ Exclude }
ExcludeFilters.Assign(fExcludedFiles);
{ FileNames}
FileNames.Assign(fFileNames);
end;
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.pOnFileFound
* Purpose : Receive event from SearchEngine & call user event function
* Arguments : FileFounded > file information about the current file founded
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (25/09/2002) : Creation
*****************************************************************************}
procedure TEasyFileSearch.pOnFileFound(FileFound : TFileInformations);
begin
if assigned(fOnFileFound)=True then fOnFileFound(FileFound);
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.pOnAcceptFile
* Purpose : Receive event from SearchEngine & call user event function
* Arguments : FileFounded > file information about the current file founded
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (28/10/2002) : Creation
*****************************************************************************}
function TEasyFileSearch.pOnAcceptFile(FileFound : TFileInformations) : Boolean;
begin
Result := True;
if Assigned(fOnAcceptFile)=True then Result := fOnAcceptFile(FileFound);
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.pOnChangeFolder
* Purpose : Receive event from SearchEngine & call user event function
* Arguments : NewPath > new current path
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (25/09/2002) : Creation
*****************************************************************************}
procedure TEasyFileSearch.pOnChangeFolder(NewPath : String);
begin
if assigned(fOnChangeFolder)=True then fOnChangeFolder(NewPath);
end;
{*****************************************************************************
* Procedure : TEasyFileSearch.pOnStatistics
* Purpose : Receive event from searchengine & call user event function
* Arguments : Stats > statitics informations
* Result : NONE
*****************************************************************************
* Alexandre GAMBIER (25/09/2002) : Creation
*****************************************************************************}
procedure TEasyFileSearch.pOnStatistics(Stats : TStatistics);
begin
if assigned(fOnStatistics)=True then fOnStatistics(Stats);
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -