IGlobEvaluatable Interface

Represents an object that can evaluate glob patterns against file system paths.

public interface IGlobEvaluatable

Properties

NameDescription
CanMatchDirectoriesGets a value indicating whether this glob pattern can match directories.
CanMatchFilesGets a value indicating whether this glob pattern can match files.
ModeGets the glob mode indicating whether this pattern includes or excludes matches.
TraverseDirectoriesGets a value indicating whether directories should be traversed when enumerating files.

CanMatchDirectories

Gets a value indicating whether this glob pattern can match directories.

bool CanMatchDirectories { get; }

Property value

bool

CanMatchFiles

Gets a value indicating whether this glob pattern can match files.

bool CanMatchFiles { get; }

Property value

bool

Mode

Gets the glob mode indicating whether this pattern includes or excludes matches.

GlobMode Mode { get; }

Property value

GlobMode

TraverseDirectories

Gets a value indicating whether directories should be traversed when enumerating files.

bool TraverseDirectories { get; }

Property value

bool

Methods

NameDescription
IsMatch(ReadOnlySpan<char>, ReadOnlySpan<char>, PathItemType?)Determines whether the specified path matches the glob pattern.
IsPartialMatch(ReadOnlySpan<char>, ReadOnlySpan<char>)Determines whether a directory should be recursed into when enumerating files.

IsMatch(ReadOnlySpan<char>, ReadOnlySpan<char>, PathItemType?)

Determines whether the specified path matches the glob pattern.

bool IsMatch(ReadOnlySpan<char> directory, ReadOnlySpan<char> filename, PathItemType? itemType)

Parameters

directory ReadOnlySpan<char>
The directory part of the path to match.
filename ReadOnlySpan<char>
The filename part of the path to match.
itemType PathItemType?
The type of the path item (file or directory), or null if unknown.

Returns

bool true if the path matches the pattern; otherwise, false.

IsPartialMatch(ReadOnlySpan<char>, ReadOnlySpan<char>)

Determines whether a directory should be recursed into when enumerating files.

bool IsPartialMatch(ReadOnlySpan<char> folderPath, ReadOnlySpan<char> filename)

Parameters

folderPath ReadOnlySpan<char>
The folder path to check.
filename ReadOnlySpan<char>
The filename part of the path to check.

Returns

bool true if the directory could contain matches; otherwise, false.