Changeset 520 for Common/UCommon.pas
- Timestamp:
- Mar 7, 2019, 4:34:53 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r518 r520 28 28 unfDNSDomainName = 11); 29 29 30 TFilterMethodMethod = function (FileName: string): Boolean of object; 30 TFilterMethod = function (FileName: string): Boolean of object; 31 TFileNameMethod = procedure (FileName: string) of object; 32 31 33 var 32 34 ExceptionHandler: TExceptionEvent; … … 74 76 procedure SaveStringToFile(S, FileName: string); 75 77 procedure SearchFiles(AList: TStrings; Dir: string; 76 FilterMethod: TFilterMethod Method = nil);78 FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil); 77 79 function GetStringPart(var Text: string; Separator: string): string; 78 80 function StripTags(const S: string): string; … … 81 83 function PosFromIndexReverse(SubStr: string; Text: string; 82 84 StartIndex: Integer): Integer; 85 procedure CopyStringArray(Dest: TStringArray; Source: array of string); 83 86 84 87 … … 108 111 I: Integer; 109 112 begin 113 Result := ''; 110 114 for I := 1 to Length(Source) do begin 111 115 Result := Result + LowerCase(IntToHex(Ord(Source[I]), 2)); … … 543 547 544 548 procedure SearchFiles(AList: TStrings; Dir: string; 545 FilterMethod: TFilterMethod Method = nil);549 FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil); 546 550 var 547 551 SR: TSearchRec; … … 553 557 if (SR.Name = '.') or (SR.Name = '..') or (Assigned(FilterMethod) and (not FilterMethod(SR.Name) or 554 558 not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name))) then Continue; 559 if Assigned(FileNameMethod) then 560 FileNameMethod(Dir + SR.Name); 555 561 AList.Add(Dir + SR.Name); 556 562 if (SR.Attr and faDirectory) <> 0 then … … 654 660 end; 655 661 662 procedure CopyStringArray(Dest: TStringArray; Source: array of string); 663 var 664 I: Integer; 665 begin 666 SetLength(Dest, Length(Source)); 667 for I := 0 to Length(Dest) - 1 do 668 Dest[I] := Source[I]; 669 end; 670 656 671 657 672 initialization
Note:
See TracChangeset
for help on using the changeset viewer.