Generic tree structure accessed through disk-like paths. Developed in C# as a .NET Standard 2.1 library.
A path is a string delimited by certain character(s) where each item specifies the next level of the tree. The leading and trailing separators
are not enforced. By default, the separators are /
and \
. Only complete, absolute paths are currently supported. The following are some valid example paths:
/Root/Folder1/ResourceA
Root\Folder1\ResourceA
Tree which provides access to nodes through absolute paths.
Node which provides access to the parent node, children nodes, and an associated Item.
Several tree and node extension methods are available for the following traversal operations: breadth-first traversal, depth-first traversal, ancestors, and descendents.
The interfaces IPathTree<TNode, TItem>
and IPathNode<TNode, TItem>
define the basic contract.
The default implementation is provided through the abstract classes PathTreeBase<TNode, TItem>
and PathNodeBase<TNode, TItem>
. The built-in types derive directly from these with no changes besides the simpler type syntax for PathNode<TItem>
.
Simple CLI program that demonstrates how to programmatically build the tree using: 1. the built-in types 2. user-defined types through Monaco.PathTree.Abstractions
. Then prints the tree out to console.