PathMatcher Class

Summary

[Editor-Only] A utility for finding file paths that match certain targets as closely as possible.
Assembly
Weaver.dll
Namespace
Weaver.Editor
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["PathMatcher"] class Type type-node

Syntax

public class PathMatcher

Constructors

Name Summary
PathMatcher(IList<string>) Creates a new Weaver.Editor.PathMatcher that tries to find paths as close to any of the specified `targetPaths` as possible, with paths earliest in ths list getting the highest priority.

Fields

Name Constant Value Summary
TargetPaths
The paths this matcher is trying to find a match for.

Properties

Name Value Summary
MatchedPath string
The best match that has been found so far.
MatchedTargetIndex int
The index in the Weaver.Editor.PathMatcher.TargetPaths of the Weaver.Editor.PathMatcher.MatchedPath.

Methods

Name Value Summary
FinalValidation(string) bool
Once a potentially better match is found, this method is called to verify that it is actually an acceptable target.
IsSeparator(char) bool
Returns true if the specified value is a space or any of the following characters: ./+
static
Reset() void
Clears the Weaver.Editor.PathMatcher.MatchedPath and Weaver.Editor.PathMatcher.MatchedTargetIndex.
TryMatchFile(string) bool
If the specified `path` to see if it's a better match than the current Weaver.Editor.PathMatcher.MatchedPath this method sets it as the Weaver.Editor.PathMatcher.MatchedPath and returns true.