Changeset 509 for Common/UCommon.pas
- Timestamp:
- Apr 3, 2018, 6:03:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r502 r509 28 28 unfDNSDomainName = 11); 29 29 30 TFilterMethodMethod = function (FileName: string): Boolean of object; 30 31 var 31 32 ExceptionHandler: TExceptionEvent; … … 71 72 function MergeArray(A, B: array of string): TArrayOfString; 72 73 function LoadFileToStr(const FileName: TFileName): AnsiString; 74 procedure SearchFiles(AList: TStrings; Dir: string; 75 FilterMethod: TFilterMethodMethod); 73 76 74 77 … … 514 517 end; 515 518 519 function DefaultSearchFilter(const FileName: string): Boolean; 520 begin 521 Result := True; 522 end; 523 524 procedure SearchFiles(AList: TStrings; Dir: string; 525 FilterMethod: TFilterMethodMethod); 526 var 527 SR: TSearchRec; 528 begin 529 Dir := IncludeTrailingPathDelimiter(Dir); 530 if FindFirst(Dir + '*', faAnyFile, SR) = 0 then 531 try 532 repeat 533 if (SR.Name = '.') or (SR.Name = '..') or not FilterMethod(SR.Name) then Continue; 534 AList.Add(Dir + SR.Name); 535 if (SR.Attr and faDirectory) <> 0 then 536 SearchFiles(AList, Dir + SR.Name, FilterMethod); 537 until FindNext(SR) <> 0; 538 finally 539 FindClose(SR); 540 end; 541 end; 516 542 517 543
Note:
See TracChangeset
for help on using the changeset viewer.