ADD/StashFS: step-18: improve in TStashFileSource.IsSupportedPath()/TrailingPathDelimiter

This commit is contained in:
rich2014 2026-06-05 22:53:30 +08:00
commit b32aac982c
2 changed files with 8 additions and 2 deletions

View file

@ -56,14 +56,14 @@ end;
procedure TStashFilesBackend.addPath(const path: String);
begin
_paths.Add( path );
_paths.Add( ExcludeTrailingPathDelimiter(path) );
end;
procedure TStashFilesBackend.removePath(const path: String);
var
i: Integer;
begin
_paths.Find( path, i );
_paths.Find( ExcludeTrailingPathDelimiter(path), i );
if i >= 0 then
_paths.Delete( i );
end;

View file

@ -53,6 +53,7 @@ type
function GetProcessor: TFileSourceProcessor; override;
function GetRootDir(sPath : String): String; override;
class function IsSupportedPath(const Path: String): Boolean; override;
function GetProperties: TFileSourceProperties; override;
function GetSupportedFileProperties: TFilePropertiesTypes; override;
function GetRetrievableFileProperties: TFilePropertiesTypes; override;
@ -269,6 +270,11 @@ begin
Result:= PathDelim + STASH_NAME + PathDelim;
end;
class function TStashFileSource.IsSupportedPath(const Path: String): Boolean;
begin
Result:= Path.StartsWith( STASH_SCHEME );
end;
function TStashFileSource.GetProperties: TFileSourceProperties;
begin
Result:= _fileSystemFS.Properties;