diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 15438c5..ac17c22 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -6,11 +6,15 @@ on:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+"
+permissions:
+ contents: write
+
jobs:
publish:
+ if: github.repository == 'rameel/ramstack.globbing'
runs-on: ubuntu-latest
steps:
- - name: Setup .NET
+ - name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
@@ -21,8 +25,14 @@ jobs:
- name: Build
run: dotnet build -c Release
- - name: Pack
+ - name: Create NuGet Packages
run: dotnet pack -c Release -o ./nuget --no-build
- - name: Publish
+ - name: Publish NuGet Packages
run: dotnet nuget push ./nuget/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json
+
+ - name: Create GitHub Release
+ uses: softprops/action-gh-release@v2
+ with:
+ draft: true
+ files: nuget/*
diff --git a/Ramstack.Globbing.Tests/Ramstack.Globbing.Tests.csproj b/Ramstack.Globbing.Tests/Ramstack.Globbing.Tests.csproj
index a36ea1e..2a75b0b 100644
--- a/Ramstack.Globbing.Tests/Ramstack.Globbing.Tests.csproj
+++ b/Ramstack.Globbing.Tests/Ramstack.Globbing.Tests.csproj
@@ -12,10 +12,10 @@
-
-
-
-
+
+
+
+
diff --git a/Ramstack.Globbing.sln b/Ramstack.Globbing.sln
index 5454d5e..6d7b975 100644
--- a/Ramstack.Globbing.sln
+++ b/Ramstack.Globbing.sln
@@ -1,4 +1,3 @@
-
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35017.193
@@ -36,6 +35,4 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {449CB7E2-8227-4220-94D5-301CB5CC4EBC}
EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- EndGlobalSection
EndGlobal
diff --git a/Ramstack.Globbing/Internal/FileTreeHelper.cs b/Ramstack.Globbing/Internal/FileTreeHelper.cs
index 4f9f0b7..1ff5fb1 100644
--- a/Ramstack.Globbing/Internal/FileTreeHelper.cs
+++ b/Ramstack.Globbing/Internal/FileTreeHelper.cs
@@ -10,28 +10,34 @@ internal static class FileTreeHelper
///
/// Constructs the full name of a file by combining the path and the name.
///
- /// A buffer used for constructing the full name.
+ /// A buffer used for constructing the full name.
/// It should be obtained from an array pool and will be resized if necessary.
/// The path of the file.
/// The name of the file.
///
/// A representing the full name of the file.
///
- public static ReadOnlySpan GetFullName(ref char[] buffer, string path, string name)
+ public static ReadOnlySpan GetFullName(ref char[] chars, string path, string name)
{
- var length = path.Length + name.Length + 1;
- if (buffer.Length < length)
+ var array = chars;
+ var count = path.Length + name.Length + 1;
+
+ if (array.Length < count)
{
- ArrayPool.Shared.Return(buffer);
- buffer = ArrayPool.Shared.Rent(length);
+ ArrayPool.Shared.Return(array);
+ array = ArrayPool.Shared.Rent(count);
+ chars = array;
+
+ // Force null check to assist JIT
+ _ = array.Length;
}
- var fullName = buffer.AsSpan(0, length);
+ var fullName = array.AsSpan();
path.TryCopyTo(fullName);
fullName[path.Length] = '/';
name.TryCopyTo(fullName.Slice(path.Length + 1));
- return fullName;
+ return fullName.Slice(0, count);
}
}
diff --git a/Ramstack.Globbing/Ramstack.Globbing.csproj b/Ramstack.Globbing/Ramstack.Globbing.csproj
index a86a289..4cbbbbb 100644
--- a/Ramstack.Globbing/Ramstack.Globbing.csproj
+++ b/Ramstack.Globbing/Ramstack.Globbing.csproj
@@ -42,7 +42,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/Ramstack.Globbing/Traversal/DirectoryInfoExtensions.cs b/Ramstack.Globbing/Traversal/DirectoryInfoExtensions.cs
index 4cb40d2..c8ed791 100644
--- a/Ramstack.Globbing/Traversal/DirectoryInfoExtensions.cs
+++ b/Ramstack.Globbing/Traversal/DirectoryInfoExtensions.cs
@@ -23,19 +23,19 @@ public static class DirectoryInfoExtensions
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -59,7 +59,7 @@ public static class DirectoryInfoExtensions
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -85,19 +85,19 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -121,7 +121,7 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -147,19 +147,19 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -183,7 +183,7 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -209,19 +209,19 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -245,7 +245,7 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -271,19 +271,19 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -307,7 +307,7 @@ public static IEnumerable EnumerateFiles(this DirectoryInfo directory,
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -333,19 +333,19 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -369,7 +369,7 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -395,19 +395,19 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -431,7 +431,7 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -457,19 +457,19 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -493,7 +493,7 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -519,19 +519,19 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -555,7 +555,7 @@ public static IEnumerable EnumerateDirectories(this DirectoryInfo
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -581,19 +581,19 @@ public static IEnumerable EnumerateFileSystemInfos(this Director
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -617,7 +617,7 @@ public static IEnumerable EnumerateFileSystemInfos(this Director
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -643,19 +643,19 @@ public static IEnumerable EnumerateFileSystemInfos(this Director
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -679,7 +679,7 @@ public static IEnumerable EnumerateFileSystemInfos(this Director
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -705,19 +705,19 @@ public static IEnumerable EnumerateFileSystemInfos(this Director
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -741,7 +741,7 @@ public static IEnumerable EnumerateFileSystemInfos(this Director
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -755,10 +755,10 @@ private static IEnumerable EnumerateFiles(string path, string[] patter
{
flags = Files.AdjustMatchFlags(flags);
- return new FileSystemEnumerable(path, (ref FileSystemEntry entry) => (FileInfo)entry.ToFileSystemInfo(), options)
+ return new FileSystemEnumerable(path, (ref entry) => (FileInfo)entry.ToFileSystemInfo(), options)
{
- ShouldIncludePredicate = (ref FileSystemEntry entry) => Files.ShouldInclude(ref entry, patterns, excludes, flags, target),
- ShouldRecursePredicate = (ref FileSystemEntry entry) => Files.ShouldRecurse(ref entry, patterns, excludes, flags)
+ ShouldIncludePredicate = (ref entry) => Files.ShouldInclude(ref entry, patterns, excludes, flags, target),
+ ShouldRecursePredicate = (ref entry) => Files.ShouldRecurse(ref entry, patterns, excludes, flags)
};
}
@@ -766,10 +766,10 @@ private static IEnumerable EnumerateDirectories(string path, stri
{
flags = Files.AdjustMatchFlags(flags);
- return new FileSystemEnumerable(path, (ref FileSystemEntry entry) => (DirectoryInfo)entry.ToFileSystemInfo(), options)
+ return new FileSystemEnumerable(path, (ref entry) => (DirectoryInfo)entry.ToFileSystemInfo(), options)
{
- ShouldIncludePredicate = (ref FileSystemEntry entry) => Files.ShouldInclude(ref entry, patterns, excludes, flags, target),
- ShouldRecursePredicate = (ref FileSystemEntry entry) => Files.ShouldRecurse(ref entry, patterns, excludes, flags)
+ ShouldIncludePredicate = (ref entry) => Files.ShouldInclude(ref entry, patterns, excludes, flags, target),
+ ShouldRecursePredicate = (ref entry) => Files.ShouldRecurse(ref entry, patterns, excludes, flags)
};
}
@@ -777,10 +777,10 @@ private static IEnumerable EnumerateInfos(string path, string[]
{
flags = Files.AdjustMatchFlags(flags);
- return new FileSystemEnumerable(path, (ref FileSystemEntry entry) => entry.ToFileSystemInfo(), options)
+ return new FileSystemEnumerable(path, (ref entry) => entry.ToFileSystemInfo(), options)
{
- ShouldIncludePredicate = (ref FileSystemEntry entry) => Files.ShouldInclude(ref entry, patterns, excludes, flags, target),
- ShouldRecursePredicate = (ref FileSystemEntry entry) => Files.ShouldRecurse(ref entry, patterns, excludes, flags)
+ ShouldIncludePredicate = (ref entry) => Files.ShouldInclude(ref entry, patterns, excludes, flags, target),
+ ShouldRecursePredicate = (ref entry) => Files.ShouldRecurse(ref entry, patterns, excludes, flags)
};
}
}
diff --git a/Ramstack.Globbing/Traversal/FileTreeAsyncEnumerable.cs b/Ramstack.Globbing/Traversal/FileTreeAsyncEnumerable.cs
index 0188803..1a9bf5d 100644
--- a/Ramstack.Globbing/Traversal/FileTreeAsyncEnumerable.cs
+++ b/Ramstack.Globbing/Traversal/FileTreeAsyncEnumerable.cs
@@ -72,12 +72,14 @@ IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(Cancellat
{
CancellationTokenSource? source = null;
- if (_cancellationToken != default)
- cancellationToken = cancellationToken != default
+ if (_cancellationToken != CancellationToken.None)
+ cancellationToken = cancellationToken != CancellationToken.None
? (source = CancellationTokenSource.CreateLinkedTokenSource(_cancellationToken, cancellationToken)).Token
: _cancellationToken;
+ // ReSharper disable PossiblyMistakenUseOfCancellationToken
return EnumerateAsync(source, cancellationToken).GetAsyncEnumerator(cancellationToken);
+ // ReSharper restore PossiblyMistakenUseOfCancellationToken
}
private async IAsyncEnumerable EnumerateAsync(CancellationTokenSource? source, [EnumeratorCancellation] CancellationToken cancellationToken)
diff --git a/Ramstack.Globbing/Traversal/Files.cs b/Ramstack.Globbing/Traversal/Files.cs
index 55e8cdc..f04def3 100644
--- a/Ramstack.Globbing/Traversal/Files.cs
+++ b/Ramstack.Globbing/Traversal/Files.cs
@@ -23,19 +23,19 @@ public static partial class Files
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -59,7 +59,7 @@ public static partial class Files
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -85,19 +85,19 @@ public static IEnumerable EnumerateFiles(string path, string pattern, st
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -121,7 +121,7 @@ public static IEnumerable EnumerateFiles(string path, string pattern, st
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -147,19 +147,19 @@ public static IEnumerable EnumerateFiles(string path, string[] patterns,
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -183,7 +183,7 @@ public static IEnumerable EnumerateFiles(string path, string[] patterns,
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -209,19 +209,19 @@ public static IEnumerable EnumerateFiles(string path, string pattern, st
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -245,7 +245,7 @@ public static IEnumerable EnumerateFiles(string path, string pattern, st
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -271,19 +271,19 @@ public static IEnumerable EnumerateFiles(string path, string[] patterns,
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -307,7 +307,7 @@ public static IEnumerable EnumerateFiles(string path, string[] patterns,
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -333,19 +333,19 @@ public static IEnumerable EnumerateDirectories(string path, string patte
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -369,7 +369,7 @@ public static IEnumerable EnumerateDirectories(string path, string patte
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -395,19 +395,19 @@ public static IEnumerable EnumerateDirectories(string path, string[] pat
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -431,7 +431,7 @@ public static IEnumerable EnumerateDirectories(string path, string[] pat
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -457,19 +457,19 @@ public static IEnumerable EnumerateDirectories(string path, string patte
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -493,7 +493,7 @@ public static IEnumerable EnumerateDirectories(string path, string patte
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -519,19 +519,19 @@ public static IEnumerable EnumerateDirectories(string path, string[] pat
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -555,7 +555,7 @@ public static IEnumerable EnumerateDirectories(string path, string[] pat
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -581,19 +581,19 @@ public static IEnumerable EnumerateFileSystemEntries(string path, string
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -617,7 +617,7 @@ public static IEnumerable EnumerateFileSystemEntries(string path, string
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -643,19 +643,19 @@ public static IEnumerable EnumerateFileSystemEntries(string path, string
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -679,7 +679,7 @@ public static IEnumerable EnumerateFileSystemEntries(string path, string
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -705,19 +705,19 @@ public static IEnumerable EnumerateFileSystemEntries(string path, string
///
/// -
///
- /// Supported meta-characters include '*', '?', '\' and '[', ']'.
- /// And inside character classes '-', '!' and ']'.
+ /// Supported meta-characters include "*", "?", "\" and "[", "]".
+ /// And inside character classes "-", "!" and "]".
///
///
/// -
///
- /// The '.' and '..' symbols do not have any special treatment and are processed
+ /// The "." and ".." symbols do not have any special treatment and are processed
/// as regular characters for matching.
///
///
/// -
///
- /// Character classes can be negated by prefixing them with '!', such as [!0-9],
+ /// Character classes can be negated by prefixing them with "!", such as [!0-9],
/// which matches all characters except digits.
///
///
@@ -741,7 +741,7 @@ public static IEnumerable EnumerateFileSystemEntries(string path, string
///
/// -
///
- /// The '**' sequence in the glob pattern can be used to match zero or more directories and subdirectories.
+ /// The "**" sequence in the glob pattern can be used to match zero or more directories and subdirectories.
/// It can be used at the beginning, middle, or end of a pattern, for example,
/// "**/file.txt", "dir/**/*.txt", "dir/**".
///
@@ -755,10 +755,10 @@ private static IEnumerable EnumerateEntries(string path, string[] patter
{
flags = AdjustMatchFlags(flags);
- return new FileSystemEnumerable(Path.GetFullPath(path), (ref FileSystemEntry entry) => entry.ToFullPath(), options)
+ return new FileSystemEnumerable(Path.GetFullPath(path), (ref entry) => entry.ToFullPath(), options)
{
- ShouldIncludePredicate = (ref FileSystemEntry entry) => ShouldInclude(ref entry, patterns, excludes, flags, target),
- ShouldRecursePredicate = (ref FileSystemEntry entry) => ShouldRecurse(ref entry, patterns, excludes, flags)
+ ShouldIncludePredicate = (ref entry) => ShouldInclude(ref entry, patterns, excludes, flags, target),
+ ShouldRecursePredicate = (ref entry) => ShouldRecurse(ref entry, patterns, excludes, flags)
};
}
}