IVirtualFileSystem.md

June 4, 2025 · View on GitHub

Atypical.VirtualFileSystem.Core

Atypical.VirtualFileSystem.Core.Contracts

IVirtualFileSystem Interface

Represents a virtual file system. This is the main entry point for all operations on the file system. You can get an instance of this interface by calling CreateFileSystem().

public interface IVirtualFileSystem : Atypical.VirtualFileSystem.Core.Contracts.IVFSCreate, Atypical.VirtualFileSystem.Core.Contracts.IVFSDelete, Atypical.VirtualFileSystem.Core.Contracts.IVFSMove, Atypical.VirtualFileSystem.Core.Contracts.IVFSRename

Derived
VFS

Implements IVFSCreate, IVFSDelete, IVFSMove, IVFSRename

Properties
ChangeHistoryGets the change history of the file system.
DirectoriesFinds all directory nodes.
FilesFinds all file nodes.
IndexGets the file index of the file system. Basically, this is a dictionary that maps file paths to file nodes. This is useful for quickly finding a file node by its path.
IsEmptyIndicates whether the file system is empty. This is the case if the root directory is empty.
RootGets the root directory of the file system. This is the entry point for all operations on the file system.
RootPathGets the path of the root directory.
Methods
FindDirectories(Func<IDirectoryNode,bool>)Finds all directory nodes that match the specified predicate.
FindDirectories(Regex)Finds all directory nodes that match the specified regular expression. The regular expression must be relative to the root directory.
FindFiles(Func<IFileNode,bool>)Finds all file nodes that match the specified predicate.
FindFiles(Regex)Finds all file nodes that match the specified regular expression.
GetDirectory(VFSDirectoryPath)Gets a directory node by its path. The path must be absolute.
GetFile(VFSFilePath)Gets a file node by its path. The path must be absolute.
GetTree()Gets the tree of the file system.
TryGetDirectory(VFSDirectoryPath, IDirectoryNode)Try to get a directory node by its path. The path must be absolute. If the directory node does not exist, this method returns false and directory is set to null.
TryGetFile(VFSFilePath, IFileNode)Try to get a file node by its path. The path must be absolute.