Class PathExtensions
Provides extension methods for glob pattern matching on IPath instances.
public static class PathExtensions
- Inheritance
-
PathExtensions
- Inherited Members
Methods
TryGlob(IPath, string, out IEnumerable<IPath>?, bool)
Attempts to find files matching a glob pattern within the specified directory path.
public static bool TryGlob(this IPath path, string pattern, out IEnumerable<IPath>? matches, bool ignoreCase = false)
Parameters
pathIPathThe root directory to search within.
patternstringThe glob pattern to apply. Example:
**/*.txtmatchesIEnumerable<IPath>When this method returns
true, contains the matched file paths relative topath. If no matches were found or the path could not be resolved to an absolute path, this will benull.ignoreCaseboolDetermines whether pattern matching should ignore case. Defaults to
false.
Returns
- bool
trueif the path was absolute and any matches were found; otherwise,false.