in Core/src/Impl/Commands/PathTree.cs [14:45]
internal readonly struct PathTree(PathTreeNode rootNode)
{
/// <summary>
/// Creates builder for the tree
/// </summary>
public static PathTreeBuilder BuildNew() => PathTreeBuilder.BuildNew();
public PathTreeNode Root => rootNode;
/// <summary>
/// Lookup tree recursively.
/// <paramref name="dirPath"/> should be a directory (file part is not allowed)
/// </summary>
/// <param name="dirPath">Directory path (file name should be excluded)</param>
/// <param name="directorySeparator">Directory separator symbol</param>
public PathTreeNode? LookupPathRecursive(string dirPath, char directorySeparator)
{
return rootNode.LookupPathRecursive(dirPath.AsSpan(), directorySeparator);
}
public PathTreeNode? LookupPathRecursive(ReadOnlySpan<char> dirPath, char directorySeparator)
{
return rootNode.LookupPathRecursive(dirPath, directorySeparator);
}
public PathTreeNode? LookupPathRecursive(SymbolStoragePath dirStoragePath)
{
return rootNode.LookupPathRecursive(dirStoragePath.Path.AsSpan(), SymbolStoragePath.DirectorySeparator);
}
public PathTreeNode? LookupPathRecursive(SymbolStoragePathRef dirStoragePath)
{
return rootNode.LookupPathRecursive(dirStoragePath.Path, SymbolStoragePath.DirectorySeparator);
}
}