Interface IPathProvider
- Namespace
- Invex.FileSystem
- Assembly
- Invex.FileSystem.dll
Defines a provider that can resolve a RootedPath for a given key within the file system.
public interface IPathProvider
Remarks
Multiple providers can be registered simultaneously. GetPath(string)
queries them in descending Priority order and returns the first non-null
result. A provider that does not recognize a key should return null to let the next
provider in the chain handle it.
Because GetPath(string) caches successful resolutions, sequential calls query a provider's GetPath(string) method at most once per key per lifetime of the IRootedFileSystem instance. Providers are queried outside the cache, so concurrent first resolutions of the same key may call GetPath(string) more than once; every caller still receives the same cached RootedPath instance.
Properties
Priority
Gets the priority of this provider.
int Priority { get; }
Property Value
- int
Remarks
Higher values are queried before lower values. When two providers can both resolve the same key the one with the higher priority wins. Use a negative value to register a low-priority fallback that only applies when no other provider matches.
Methods
GetPath(string)
Attempts to resolve a RootedPath for the given key.
RootedPath? GetPath(string key)
Parameters
keystringThe key identifying the path to locate (e.g.
"Root","Artifacts").
Returns
- RootedPath
A RootedPath if this provider recognises
key; otherwisenullto pass resolution to the next provider in the chain.