mirror of
https://github.com/CloudDelphi/Virtual-File-System
synced 2025-12-19 09:53:54 +01:00
Removed application duplicate directory items file matching in order to support native 8.3 file names
This commit is contained in:
parent
f62819869e
commit
fa991ef152
14
VfsUtils.pas
14
VfsUtils.pas
@ -662,20 +662,18 @@ end;
|
|||||||
|
|
||||||
procedure GetDirectoryListing (const SearchPath, FileMask: WideString; {Un} Exclude: TDict {OF CaselessKey => not NIL}; DirListing: TDirListing);
|
procedure GetDirectoryListing (const SearchPath, FileMask: WideString; {Un} Exclude: TDict {OF CaselessKey => not NIL}; DirListing: TDirListing);
|
||||||
var
|
var
|
||||||
{O} Items: {O} TList {OF TDirListingItem};
|
{O} Items: {O} TList {OF TDirListingItem};
|
||||||
{O} Item: {O} TDirListingItem;
|
{O} Item: {O} TDirListingItem;
|
||||||
CompiledMask: Utils.TArrayOfByte;
|
i: integer;
|
||||||
i: integer;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{!} Assert(DirListing <> nil);
|
{!} Assert(DirListing <> nil);
|
||||||
Items := DataLib.NewList(Utils.OWNS_ITEMS);
|
Items := DataLib.NewList(Utils.OWNS_ITEMS);
|
||||||
Item := TDirListingItem.Create;
|
Item := TDirListingItem.Create;
|
||||||
CompiledMask := VfsMatching.CompilePattern(FileMask);
|
|
||||||
// * * * * * //
|
// * * * * * //
|
||||||
with VfsUtils.SysScanDir(SearchPath, FileMask) do begin
|
with VfsUtils.SysScanDir(SearchPath, FileMask) do begin
|
||||||
while IterNext(Item.Info.FileName, @Item.Info.Base) do begin
|
while IterNext(Item.Info.FileName, @Item.Info.Base) do begin
|
||||||
if VfsMatching.MatchPattern(Item.Info.FileName, pointer(CompiledMask)) and ((Exclude = nil) or (Exclude[WideStrToCaselessKey(Item.Info.FileName)] = nil)) then begin
|
if (Exclude = nil) or (Exclude[WideStrToCaselessKey(Item.Info.FileName)] = nil) then begin
|
||||||
Item.SearchName := StrLib.WideLowerCase(Item.Info.FileName);
|
Item.SearchName := StrLib.WideLowerCase(Item.Info.FileName);
|
||||||
Items.Add(Item); Item := nil;
|
Items.Add(Item); Item := nil;
|
||||||
Item := TDirListingItem.Create;
|
Item := TDirListingItem.Create;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user