Atypical.VirtualFileSystem.Core Assembly
Namespaces
Atypical.VirtualFileSystem.Core Namespace
- ChangeHistory
Class
Represents a history of changes in a virtual file system.
- DirectoryNode
Class
Represents a directory in the virtual file system.
- FileNode
Class
Represents a file in the virtual file system.
- FileNode(VFSFilePath, string)
Constructor
Initializes 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
Property
Gets the content of the file as a string.
The encoding is in UTF-8.
- IsDirectory
Property
Indicates whether the node is a directory.
- IsFile
Property
Indicates whether the node is a file.
- ToString()
Method
Returns a string that represents the path of the file.
- RootNode
Class
Represents the root directory of the virtual file system.
- RootNode()
Constructor
Initializes a new instance of the RootNode class.
- ToString()
Method
Returns a string that represents the current object.
For RootNode this is always the constant string .
- VFS
Class
Constants used by the Virtual File System.
- VFS()
Constructor
Initializes a new instance of the VFS class.
- DIRECTORY_SEPARATOR
Field
The directory separator.
This is the character used to separate directory names.
- ROOT_PATH
Field
The root path.
This is the path used to identify the root directory.
- ChangeHistory
Property
Gets the change history of the file system.
- Directories
Property
Finds all directory nodes.
- Files
Property
Finds all file nodes.
- Index
Property
Gets 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
Property
Indicates whether the file system is empty.
This is the case if the root directory is empty.
- Root
Property
Gets the root directory of the file system.
This is the entry point for all operations on the file system.
- RootPath
Property
Gets the path of the root directory.
- CreateDirectory(VFSDirectoryPath)
Method
Creates a directory node at the specified path.
The path must be absolute.
- CreateFile(VFSFilePath, string)
Method
Creates a file node at the specified path.
The path must be absolute.
- DeleteDirectory(VFSDirectoryPath)
Method
Deletes a directory node at the specified path.
The path must be absolute.
- DeleteFile(VFSFilePath)
Method
Deletes a file node at the specified path.
The path must be absolute.
- FindDirectories(Func<IDirectoryNode,bool>)
Method
Finds all directory nodes that match the specified predicate.
- FindDirectories(Regex)
Method
Finds all directory nodes that match the specified regular expression.
The regular expression must be relative to the root directory.
- FindFiles(Func<IFileNode,bool>)
Method
Finds all file nodes that match the specified predicate.
- FindFiles(Regex)
Method
Finds all file nodes that match the specified regular expression.
- GetDirectory(VFSDirectoryPath)
Method
Gets a directory node by its path.
The path must be absolute.
- GetFile(VFSFilePath)
Method
Gets a file node by its path.
The path must be absolute.
- GetTree()
Method
Gets the tree of the file system.
- MoveDirectory(VFSDirectoryPath, VFSDirectoryPath)
Method
Moves a directory from one location to another.
- MoveFile(VFSFilePath, VFSFilePath)
Method
Moves a file node from the source path to the destination path.
Both paths must be absolute.
- RenameDirectory(VFSDirectoryPath, string)
Method
Renames a directory.
- RenameFile(VFSFilePath, string)
Method
Renames a file node at the specified path.
The path must be absolute.
- ToString()
Method
Returns a string that represents the current object.
- TryGetDirectory(VFSDirectoryPath, IDirectoryNode)
Method
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)
Method
Try to get a file node by its path.
The path must be absolute.
- DirectoryCreated
Event
Event triggered when a directory is created.
- DirectoryDeleted
Event
Event triggered when a directory is deleted.
- DirectoryMoved
Event
Event triggered when a directory is moved.
- DirectoryRenamed
Event
Event triggered when a directory is renamed.
- FileCreated
Event
Event triggered when a file is created.
- FileDeleted
Event
Event triggered when a file is deleted.
- FileMoved
Event
Event triggered when a file is moved.
- FileRenamed
Event
Event triggered when a file is renamed.
- VFSDirectoryCreatedArgs
Class
Provides data for the DirectoryCreated event.
- VFSDirectoryDeletedArgs
Class
Provides data for the DirectoryDeleted event.
- VFSDirectoryMovedArgs
Class
Provides data for the DirectoryMoved event.
- VFSDirectoryPath
Class
Represents 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.
- VFSDirectoryRenamedArgs
Class
Provides data for the DirectoryRenamed event.
- VFSEventArgs
Class
Represents the base class for all VFS event arguments.
- VFSFileCreatedArgs
Class
Provides data for the FileCreated event.
- VFSFileDeletedArgs
Class
Provides data for the FileDeleted event.
- VFSFileMovedArgs
Class
Provides data for the FileMoved event.
- VFSFilePath
Class
Represents a file system entry in the virtual file system.
A file is a first-class citizen in the virtual file system.
- VFSFileRenamedArgs
Class
Provides data for the FileRenamed event.
- VFSIndex
Class
Represents the index of the virtual file system.
- VFSNode
Class
Represents a node in a virtual file system.
A node can be a file or a directory.
- VFSNode(VFSPath)
Constructor
Initializes a new instance of the VFSNode class.
This constructor is used by derived classes.
- CreationTime
Property
Gets the creation time of the node.
- IsDirectory
Property
Indicates whether the node is a directory.
- IsFile
Property
Indicates whether the node is a file.
- LastAccessTime
Property
Gets the last access time of the node.
- LastWriteTime
Property
Gets the last write time of the node.
- Path
Property
Gets the creation time of the node.
- UpdatePath(VFSPath)
Method
Updates the path of the node.
- VFSPath
Class
Represents a file system entry (file or directory) in the virtual file system.
- VFSPath(string)
Constructor
Creates a new instance of VFSPath.
- Depth
Property
Gets 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
Property
Indicates whether the path has a parent directory.
- IsRoot
Property
Gets a value indicating whether the directory is the root directory.
- Name
Property
Gets 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
Property
Gets the path of the parent directory.
- Value
Property
Gets the path of the file system entry with the VFS prefix.
- Equals(VFSPath)
Method
Indicates whether the current object is equal to another object of the same type.
- GetAbsoluteParentPath(int)
Method
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()
Method
Serves as the default hash function.
- IsMatch(Regex)
Method
Indicates whether the specified regular expression finds a match in the path.
- StartsWith(string)
Method
Determines whether the path starts with the specified path.
- VFSRootPath
Class
Represents the root directory of the virtual file system.
- VirtualFileSystemException
Class
Exception thrown by the VFS.
- VirtualFileSystemFactory
Class
Represents a factory for creating IVirtualFileSystem instances.
- IChangeHistory
Interface
Represents a history of changes in a virtual file system.
Atypical.VirtualFileSystem.Core.Contracts Namespace
- IDirectoryNode
Interface
Represents 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.
- IFileNode
Interface
Represents a file in a virtual file system.
This is the base interface for all file types.
- Content
Property
Gets the content of the file as a string.
The encoding is in UTF-8.
- IRootNode
Interface
Represents the root of a virtual file system.
This is the entry point for all operations on the file system.
- IVFSCreate
Interface
Represents the creation operations of the virtual file system.
- IVFSDelete
Interface
Represents the deletion operations of the virtual file system.
- IVFSMove
Interface
Represents the move operations of the virtual file system.
- IVFSRename
Interface
Represents the rename operations of the virtual file system.
- 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().
- ChangeHistory
Property
Gets the change history of the file system.
- Directories
Property
Finds all directory nodes.
- Files
Property
Finds all file nodes.
- Index
Property
Gets 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
Property
Indicates whether the file system is empty.
This is the case if the root directory is empty.
- Root
Property
Gets the root directory of the file system.
This is the entry point for all operations on the file system.
- RootPath
Property
Gets the path of the root directory.
- FindDirectories(Func<IDirectoryNode,bool>)
Method
Finds all directory nodes that match the specified predicate.
- FindDirectories(Regex)
Method
Finds all directory nodes that match the specified regular expression.
The regular expression must be relative to the root directory.
- FindFiles(Func<IFileNode,bool>)
Method
Finds all file nodes that match the specified predicate.
- FindFiles(Regex)
Method
Finds all file nodes that match the specified regular expression.
- GetDirectory(VFSDirectoryPath)
Method
Gets a directory node by its path.
The path must be absolute.
- GetFile(VFSFilePath)
Method
Gets a file node by its path.
The path must be absolute.
- GetTree()
Method
Gets the tree of the file system.
- TryGetDirectory(VFSDirectoryPath, IDirectoryNode)
Method
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)
Method
Try to get a file node by its path.
The path must be absolute.
- IVirtualFileSystemFactory
Interface
Represents a factory for creating IVirtualFileSystem instances.
This interface is implemented by the VirtualFileSystemFactory class.
- IVirtualFileSystemNode
Interface
Represents a node in a virtual file system.
A node can be a file or a directory.
- CreationTime
Property
Gets the creation time of the node.
- IsDirectory
Property
Indicates whether the node is a directory.
- IsFile
Property
Indicates whether the node is a file.
- LastAccessTime
Property
Gets the last access time of the node.
- LastWriteTime
Property
Gets the last write time of the node.
- Name
Property
Gets 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
Property
Gets 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/”.
Atypical.VirtualFileSystem.Core.Services Namespace