Class Navigator
- Namespace
- Yarhl.FileSystem
- Assembly
- Yarhl.dll
Filesystem navigator. Search for nodes and iterate over them.
public static class Navigator
- Inheritance
-
Navigator
- Inherited Members
Methods
IterateNodes<T>(T, NavigationMode)
Iterates the nodes recursively.
public static IEnumerable<T> IterateNodes<T>(T rootNode, NavigationMode mode = NavigationMode.BreadthFirst) where T : NavigableNode<T>
Parameters
rootNode
TThe root node to start iterating.
mode
NavigationModeThe navigation mode.
Returns
- IEnumerable<T>
The nodes.
Type Parameters
T
NavigableNode type.
SearchNode<T>(T, string)
Search a node by path.
public static T? SearchNode<T>(T rootNode, string path) where T : NavigableNode<T>
Parameters
rootNode
TThe root node to start the search.
path
stringPath to search.
Returns
- T
Node or null if not found.
Type Parameters
T
NavigableNode type.
Remarks
If the path starts with the path separator '/', it is considered to be a full path. Otherwise, it would be a relative path starting with the node in the argument.