Meziantou.Framework.Globbing namespace

Classes

NameDescription
GitIgnoreMatcherDetermines which paths of a git working tree are ignored, as git status and git check-ignore do, and enumerates the files that are not ignored.
GitIgnoreMatcherOptionsOptions for GitIgnoreMatcher.
GlobGlob patterns specify sets of filenames with wildcard characters. Supported syntaxes:
WildcardDescription
*matches any number of characters including none, excluding directory separator
?matches a single character
[abc]matches one character in the brackets
[!abc]matches any character not in the brackets. GlobDialect.Git, GlobDialect.Posix and GlobDialect.PosixPath also accept [^abc].
[a-z]matches one character from the range given in the brackets. With GlobOptions.IgnoreCase, a character matches when it, its lowercase form or its uppercase form is in the range.
[!a-z]matches one character that is not from the range given in the brackets, using the same rule as [a-z] for GlobOptions.IgnoreCase.
[[:alpha:]]matches one character of a POSIX character class. Only supported by GlobDialect.Git, GlobDialect.Posix and GlobDialect.PosixPath. The supported classes are alnum, alpha, blank, cntrl, digit, graph, lower, print, punct, space, upper and xdigit. With GlobOptions.IgnoreCase, upper and lower match a letter of either case.
[[=a=]] [[.a.]]an equivalence class and a collating symbol, which both stand for the character they hold. Only supported by GlobDialect.Posix and GlobDialect.PosixPath. A collating symbol can be a range bound: [[.-.]-0].
{abc,*.cs}comma-delimited alternatives, matches 'abc' or a name ending with '.cs'. An alternative can hold wildcards, bracket expressions and other braces, and a '/' or a '**', as in {src/**,tests}/*.cs. Only supported by GlobDialect.Standard; the other dialects read the braces as ordinary characters.
**matches zero or more directories when it makes a whole path segment. A trailing ** matches at least one segment. The POSIX dialects read it as a *.
!patternleading '!' negates the pattern. Only supported by GlobDialect.Standard and GlobDialect.Git.
\xescapes the following character. For instance, '\*' matches the literal character '*' instead of being a wildcard. GlobDialect.Git and the POSIX dialects also read an escape in a bracket expression. GlobDialect.MSBuild reads '\' as a path separator and escapes a character with %XX instead.
If the pattern ends with a /, only directories are matched. Otherwise, only files are matched. A GlobDialect.Git pattern matches both a file and a directory, and one ending with a / matches the directory itself as well as everything below it. A GlobDialect.Posix pattern matches a plain string, whatever the kind of item. GlobDialect.Git, GlobDialect.MSBuild, GlobDialect.Posix and GlobDialect.PosixPath follow the behavior of git, MSBuild and fnmatch(3), which the tests check against corpora produced by those implementations. The exceptions are deliberate: characters are compared as UTF-16 code units (git compares the bytes of their UTF-8 encoding), a path ending with a / is a directory (fnmatch compares strings), and a pattern that can never match anything, such as one holding an unknown character class, is rejected. The cost of a single Glob.IsMatch call is polynomial in the length of the pattern and of the path, whatever the number of wildcards.
GlobCollectionRepresents a collection of glob patterns that can be evaluated together.
GlobExtensionsProvides extension methods for working with glob patterns.
GlobFileSystemEnumeratorEnumerates file system entries that match a glob pattern, returning full paths as strings.
GlobFileSystemEnumerator<T>Provides a base class for enumerating file system entries that match a glob pattern.

Interfaces

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

Enums

NameDescription
GlobDialectSpecifies the glob pattern dialect to use when parsing a pattern.
GlobModeDetermines whether a glob pattern should include or exclude matching paths.
GlobOptionsOptions for controlling glob pattern parsing and matching behavior.
GlobPathFormatSpecifies the format of the paths returned when enumerating the entries that match a glob pattern.
PathItemTypeSpecifies whether a path represents a file or a directory.