7 instantiations of GlobNode
Microsoft.NET.Sdk.StaticWebAssets.Tasks (7)
Utils\Globbing\StaticWebAssetGlobMatcherBuilder.cs (7)
47
var includeRoot = new
GlobNode
();
53
excludeRoot = new
GlobNode
();
113
literalNode = new
GlobNode
();
134
Node = new
GlobNode
(),
191
extensionNode = new
GlobNode
();
209
current.RecursiveWildCard ??= new
GlobNode
();
221
current.WildCard ??= new
GlobNode
();
38 references to GlobNode
Microsoft.NET.Sdk.StaticWebAssets.Tasks (38)
Utils\Globbing\GlobNode.cs (7)
16
public Dictionary<string,
GlobNode
> LiteralsDictionary { get; set; }
17
public Dictionary<string,
GlobNode
>.AlternateLookup<ReadOnlySpan<char>> Literals { get; set; }
23
public Dictionary<string,
GlobNode
> ExtensionsDictionary { get; set; }
24
public Dictionary<string,
GlobNode
>.AlternateLookup<ReadOnlySpan<char>> Extensions { get; set; }
31
public
GlobNode
WildCard { get; set; }
33
public
GlobNode
RecursiveWildCard { get; set; }
85
public
GlobNode
Node { get; set; }
Utils\Globbing\StaticWebAssetGlobMatcher.cs (20)
10
public class StaticWebAssetGlobMatcher(
GlobNode
includes,
GlobNode
excludes)
42
private static GlobMatch MatchCore(
GlobNode
includes, PathTokenizer.SegmentCollection segments, Stack<MatchState> stateStack)
50
var
node = state.Node;
164
var
node = state.Node;
270
var
node = state.Node;
293
var
node = state.Node;
308
if (TryMatchExtension(node, remaining.Slice(indexOfDot), out
var
extensionCandidate))
323
var
node = state.Node;
326
if (TryMatchLiteral(node, segments[currentIndex], out
var
literalCandidate))
346
internal struct MatchState(
GlobNode
node, MatchStage stage, int segmentIndex, int extensionSegmentIndex, int complexSegmentIndex)
348
public MatchState(
GlobNode
node) : this(node, GetInitialStage(node), 0, 0, 0) { }
350
public
GlobNode
Node { get; set; } = node;
365
public readonly void Deconstruct(out
GlobNode
node, out MatchStage stage, out int segmentIndex, out int extensionIndex, out int complexIndex)
374
internal MatchState NextSegment(
GlobNode
candidate, int elements = 1, int complexIndex = 0) =>
452
private static MatchStage GetInitialStage(
GlobNode
node)
503
private static bool TryMatchExtension(
GlobNode
node, ReadOnlySpan<char> extension, out
GlobNode
extensionCandidate) =>
510
private static bool TryMatchLiteral(
GlobNode
node, ReadOnlySpan<char> current, out
GlobNode
nextNode) =>
Utils\Globbing\StaticWebAssetGlobMatcherBuilder.cs (11)
47
var
includeRoot = new GlobNode();
48
GlobNode
excludeRoot = null;
60
private static void BuildTree(
GlobNode
root, List<string> patterns, List<ReadOnlyMemory<char>> segments)
79
var
current = root;
102
private static bool TryAddLiteral(ReadOnlyMemory<char> segment, ref
GlobNode
current)
111
if (!current.Literals.TryGetValue(literal, out
var
literalNode))
125
private static bool TryAddComplexSegment(ReadOnlyMemory<char> segment, ReadOnlySpan<char> segmentSpan, ref
GlobNode
current)
177
private static bool TryAddExtension(ReadOnlyMemory<char> segment, ReadOnlySpan<char> segmentSpan, ref
GlobNode
current)
189
if (!current.Extensions.TryGetValue(extension, out
var
extensionNode))
205
private static bool TryAddRecursiveWildCard(ReadOnlySpan<char> segmentSpan, ref
GlobNode
current)
217
private static bool TryAddWildcard(ReadOnlySpan<char> segmentSpan, ref
GlobNode
current)