PathMappings

References
public sealed class PathMappings
An ordered collection of PathMap instances.

Constructors

PathMappings

#
public PathMappings(params PathMap[] maps)
Create a new mapping collection.
maps (params PathMap[])

Properties

Count

#
public int Count { get; }
Gets the number of mappings stored in this collection.

Indexers

this[]

#
public PathMap this[int index] { get; }
Gets the map at the given index.
index (int)

Methods

Apply

#
public bool Apply(Path path, int item, out Path pathOut, out int itemOut)
Apply this collection of mappings to a path+item pair.
path (Path)Input path.
item (int)Input item index.
pathOut (out Path)Mapped output path is successful or the input path if not.
itemOut (out int)Mapped output item index if successful or the input item if not.
True if one of the mappings was successful.

Apply

#
public ITree Apply(ITree tree, bool omitUnaffected, out Path[] untouchedPaths, out Site[] untouchedSites)
Apply these mappings to a data tree.
tree (ITree)Tree to modify.
omitUnaffected (bool)If true, paths and sites which do not match against any of the mappings in this collection will be omitted from the output.
untouchedPaths (out Path[])List of all paths which could not be matched aginst any map.
untouchedSites (out Site[])List of all sites which could not be matched aginst any map.
Mapped tree.

TryParse

#
public static Result<PathMappings> TryParse(params string[] lines)
Parse a sequence of lines into mappings. Empty lines and lines starting with pound symbols will be ignored.
lines (params string[])