- BinaryFileNode
ClassRepresents a binary file node in the virtual file system. Extends the standard file node to support binary content in addition to text.- BinaryFileNode(VFSFilePath, byte[])
ConstructorInitializes a new instance of the BinaryFileNode class with binary content. - BinaryFileNode(VFSFilePath, string)
ConstructorInitializes a new instance of the BinaryFileNode class. - BinaryContent
PropertyGets or sets the binary content of the file. - IsBinary
PropertyGets a value indicating whether this file contains binary data. - SizeInBytes
PropertyGets the size of the binary content in bytes. - Copy(VFSFilePath)
MethodCreates a copy of the current binary file node. - SetBinaryContent(byte[])
MethodSets the content from binary data and updates the text representation. - SetContentFromBase64(string)
MethodSets the content from a base64 encoded string. - SetTextContent(string)
MethodSets the content from a text string and clears binary content. - ToBase64String()
MethodGets the binary content as a base64 encoded string. - ToString()
MethodReturns a string representation of the binary file node.
- BinaryFileNode(VFSFilePath, byte[])
- ChangeHistory
ClassRepresents a history of changes in a virtual file system.- ChangeHistory(IVirtualFileSystem)
ConstructorInitializes a new instance of the ChangeHistory class. - RedoStack
PropertyGets the redo stack. - UndoStack
PropertyGets the undo stack. - AddChange(VFSEventArgs)
MethodAdds a change to the history. - Dispose()
MethodPerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - Dispose(bool)
MethodReleases the unmanaged resources used by the ChangeHistory and optionally releases the managed resources. - OnChange(VFSEventArgs)
MethodHandles the change event from the virtual file system. - Redo()
MethodRedoes the most recent undone change. - Undo()
MethodUndoes the most recent change. - ~ChangeHistory()
MethodFinalizes an instance of the ChangeHistory class.
- ChangeHistory(IVirtualFileSystem)
- DirectoryNode
ClassRepresents a directory in the virtual file system.- DirectoryNode(VFSDirectoryPath)
ConstructorInitializes a new instance of the DirectoryNode class. Creates a new directory node. The directory is created with the current date and time as creation and last modification date. - Directories
PropertyGets the child directories of the node. - Files
PropertyGets the child files of the node. - IsDirectory
PropertyIndicates whether the node is a directory. - IsFile
PropertyIndicates whether the node is a file. - AddChild(IVirtualFileSystemNode)
Methodx Adds a child node to the current directory. - RemoveChild(IVirtualFileSystemNode)
MethodRemoves a child node from the current directory. - ToString()
MethodReturns a string that represents the path of the directory.
- DirectoryNode(VFSDirectoryPath)
- EventConfiguration
ClassConfiguration for event handling.- AsyncEvents
PropertyGets or sets whether events should be fired asynchronously. Default is false for synchronous events. - Default
PropertyGets the default event configuration. - EnableDirectoryEvents
PropertyGets or sets whether to enable directory operation events. - EnableEvents
PropertyGets or sets whether to enable all events. Default is true. - EnableFileEvents
PropertyGets or sets whether to enable file operation events. - MaxEventHandlers
PropertyGets or sets the maximum number of event handlers per event type. Default is 100. Set to 0 for unlimited. - DirectoryEventsOnly()
MethodCreates a configuration with only directory events enabled. - Disabled()
MethodCreates a configuration with all events disabled. - FileEventsOnly()
MethodCreates a configuration with only file events enabled. - WithAsyncEvents()
MethodCreates a configuration with asynchronous events.
- AsyncEvents
- FileNode
ClassRepresents a file in the virtual file system.- FileNode(VFSFilePath, string)
ConstructorInitializes a new instance of the FileNode class. Creates a new file node. The file is created with the current date and time as creation and last modification date. - Content
PropertyGets the content of the file as a string. The encoding is in UTF-8. - IsDirectory
PropertyIndicates whether the node is a directory. - IsFile
PropertyIndicates whether the node is a file. - ToString()
MethodReturns a string that represents the path of the file.
- FileNode(VFSFilePath, string)
- PathSeparatorConfiguration
ClassConfiguration for path separators.- AllSeparators
PropertyGets all accepted path separators. - AlternativeSeparators
PropertyGets or sets alternative path separators that are accepted. Default accepts both '/' and '\'. - Default
PropertyGets the default path separator configuration. - PrimarySeparator
PropertyGets or sets the primary path separator. Default is '/'. - UnixOnly()
MethodCreates a configuration that only accepts forward slashes. - WindowsOnly()
MethodCreates a configuration that only accepts backslashes.
- AllSeparators
- RootNode
ClassRepresents the root directory of the virtual file system.- RootNode()
ConstructorInitializes a new instance of the RootNode class. - ToString()
MethodReturns a string that represents the current object. For RootNode this is always the constant string <cref see="ROOT_PATH" />.
- RootNode()
- VFS
ClassConstants used by the Virtual File System.- VFS()
ConstructorInitializes a new instance of the VFS class. - DIRECTORY_SEPARATOR
FieldThe directory separator. This is the character used to separate directory names. - ROOT_PATH
FieldThe root path. This is the path used to identify the root directory. - ChangeHistory
PropertyGets the change history of the file system. - Directories
PropertyFinds all directory nodes. - Files
PropertyFinds all file nodes. - Index
PropertyGets 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. - IsEmpty
PropertyIndicates whether the file system is empty. This is the case if the root directory is empty. - Root
PropertyGets the root directory of the file system. This is the entry point for all operations on the file system. - RootPath
PropertyGets the path of the root directory. - CreateDirectory(VFSDirectoryPath)
MethodCreates a directory node at the specified path. The path must be absolute. - CreateFile(VFSFilePath, string)
MethodCreates a file node at the specified path. The path must be absolute. - DeleteDirectory(VFSDirectoryPath)
MethodDeletes a directory node at the specified path. The path must be absolute. - DeleteFile(VFSFilePath)
MethodDeletes a file node at the specified path. The path must be absolute. - FindDirectories(Func<IDirectoryNode,bool>)
MethodFinds all directory nodes that match the specified predicate. - FindDirectories(Regex)
MethodFinds all directory nodes that match the specified regular expression. The regular expression must be relative to the root directory. - FindFiles(Func<IFileNode,bool>)
MethodFinds all file nodes that match the specified predicate. - FindFiles(Regex)
MethodFinds all file nodes that match the specified regular expression. - GetDirectory(VFSDirectoryPath)
MethodGets a directory node by its path. The path must be absolute. - GetFile(VFSFilePath)
MethodGets a file node by its path. The path must be absolute. - GetTree()
MethodGets the tree of the file system. - MoveDirectory(VFSDirectoryPath, VFSDirectoryPath)
MethodMoves a directory from one location to another. - MoveFile(VFSFilePath, VFSFilePath)
MethodMoves a file node from the source path to the destination path. Both paths must be absolute. - RenameDirectory(VFSDirectoryPath, string)
MethodRenames a directory. - RenameFile(VFSFilePath, string)
MethodRenames a file node at the specified path. The path must be absolute. - ToString()
MethodReturns a string that represents the current object. - TryGetDirectory(VFSDirectoryPath, IDirectoryNode)
MethodTry to get a directory node by its path. The path must be absolute. If the directory node does not exist, this method returnsfalseand directory is set tonull. - TryGetFile(VFSFilePath, IFileNode)
MethodTry to get a file node by its path. The path must be absolute. - DirectoryCreated
EventEvent triggered when a directory is created. - DirectoryDeleted
EventEvent triggered when a directory is deleted. - DirectoryMoved
EventEvent triggered when a directory is moved. - DirectoryRenamed
EventEvent triggered when a directory is renamed. - FileCreated
EventEvent triggered when a file is created. - FileDeleted
EventEvent triggered when a file is deleted. - FileMoved
EventEvent triggered when a file is moved. - FileRenamed
EventEvent triggered when a file is renamed.
- VFS()
- VFSConfiguration
ClassConfiguration options for the Virtual File System.- CaseSensitive
PropertyGets or sets whether file and directory operations are case sensitive. Default is false (case insensitive). - Default
PropertyGets the default VFS configuration. - EnableChangeHistory
PropertyGets or sets whether to enable change history tracking. Default is true. - EnableIndexCaching
PropertyGets or sets whether to enable index caching for performance. Default is true. - Events
PropertyGets or sets event handling configuration. - MaxChangeHistorySize
PropertyGets or sets the maximum number of operations to keep in change history. Default is 1000. Set to 0 for unlimited (not recommended). - MaxFileSize
PropertyGets or sets the maximum file size in bytes for content operations. Default is 1MB. Set to 0 for unlimited. - MaxRecursionDepth
PropertyGets or sets the maximum depth for recursive operations. Default is 100 to prevent infinite recursion. - NormalizePaths
PropertyGets or sets whether to normalize paths automatically. Default is true. - PathComparison
PropertyGets or sets the string comparison type for path operations. - PathSeparators
PropertyGets or sets custom path separators. Default uses forward slash. - ValidatePaths
PropertyGets or sets whether to validate paths on creation. Default is true. - ForPerformance()
MethodCreates a new configuration optimized for performance. - ForSafety()
MethodCreates a new configuration optimized for safety and validation. - WithCaseInsensitivity()
MethodCreates a new configuration with case insensitivity. - WithCaseSensitivity()
MethodCreates a new configuration with case sensitivity enabled. - WithMaxFileSize(long)
MethodCreates a new configuration with custom maximum file size. - WithoutChangeHistory()
MethodCreates a new configuration with change history disabled.
- CaseSensitive
- VFSDirectoryCreatedArgs
ClassProvides data for the DirectoryCreated event.- VFSDirectoryCreatedArgs(VFSDirectoryPath)
ConstructorInitializes a new instance of the VFSDirectoryCreatedArgs class. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - Path
PropertyGets the path of the created directory. - Timestamp
PropertyGets the timestamp when the directory was created.
- VFSDirectoryCreatedArgs(VFSDirectoryPath)
- VFSDirectoryDeletedArgs
ClassProvides data for the DirectoryDeleted event.- VFSDirectoryDeletedArgs(VFSDirectoryPath)
ConstructorInitializes a new instance of the VFSDirectoryDeletedArgs class. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - Path
PropertyGets the path of the deleted directory. - Timestamp
PropertyGets the timestamp when the directory was deleted.
- VFSDirectoryDeletedArgs(VFSDirectoryPath)
- VFSDirectoryMovedArgs
ClassProvides data for the DirectoryMoved event.- VFSDirectoryMovedArgs(VFSDirectoryPath, VFSDirectoryPath)
ConstructorInitializes a new instance of the VFSDirectoryMovedArgs class. - DestinationPath
PropertyGets the destination path of the moved directory. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - SourcePath
PropertyGets the source path of the moved directory. - Timestamp
PropertyGets the timestamp when the directory was moved.
- VFSDirectoryMovedArgs(VFSDirectoryPath, VFSDirectoryPath)
- VFSDirectoryPath
ClassRepresents a directory in the virtual file system. A directory is a first-class citizen in the virtual file system. It can contain files and other directories.- VFSDirectoryPath(string)
ConstructorInitializes a new instance of the VFSDirectoryPath class. The file path is relative to the root of the virtual file system. - ToString()
MethodReturns a string that represents the current object. The string representation of the directory path is the path itself. - implicit operator VFSDirectoryPath(string)
OperatorImplicit conversion from string. This allows you to use a string as a VFSDirectoryPath. - implicit operator string(VFSDirectoryPath)
OperatorImplicit conversion to string This allows you to use a VFSDirectoryPath as a string.
- VFSDirectoryPath(string)
- VFSDirectoryRenamedArgs
ClassProvides data for the DirectoryRenamed event.- VFSDirectoryRenamedArgs(VFSDirectoryPath, string, string, VFSDirectoryPath)
ConstructorInitializes a new instance of the VFSDirectoryRenamedArgs class. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - NewName
PropertyGets the new name of the renamed directory. - NewPath
PropertyGets the new path of the renamed directory. - OldName
PropertyGets the old name of the renamed directory. - Path
PropertyGets the old path of the renamed directory. - Timestamp
PropertyGets the timestamp when the directory was renamed.
- VFSDirectoryRenamedArgs(VFSDirectoryPath, string, string, VFSDirectoryPath)
- VFSEventArgs
ClassRepresents the base class for all VFS event arguments.- Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - ToMarkup(string, object[])
MethodTransforms a message into a markup message with the specified color.
- Message
- VFSFileCreatedArgs
ClassProvides data for the FileCreated event.- VFSFileCreatedArgs(VFSFilePath, string)
ConstructorInitializes a new instance of the VFSFileCreatedArgs class. - Content
PropertyGets the content of the created file. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - Path
PropertyGets the path of the created file. - Timestamp
PropertyGets the timestamp when the file was created.
- VFSFileCreatedArgs(VFSFilePath, string)
- VFSFileDeletedArgs
ClassProvides data for the FileDeleted event.- VFSFileDeletedArgs(VFSFilePath, string)
ConstructorInitializes a new instance of the VFSFileDeletedArgs class. - Content
PropertyGets the content of the deleted file. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - Path
PropertyGets the path of the deleted file. - Timestamp
PropertyGets the timestamp when the file was deleted.
- VFSFileDeletedArgs(VFSFilePath, string)
- VFSFileMovedArgs
ClassProvides data for the FileMoved event.- VFSFileMovedArgs(VFSFilePath, VFSFilePath)
ConstructorInitializes a new instance of the VFSFileMovedArgs class. - DestinationPath
PropertyGets the destination path of the moved file. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - SourcePath
PropertyGets the source path of the moved file. - Timestamp
PropertyGets the timestamp when the file was moved.
- VFSFileMovedArgs(VFSFilePath, VFSFilePath)
- VFSFilePath
ClassRepresents a file system entry in the virtual file system. A file is a first-class citizen in the virtual file system.- VFSFilePath(string)
ConstructorInitializes a new instance of the VFSFilePath class. The file path is relative to the root of the virtual file system. - ToString()
MethodReturns a string that represents the current object. The file path is relative to the root of the virtual file system. - implicit operator VFSFilePath(string)
OperatorImplicit conversion from string. This allows you to use a string as a VFSFilePath. - implicit operator string(VFSFilePath)
OperatorImplicit conversion to string This allows you to use a VFSFilePath as a string.
- VFSFilePath(string)
- VFSFileRenamedArgs
ClassProvides data for the FileRenamed event.- VFSFileRenamedArgs(VFSFilePath, string, string)
ConstructorInitializes a new instance of the VFSFileRenamedArgs class. - Message
PropertyGets the message. - MessageTemplate
PropertyGets the message template. - MessageWithMarkup
PropertyGets the message with markup. - NewName
PropertyGets the new name of the renamed file. - OldName
PropertyGets the old name of the renamed file. - Path
PropertyGets the source path of the renamed file. - Timestamp
PropertyGets the timestamp when the file was renamed.
- VFSFileRenamedArgs(VFSFilePath, string, string)
- VFSIndex
ClassRepresents the index of the virtual file system.- Count
PropertyGets the total count of nodes in the index. - Directories
PropertyGets the directories in the index. - DirectoriesCount
PropertyGets the count of directories in the index. - Files
PropertyGets the files in the index. - FilesCount
PropertyGets the count of files in the index. - IsEmpty
PropertyGets a value indicating whether the index is empty. - Keys
PropertyGets the keys of the raw index. - RawIndex
PropertyGets the raw index of the virtual file system. - this[VFSDirectoryPath]
PropertyGets or sets the node at the specified directory path. - this[VFSFilePath]
PropertyGets or sets the node at the specified file path. - Values
PropertyGets the values of the raw index. - ContainsKey(VFSPath)
MethodDetermines whether the index contains the specified key. - GetDirectory(VFSDirectoryPath)
MethodGets the directory node at the specified directory path. - GetFile(VFSFilePath)
MethodGets the file node at the specified file path. - GetPathsStartingWith(VFSDirectoryPath)
MethodGets the paths starting with the specified directory path. - Remove(VFSPath)
MethodRemoves the node with the specified key. - ToString()
MethodReturns a string that represents the current object. - TryAdd(VFSPath, IVirtualFileSystemNode)
MethodTries to add the specified node to the index. - TryGetDirectory(VFSDirectoryPath, IDirectoryNode)
MethodTries to get the directory node at the specified directory path. - TryGetFile(VFSFilePath, IFileNode)
MethodTries to get the file node at the specified file path.
- Count
- VFSNode
ClassRepresents a node in a virtual file system. A node can be a file or a directory.- VFSNode(VFSPath)
ConstructorInitializes a new instance of the VFSNode class. This constructor is used by derived classes. - CreationTime
PropertyGets the creation time of the node. - IsDirectory
PropertyIndicates whether the node is a directory. - IsFile
PropertyIndicates whether the node is a file. - LastAccessTime
PropertyGets the last access time of the node. - LastWriteTime
PropertyGets the last write time of the node. - Path
PropertyGets the creation time of the node. - UpdatePath(VFSPath)
MethodUpdates the path of the node.
- VFSNode(VFSPath)
- VFSPath
ClassRepresents a file system entry (file or directory) in the virtual file system.- VFSPath(string)
ConstructorCreates a new instance of VFSPath. - Depth
PropertyGets 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. - HasParent
PropertyIndicates whether the path has a parent directory. - IsRoot
PropertyGets a value indicating whether the directory is the root directory. - Name
PropertyGets 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. - Parent
PropertyGets the path of the parent directory. - Value
PropertyGets the path of the file system entry with the VFS prefix. - Equals(VFSPath)
MethodIndicates whether the current object is equal to another object of the same type. - GetAbsoluteParentPath(int)
MethodGets 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()
MethodServes as the default hash function. - IsMatch(Regex)
MethodIndicates whether the specified regular expression finds a match in the path. - StartsWith(string)
MethodDetermines whether the path starts with the specified path.
- VFSPath(string)
- VFSRootPath
ClassRepresents the root directory of the virtual file system.- VFSRootPath()
ConstructorRepresents the root directory of the virtual file system. - ToString()
MethodReturns a string that represents the current object. The string representation of the root directory is the constant ROOT_PATH. - implicit operator string(VFSRootPath)
OperatorImplicit conversion to string This allows you to use a VFSRootPath as a string.
- VFSRootPath()
- VirtualFileSystemException
ClassException thrown by the VFS.- VirtualFileSystemException()
ConstructorInitializes a new instance of the VirtualFileSystemException class. - VirtualFileSystemException(string)
ConstructorInitializes a new instance of the VirtualFileSystemException class with a message that describes the error. - VirtualFileSystemException(string, Exception)
ConstructorInitializes a new instance of the VirtualFileSystemException class with a message and an inner exception that is the cause of this exception.
- VirtualFileSystemException()
- VirtualFileSystemFactory
ClassRepresents a factory for creating IVirtualFileSystem instances.- VirtualFileSystemFactory()
ConstructorInitializes a new instance of the VirtualFileSystemFactory class. - CreateFileSystem()
MethodCreates a new instance of IVirtualFileSystem.
- VirtualFileSystemFactory()
- Result
StructRepresents the result of an operation that can either succeed or fail without a return value.- Error
PropertyGets the error message. Only available when IsFailure is true. - IsFailure
PropertyGets a value indicating whether the operation failed. - IsSuccess
PropertyGets a value indicating whether the operation was successful. - Combine(Result)
MethodCombines this result with another result. - Failure(string)
MethodCreates a failed result with the specified error message. - Failure(Exception)
MethodCreates a failed result from an exception. - Map<T>(Func<T>)
MethodTransforms the result to a result with a value. - OnFailure(Action<string>)
MethodExecutes an action if the result is a failure. - OnSuccess(Action)
MethodExecutes an action if the result is successful. - Success()
MethodCreates a successful result. - ToString()
MethodReturns a string representation of the result.
- Error
- Result<T>
StructRepresents the result of an operation that can either succeed or fail without throwing exceptions.- Error
PropertyGets the error message. Only available when IsFailure is true. - IsFailure
PropertyGets a value indicating whether the operation failed. - IsSuccess
PropertyGets a value indicating whether the operation was successful. - Value
PropertyGets the success value. Only available when IsSuccess is true. - Bind<TNew>(Func<T,Result<TNew>>)
MethodTransforms the success value to another result. - Deconstruct(bool, object)
MethodDeconstructs the result into success flag and value/error. - Failure(string)
MethodCreates a failed result with the specified error message. - Failure(Exception)
MethodCreates a failed result from an exception. - GetValueOrDefault(Func<string,T>)
MethodGets the value if successful, or gets a value from the specified function. - GetValueOrDefault(T)
MethodGets the value if successful, or returns the specified default value. - Map<TNew>(Func<T,TNew>)
MethodTransforms the success value to another type. - OnFailure(Action<string>)
MethodExecutes an action if the result is a failure. - OnSuccess(Action<T>)
MethodExecutes an action if the result is successful. - Success(T)
MethodCreates a successful result with the specified value. - ToString()
MethodReturns a string representation of the result. - implicit operator Result<T>(T)
OperatorImplicitly converts a value to a successful result.
- Error
- IBinaryFileNode
InterfaceInterface for binary file nodes that support both text and binary content.- BinaryContent
PropertyGets or sets the binary content of the file. - IsBinary
PropertyGets a value indicating whether this file contains binary data. - SizeInBytes
PropertyGets the size of the binary content in bytes. - SetBinaryContent(byte[])
MethodSets the content from binary data. - SetContentFromBase64(string)
MethodSets the content from a base64 encoded string. - SetTextContent(string)
MethodSets the content from a text string and clears binary content. - ToBase64String()
MethodGets the binary content as a base64 encoded string.
- BinaryContent
- IChangeHistory
InterfaceRepresents a history of changes in a virtual file system.- RedoStack
PropertyGets the redo stack. - UndoStack
PropertyGets the undo stack. - AddChange(VFSEventArgs)
MethodAdds a change to the history. - OnChange(VFSEventArgs)
MethodHandles the change event from the virtual file system. - Redo()
MethodRedoes the most recent undone change. - Undo()
MethodUndoes the most recent change.
- RedoStack
- IDirectoryNode
InterfaceRepresents a directory in a virtual file system. This is an in-memory representation of a directory. It is not a representation of a directory on a physical file system.- Directories
PropertyGets the child directories of the node. - Files
PropertyGets the child files of the node. - AddChild(IVirtualFileSystemNode)
Methodx Adds a child node to the current directory. - RemoveChild(IVirtualFileSystemNode)
MethodRemoves a child node from the current directory.
- Directories
- IFileNode
InterfaceRepresents a file in a virtual file system. This is the base interface for all file types.- Content
PropertyGets the content of the file as a string. The encoding is in UTF-8.
- Content
- IRootNode
InterfaceRepresents the root of a virtual file system. This is the entry point for all operations on the file system. - IVFSCreate
InterfaceRepresents the creation operations of the virtual file system.- CreateDirectory(VFSDirectoryPath)
MethodCreates a directory node at the specified path. The path must be absolute. - CreateFile(VFSFilePath, string)
MethodCreates a file node at the specified path. The path must be absolute. - DirectoryCreated
EventEvent triggered when a directory is created. - FileCreated
EventEvent triggered when a file is created.
- CreateDirectory(VFSDirectoryPath)
- IVFSDelete
InterfaceRepresents the deletion operations of the virtual file system.- DeleteDirectory(VFSDirectoryPath)
MethodDeletes a directory node at the specified path. The path must be absolute. - DeleteFile(VFSFilePath)
MethodDeletes a file node at the specified path. The path must be absolute. - DirectoryDeleted
EventEvent triggered when a directory is deleted. - FileDeleted
EventEvent triggered when a file is deleted.
- DeleteDirectory(VFSDirectoryPath)
- IVFSMove
InterfaceRepresents the move operations of the virtual file system.- MoveDirectory(VFSDirectoryPath, VFSDirectoryPath)
MethodMoves a directory from one location to another. - MoveFile(VFSFilePath, VFSFilePath)
MethodMoves a file node from the source path to the destination path. Both paths must be absolute. - DirectoryMoved
EventEvent triggered when a directory is moved. - FileMoved
EventEvent triggered when a file is moved.
- MoveDirectory(VFSDirectoryPath, VFSDirectoryPath)
- IVFSRename
InterfaceRepresents the rename operations of the virtual file system.- RenameDirectory(VFSDirectoryPath, string)
MethodRenames a directory node at the specified path. The path must be absolute. - RenameFile(VFSFilePath, string)
MethodRenames a file node at the specified path. The path must be absolute. - DirectoryRenamed
EventEvent triggered when a directory is renamed. - FileRenamed
EventEvent triggered when a file is renamed.
- RenameDirectory(VFSDirectoryPath, string)
- IVirtualFileSystem
InterfaceRepresents 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().- ChangeHistory
PropertyGets the change history of the file system. - Directories
PropertyFinds all directory nodes. - Files
PropertyFinds all file nodes. - Index
PropertyGets 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. - IsEmpty
PropertyIndicates whether the file system is empty. This is the case if the root directory is empty. - Root
PropertyGets the root directory of the file system. This is the entry point for all operations on the file system. - RootPath
PropertyGets the path of the root directory. - FindDirectories(Func<IDirectoryNode,bool>)
MethodFinds all directory nodes that match the specified predicate. - FindDirectories(Regex)
MethodFinds all directory nodes that match the specified regular expression. The regular expression must be relative to the root directory. - FindFiles(Func<IFileNode,bool>)
MethodFinds all file nodes that match the specified predicate. - FindFiles(Regex)
MethodFinds all file nodes that match the specified regular expression. - GetDirectory(VFSDirectoryPath)
MethodGets a directory node by its path. The path must be absolute. - GetFile(VFSFilePath)
MethodGets a file node by its path. The path must be absolute. - GetTree()
MethodGets the tree of the file system. - TryGetDirectory(VFSDirectoryPath, IDirectoryNode)
MethodTry to get a directory node by its path. The path must be absolute. If the directory node does not exist, this method returnsfalseand directory is set tonull. - TryGetFile(VFSFilePath, IFileNode)
MethodTry to get a file node by its path. The path must be absolute.
- ChangeHistory
- IVirtualFileSystemFactory
InterfaceRepresents a factory for creating IVirtualFileSystem instances. This interface is implemented by the VirtualFileSystemFactory class.- CreateFileSystem()
MethodCreates a new instance of IVirtualFileSystem.
- CreateFileSystem()
- IVirtualFileSystemNode
InterfaceRepresents a node in a virtual file system. A node can be a file or a directory.- CreationTime
PropertyGets the creation time of the node. - IsDirectory
PropertyIndicates whether the node is a directory. - IsFile
PropertyIndicates whether the node is a file. - LastAccessTime
PropertyGets the last access time of the node. - LastWriteTime
PropertyGets the last write time of the node. - Name
PropertyGets the name of the virtual file system node. The name is the last part of the path. For example, the name of the file "vfs://temp/file.txt" is "file.txt". The name of the directory "vfs://temp" is "temp". - Path
PropertyGets the full path of the node. The path is the path from the root of the file system to the node. For example, the path of the node with the path "./temp/file.txt" is "./temp/file.txt". The path of the node with the path "./temp/" is "./temp/".
- CreationTime
- FileInfo
ClassRepresents information about a file in the virtual file system.- FileInfo(string, bool, long, DateTime, DateTime)
ConstructorRepresents information about a file in the virtual file system. - FileType
PropertyGets the file type description. - SizeString
PropertyGets a human-readable size string.
- FileInfo(string, bool, long, DateTime, DateTime)
- VFSAdvancedExtensions
ClassProvides advanced extension methods for IVirtualFileSystem with smart behavior like auto-creating parent directories.- CopyDirectory(this IVirtualFileSystem, string, string)
MethodCopies a directory and all its contents recursively. - CopyFile(this IVirtualFileSystem, string, string)
MethodCopies a file from source to destination, creating parent directories if needed. - CreateDirectoryRecursively(this IVirtualFileSystem, string)
MethodCreates a directory and automatically creates any missing parent directories. - CreateFileWithDirectories(this IVirtualFileSystem, string, string)
MethodCreates a file and automatically creates any missing parent directories. - GetAllDirectoriesRecursive(this IVirtualFileSystem)
MethodGets all directories in the file system recursively. - GetAllFilesRecursive(this IVirtualFileSystem)
MethodGets all files in the file system recursively. - GetDirectoriesRecursive(this IVirtualFileSystem, string)
MethodGets all directories in a specific directory recursively. - GetFilesRecursive(this IVirtualFileSystem, string)
MethodGets all files in a specific directory recursively. - TryCopyDirectory(this IVirtualFileSystem, string, string)
MethodSafely copies a directory and all its contents recursively. - TryCopyFile(this IVirtualFileSystem, string, string)
MethodSafely copies a file from source to destination, creating parent directories if needed. - TryCreateDirectoryRecursively(this IVirtualFileSystem, string)
MethodSafely creates a directory and automatically creates any missing parent directories. - TryCreateFileWithDirectories(this IVirtualFileSystem, string, string)
MethodSafely creates a file and automatically creates any missing parent directories.
- CopyDirectory(this IVirtualFileSystem, string, string)
- VFSBinaryExtensions
ClassProvides extension methods for handling binary files in the Virtual File System.- ConvertToBinary(this IVirtualFileSystem, string, Encoding)
MethodConverts a text file to binary format. - ConvertToText(this IVirtualFileSystem, string, Encoding)
MethodConverts a binary file to text format. - CreateBinaryFile(this IVirtualFileSystem, string, byte[])
MethodCreates a binary file with the specified path and binary content. - CreateBinaryFileFromBase64(this IVirtualFileSystem, string, string)
MethodCreates a binary file from a base64 encoded string. - CreateBinaryFileWithDirectories(this IVirtualFileSystem, string, byte[])
MethodCreates a binary file with auto-created directories. - GetFileInfo(this IVirtualFileSystem, string)
MethodGets file information including type and size. - GetFileSize(this IVirtualFileSystem, string)
MethodGets the size of a file in bytes. - IsBinaryFile(this IVirtualFileSystem, string)
MethodChecks if a file contains binary data. - TryCreateBinaryFile(this IVirtualFileSystem, string, byte[])
MethodSafely creates a binary file without throwing exceptions. - TryReadBinaryFile(this IVirtualFileSystem, string, byte[])
MethodReads binary content from a file if it contains binary data. - TryWriteBinaryFile(this IVirtualFileSystem, string, byte[])
MethodWrites binary content to an existing file.
- ConvertToBinary(this IVirtualFileSystem, string, Encoding)
- VFSBulkExtensions
ClassProvides bulk operation extension methods for IVirtualFileSystem for efficient batch processing.- CreateDirectories(this IVirtualFileSystem, IEnumerable<string>, bool)
MethodCreates multiple directories efficiently in a single operation. - CreateFiles(this IVirtualFileSystem, IDictionary<string,string>, bool)
MethodCreates multiple files efficiently in a single operation using a dictionary. - DeleteDirectories(this IVirtualFileSystem, IEnumerable<string>)
MethodDeletes multiple directories efficiently in a single operation. - DeleteFiles(this IVirtualFileSystem, IEnumerable<string>)
MethodDeletes multiple files efficiently in a single operation. - TryCreateDirectories(this IVirtualFileSystem, IEnumerable<string>, bool)
MethodSafely creates multiple directories without throwing exceptions. - TryDeleteDirectories(this IVirtualFileSystem, IEnumerable<string>)
MethodSafely deletes multiple directories without throwing exceptions. - TryDeleteFiles(this IVirtualFileSystem, IEnumerable<string>)
MethodSafely deletes multiple files without throwing exceptions.
- CreateDirectories(this IVirtualFileSystem, IEnumerable<string>, bool)
- VFSConvenienceExtensions
ClassProvides convenience extension methods for IVirtualFileSystem to simplify common operations. These methods accept string paths directly and handle common use cases with less boilerplate.- CreateDirectory(this IVirtualFileSystem, string)
MethodCreates a directory with the specified path using a string path. - CreateFile(this IVirtualFileSystem, string, string)
MethodCreates a file with the specified path and content using a string path. - DeleteDirectory(this IVirtualFileSystem, string)
MethodDeletes a directory with the specified path using a string path. - DeleteFile(this IVirtualFileSystem, string)
MethodDeletes a file with the specified path using a string path. - DirectoryExists(this IVirtualFileSystem, string)
MethodChecks if a directory exists at the specified path. - Exists(this IVirtualFileSystem, string)
MethodChecks if a file or directory exists at the specified path. - FileExists(this IVirtualFileSystem, string)
MethodChecks if a file exists at the specified path. - GetDirectory(this IVirtualFileSystem, string)
MethodGets a directory by its path using a string path. - GetFile(this IVirtualFileSystem, string)
MethodGets a file by its path using a string path. - MoveDirectory(this IVirtualFileSystem, string, string)
MethodMoves a directory from source to destination using string paths. - MoveFile(this IVirtualFileSystem, string, string)
MethodMoves a file from source to destination using string paths. - RenameDirectory(this IVirtualFileSystem, string, string)
MethodRenames a directory using string paths. - RenameFile(this IVirtualFileSystem, string, string)
MethodRenames a file using string paths. - TryGetDirectory(this IVirtualFileSystem, string, IDirectoryNode)
MethodTries to get a directory by its path using a string path. - TryGetFile(this IVirtualFileSystem, string, IFileNode)
MethodTries to get a file by its path using a string path.
- CreateDirectory(this IVirtualFileSystem, string)
- VFSPathExtensions
ClassProvides path manipulation and utility extension methods for VFS paths.- ChangeExtension(this VFSPath, string)
MethodChanges the extension of a VFS path. - Combine(this VFSDirectoryPath, string)
MethodCombines a directory path with a relative path. - GetAncestors(this VFSPath)
MethodGets all ancestor paths from the current path up to the root. - GetDepth(this VFSPath)
MethodGets the depth of the path (number of directory levels from root). - GetExtension(this VFSPath)
MethodGets the file extension from a VFS path. - GetFileNameWithoutExtension(this VFSPath)
MethodGets the file name without extension from a VFS path. - GetParent(this VFSPath, int)
MethodGets the parent directory at the specified level up. - GetRelativePath(this VFSDirectoryPath, VFSPath)
MethodGets the relative path from one directory to another. - HasAnyExtension(this VFSPath, string[])
MethodChecks if the path has any of the specified extensions. - HasExtension(this VFSPath, string, bool)
MethodChecks if the path has a specific extension. - IsAncestorOf(this VFSPath, VFSPath)
MethodChecks if a path is a descendant of another path. - IsAtDepth(this VFSPath, int)
MethodChecks if the path is at a specific depth. - IsDirectChildOf(this VFSPath, VFSPath)
MethodChecks if a path is a child (direct descendant) of another path. - MatchesGlob(this VFSPath, string)
MethodChecks if the path matches a glob pattern. - Normalize(string)
MethodNormalizes a path by removing redundant separators and resolving relative components.
- ChangeExtension(this VFSPath, string)
- VFSResultExtensions
ClassProvides Result pattern extension methods for IVirtualFileSystem operations. These methods return Result objects instead of throwing exceptions, enabling functional error handling.- CopyDirectoryResult(this IVirtualFileSystem, string, string)
MethodCopies a directory and returns a Result indicating success or failure. - CopyFileResult(this IVirtualFileSystem, string, string)
MethodCopies a file and returns a Result indicating success or failure. - CreateDirectoryRecursivelyResult(this IVirtualFileSystem, string)
MethodCreates a directory recursively and returns a Result. - CreateDirectoryResult(this IVirtualFileSystem, string)
MethodCreates a directory and returns a Result indicating success or failure. - CreateFileResult(this IVirtualFileSystem, string, string)
MethodCreates a file and returns a Result indicating success or failure. - CreateFileWithDirectoriesResult(this IVirtualFileSystem, string, string)
MethodCreates a file with auto-created directories and returns a Result. - DeleteDirectoryResult(this IVirtualFileSystem, string)
MethodDeletes a directory and returns a Result indicating success or failure. - DeleteFileResult(this IVirtualFileSystem, string)
MethodDeletes a file and returns a Result indicating success or failure. - Execute(Action)
MethodExecutes an operation and returns a Result, converting any exception to a failure. - Execute<T>(Func<T>)
MethodExecutes an operation that returns a value and returns a Result. - GetDirectoryResult(this IVirtualFileSystem, string)
MethodGets a directory and returns a Result containing the directory or an error. - GetFileResult(this IVirtualFileSystem, string)
MethodGets a file and returns a Result containing the file or an error. - MoveDirectoryResult(this IVirtualFileSystem, string, string)
MethodMoves a directory and returns a Result indicating success or failure. - MoveFileResult(this IVirtualFileSystem, string, string)
MethodMoves a file and returns a Result indicating success or failure. - ReadFileResult(this IVirtualFileSystem, string)
MethodReads file content and returns a Result containing the content or an error. - RenameDirectoryResult(this IVirtualFileSystem, string, string)
MethodRenames a directory and returns a Result indicating success or failure. - RenameFileResult(this IVirtualFileSystem, string, string)
MethodRenames a file and returns a Result indicating success or failure. - WriteFileResult(this IVirtualFileSystem, string, string)
MethodWrites file content and returns a Result indicating success or failure.
- CopyDirectoryResult(this IVirtualFileSystem, string, string)
- VFSSafeExtensions
ClassProvides safe extension methods for IVirtualFileSystem that don't throw exceptions. These methods return boolean success indicators instead of throwing exceptions.- TryCreateDirectory(this IVirtualFileSystem, string)
MethodSafely creates a directory without throwing exceptions. - TryCreateFile(this IVirtualFileSystem, string, string)
MethodSafely creates a file without throwing exceptions. - TryDeleteDirectory(this IVirtualFileSystem, string)
MethodSafely deletes a directory without throwing exceptions. - TryDeleteFile(this IVirtualFileSystem, string)
MethodSafely deletes a file without throwing exceptions. - TryMoveDirectory(this IVirtualFileSystem, string, string)
MethodSafely moves a directory without throwing exceptions. - TryMoveFile(this IVirtualFileSystem, string, string)
MethodSafely moves a file without throwing exceptions. - TryReadFile(this IVirtualFileSystem, string, string)
MethodSafely reads file content without throwing exceptions. - TryRenameDirectory(this IVirtualFileSystem, string, string)
MethodSafely renames a directory without throwing exceptions. - TryRenameFile(this IVirtualFileSystem, string, string)
MethodSafely renames a file without throwing exceptions. - TryWriteFile(this IVirtualFileSystem, string, string)
MethodSafely writes file content without throwing exceptions.
- TryCreateDirectory(this IVirtualFileSystem, string)
- VFSSearchExtensions
ClassProvides fluent search extension methods for IVirtualFileSystem and file/directory collections.- AtDepth(this IEnumerable<IDirectoryNode>, int)
MethodFilters directories by path depth. - ContainingPattern(this IEnumerable<IFileNode>, string, RegexOptions)
MethodFilters files by content matching a regular expression. - ContainingText(this IEnumerable<IFileNode>, string, bool)
MethodFilters files by content containing specific text. - CreatedBetween(this IEnumerable<IFileNode>, Nullable<DateTime>, Nullable<DateTime>)
MethodFilters files by creation time range. - Empty(this IEnumerable<IDirectoryNode>)
MethodFilters directories that are empty (no files or subdirectories). - FindDirectoriesByGlob(this IVirtualFileSystem, string)
MethodSearches directories using glob pattern matching. - FindFilesByGlob(this IVirtualFileSystem, string)
MethodSearches files using glob pattern matching. - InDirectory(this IEnumerable<IFileNode>, string, bool)
MethodFilters files by directory path. - ModifiedBetween(this IEnumerable<IFileNode>, Nullable<DateTime>, Nullable<DateTime>)
MethodFilters files modified within a specific time range. - WithExtension(this IEnumerable<IFileNode>, string)
MethodFilters files by extension. - WithExtensions(this IEnumerable<IFileNode>, string[])
MethodFilters files by multiple extensions. - WithMinFileCount(this IEnumerable<IDirectoryNode>, int)
MethodFilters directories containing a minimum number of files. - WithNameContaining(this IEnumerable<IDirectoryNode>, string, bool)
MethodFilters directories by name containing specific text. - WithNameContaining(this IEnumerable<IFileNode>, string, bool)
MethodFilters files by name containing specific text. - WithNameEndingWith(this IEnumerable<IFileNode>, string, bool)
MethodFilters files by name ending with specific text. - WithNameStartingWith(this IEnumerable<IFileNode>, string, bool)
MethodFilters files by name starting with specific text. - WithSizeInRange(this IEnumerable<IFileNode>, int, int)
MethodFilters files by size range.
- AtDepth(this IEnumerable<IDirectoryNode>, int)
- ServiceCollectionExtensions
ClassExtension methods for Microsoft.Extensions.DependencyInjection.IServiceCollection. This class is used to register the virtual file system in the dependency injection container.- AddVirtualFileSystem(this IServiceCollection)
MethodRegisters the virtual file system in the dependency injection container.
- AddVirtualFileSystem(this IServiceCollection)