Class IntegerTagValueSyntax
- Namespace
- Hi.NcParsers.ParsingSyntaxs
- Assembly
- HiMech.dll
TagValueSyntax that parses numeric literal values to int. Variable text (e.g. Q2, #1, [#1+#2]) remains as string.
public class IntegerTagValueSyntax : TagValueSyntax, ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
IntegerTagValueSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
IntegerTagValueSyntax(IEnumerable<string>, IEnumerable<string>, string)
Initializes a new instance with the given category path, tag list, and variable-tag pattern.
public IntegerTagValueSyntax(IEnumerable<string> categoryPath, IEnumerable<string> tags, string variableTag)
Parameters
categoryPathIEnumerable<string>JSON path under
Parsingwhere matches are written.tagsIEnumerable<string>Single-letter tag names whose values are grabbed.
variableTagstringRegex/literal recognizing a variable reference as a value.
IntegerTagValueSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public IntegerTagValueSyntax(XElement src)
Parameters
srcXElementSource XML element.
Properties
XName
XML element name used to register this syntax with XFactory.
public static string XName { get; }
Property Value
Methods
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory
ToInteger(string)
Parses a numeric literal to int; returns the original string for variable text.
public static JsonNode ToInteger(string setup)
Parameters
setupstring
Returns
ToValueJsonNode(string)
Converts a tag setup string value to a JsonNode. Override in derived classes for typed parsing (int, double). Variable text (e.g. Q2, #1, [#1+#2]) is kept as string.
protected override JsonNode ToValueJsonNode(string setup)
Parameters
setupstring