PathMap

References
public sealed class PathMap
A single path mapping operation.

Properties

Cascade

#
public bool Cascade { get; }
Gets whether this mapping cascades from previous mappings.

HasItemIn

#
public bool HasItemIn { get; }
Gets whether this mapping has an ITEM identifier for the input.

HasItemOut

#
public bool HasItemOut { get; }
Gets whether this mapping has an ITEM expression for the output.

InputFormat

#
public string InputFormat { get; }
Gets the input format, including the item if defined.

MaximumLength

#
public int MaximumLength { get; }
Gets the longest path that could possibly match this map. If the map contains sequence wildcards, the maximum length is always int.MaxValue.

MinimumLength

#
public int MinimumLength { get; }
Gets the shortest path that could possibly match this map.

OutputFormat

#
public string OutputFormat { get; }
Gets the output format, including the item if defined.

PathInCount

#
public int PathInCount { get; }
Gets the number of PATH input identifiers.

PathOutCount

#
public int PathOutCount { get; }
Gets the number of PATH output identifiers.

Methods

Apply

#
public bool Apply(Path path, int item, out Path pathOut, out int itemOut, out string error)
Apply this mapping to a path+item pair.
path (Path)Path to map.
item (int)Item to map.
pathOut (out Path)Mapped path.
itemOut (out int)Mapped item. If there is no defined item mapping, -1 will be returned here, indicating no preferred location for the item.
error (out string)Error in case of failure.
True on success, false on failure.

ItemInConstant

#
public bool ItemInConstant(out int constant)
Gets whether the input item is a constant.
constant (out int)

ItemInIdentifier

#
public string ItemInIdentifier()
Gets the identifier of the input item.

ItemOutExpression

#
public string ItemOutExpression()
Gets the expression for the output index.

Matches

#
public bool Matches(Path path, int item)
Test whether this mapping applies to a given path and item index.
path (Path)
item (int)

Matches

#
public bool Matches(Path path)
Test whether this mapping applies to a given path.
path (Path)

PathInConstant

#
public bool PathInConstant(int index, out int constant)
Gets whether the i-th input element is a constant.
index (int)
constant (out int)

PathInIdentifier

#
public string PathInIdentifier(int index)
Gets the identifier associated with the i-th element in the input.
index (int)

PathOutConstant

#
public bool PathOutConstant(int index, out int constant)
Gets whether the i-th input element is a constant.
index (int)
constant (out int)

PathOutExpression

#
public string PathOutExpression(int index)
Gets the expression assigned to the i-th element in the output.
index (int)

ToString

#
public override string ToString()
Object.ToString

TryParse

#
public static Result<PathMap> TryParse(string notation)
Parse a mapping notation.
notation (string)