SiteRule

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

Constructors

SiteRule

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

Fields

AndOperator

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

AnyNumbersSymbol

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

AnyNumberSymbol

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

ItemBrackets

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

ItemCloseBracket

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

ItemOpenBracket

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

LessEqualOperator

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

LessOperator

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

MoreEqualOperator

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

MoreOperator

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

NotOperator

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

OrOperator

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

PathBrackets

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

PathCloseBracket

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

PathOpenBracket

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

PathSeparator

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

RangeCode

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

RangeSymbol

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

RuleBrackets

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

RuleCloseBracket

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

RuleOpenBracket

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

Separator

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

SequenceCode

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

SequenceSymbol

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

Properties

HasItemRule

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

HasPathRules

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

IsVariableLength

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

PathRuleCount

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

Methods

IsMatch

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

IsMatch

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

IsMatch

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

ToString

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

TryParse

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