VFSPath.md

January 20, 2026 · View on GitHub

Atypical.VirtualFileSystem.Core

Atypical.VirtualFileSystem.Core

VFSPath Class

Represents a file system entry (file or directory) in the virtual file system.

public abstract record VFSPath : System.IComparable, System.IEquatable<Atypical.VirtualFileSystem.Core.VFSPath>

Inheritance System.Object 🡒 VFSPath

Derived
VFSDirectoryPath
VFSFilePath

Implements System.IComparable, System.IEquatable<VFSPath>

Constructors
VFSPath(string)Creates a new instance of VFSPath.
Properties
DepthGets the depth of the file system entry. The root directory has a depth of 0. The depth of a file is the depth of its parent directory plus one. The depth of a directory is the depth of its parent directory plus one.
HasParentIndicates whether the path has a parent directory.
IsRootGets a value indicating whether the directory is the root directory.
NameGets the name of the file system entry. The name of the root directory is ROOT_PATH. The name of a file is the name of the file with its extension.
ParentGets the path of the parent directory.
ValueGets the path of the file system entry with the VFS prefix.
Methods
Equals(VFSPath)Indicates whether the current object is equal to another object of the same type.
GetAbsoluteParentPath(int)Gets the absolute path of the parent directory with depth depthFromRoot. The root directory has a depth of 0. The depth of a file is the depth of its parent directory plus one. The depth of a directory is the depth of its parent directory plus one.
GetHashCode()Serves as the default hash function.
IsMatch(Regex)Indicates whether the specified regular expression finds a match in the path.
StartsWith(string)Determines whether the path starts with the specified path.