Table of Contents

Class PathExtensions

Namespace
Olve.Paths.Glob
Assembly
Olve.Paths.Glob.dll

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

path IPath

The root directory to search within.

pattern string

The glob pattern to apply. Example: **/*.txt

matches IEnumerable<IPath>

When this method returns true, contains the matched file paths relative to path. If no matches were found or the path could not be resolved to an absolute path, this will be null.

ignoreCase bool

Determines whether pattern matching should ignore case. Defaults to false.

Returns

bool

true if the path was absolute and any matches were found; otherwise, false.