SiteRule

References
[DebuggerDisplay("{ToString()}")] public sealed class SiteRule
Represents a rule for matching tree sites.

Constructors

SiteRule

#
Constructs a new rule set for testing data trees.
public SiteRule(
pathRules,
A collection of path rules.
indexRule
Optional integer type (may be null).
)

Fields

AndOperator

#
Defines the AND operator for rule notation.
public const char AndOperator = '&'

AnyNumbersSymbol

#
Defines the 'ANY' operator in rule notation.
public const char AnyNumbersSymbol = '*'

AnyNumberSymbol

#
Defines the 'ANY-ONE' operator in rule notation.
public const char AnyNumberSymbol = '?'

ItemBrackets

#
None item brackets.
public const string ItemBrackets = "[ ]"

ItemCloseBracket

#
Defines the closing symbol for item sections.
public const char ItemCloseBracket = ']'

ItemOpenBracket

#
Defines the opening symbol for item sections.
public const char ItemOpenBracket = '['

LessEqualOperator

#
Defines the 'LESS-THAN-OR-EQUAL-TO' operator.
public const char LessEqualOperator = '≤'

LessOperator

#
Defines the 'LESS-THAN' operator.
public const char LessOperator = '<'

MoreEqualOperator

#
Defines the 'GREATER-THAN-OR-EQUAL-TO' operator.
public const char MoreEqualOperator = '≥'

MoreOperator

#
Defines the 'GREATER-THAN' operator.
public const char MoreOperator = '>'

NotOperator

#
Defines the NOT operator for rule notation.
public const char NotOperator = '!'

OrOperator

#
Defines the OR operator for rule notation.
public const char OrOperator = '|'

PathBrackets

#
None path brackets.
public const string PathBrackets = "{ }"

PathCloseBracket

#
Defines the closing symbol for path sections.
public const char PathCloseBracket = '}'

PathOpenBracket

#
Defines the opening symbol for path sections.
public const char PathOpenBracket = '{'

PathSeparator

#
Defines the separator for path elements.
public const char PathSeparator = ';'

RangeCode

#
Defines the range separator in rule notation. Any rule which contains this string is considered to be a RangeRule.
public const string RangeCode = " to "

RangeSymbol

#
Defines the range separator in rule notation. Any rule which contains this char is considered to be a RangeRule.
public const char RangeSymbol = '~'

RuleBrackets

#
None rule brackets.
public const string RuleBrackets = "( )"

RuleCloseBracket

#
Defines the opening symbol for rule group notation.
public const char RuleCloseBracket = ')'

RuleOpenBracket

#
Defines the opening symbol for rule group notation.
public const char RuleOpenBracket = '('

Separator

#
Defines the separator symbol for numeric entries in rule notation.
public const char Separator = ','

SequenceCode

#
Defines the sequence identifier in rule notation. Any rule which contains this string is considered to be a SequenceRule.
public const string SequenceCode = "..."

SequenceSymbol

#
Defines the sequence identifier in rule notation. Any rule which contains this char is considered to be a SequenceRule.
public const char SequenceSymbol = '…'

Properties

HasItemRule

#
Gets whether this type set has a defined integer type.
public bool HasItemRule { get; }

HasPathRules

#
Gets whether this type set has any path rules.
public bool HasPathRules { get; }

IsVariableLength

#
Gets whether this rule complex supports variable length paths by virtue of having at least a single '*' wildcard.
public bool IsVariableLength { get; }

PathRuleCount

#
Gets the number of defined path rules.
public int PathRuleCount { get; }

Methods

IsMatch

#
Test the item rule on a single index.
public bool IsMatch(
item
Index to test.
)
True if index pass all the item test.

IsMatch

#
Test all the local rules to a path+integer combination.
public bool IsMatch(
path,
Path to test.
item
Index to test.
)
True if path+integer pass all the type tests.

IsMatch

#
Test all the local rules to a path.
public bool IsMatch(
path
Path to test.
)
True if path passes all the type tests.

ToString

#
Returns a properly formatted string describing this ruleset.
public override string ToString()
Object.ToString

TryParse

#
Attempt to parse a Pattern string.
public static SiteRule TryParse(
text,
String to parse.
out string
message
If this function fails, msg will contain a message describing the error.
)
True on success, false on failure.