VfsStorage Class |
Namespace: DigitalRune.Storages
The VfsStorage type exposes the following members.
Name | Description | |
---|---|---|
VfsStorage |
Initializes a new instance of the VfsStorage class.
|
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the Storage class.
(Inherited from Storage.) | |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the Storage class
and optionally releases the managed resources.
(Inherited from Storage.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetRealPath |
Gets the real path and name of the specified file.
(Overrides StorageGetRealPath(String).) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OpenFile |
Opens the specified file for reading.
(Overrides StorageOpenFile(String).) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
DirectorySeparator |
Gets the directory separator character used natively by this storage.
(Overrides StorageDirectorySeparator.) | |
IsDisposed |
Gets a value indicating whether this instance has been disposed of.
(Inherited from Storage.) | |
MountInfos |
Gets the storage providers mounted into the virtual file system.
|
The class defines a "virtual file system" to transparently access files from multiple storage locations.
The VfsStorage is empty by default. Storages can be mounted into the virtual files system by adding a VfsMountInfo entry to the MountInfos property.
The VfsStorage does not exclusively own the mounted storages. Storages can be shared between different virtual file systems. A storage may even be mounted multiple times at different mount points into the same virtual file system. The storages are not disposed when the VfsStorage is disposed.
Caution |
---|
Recursively mounting a VfsStorage to itself can lead to an endless loop when searching for a files. |
The VfsStorage can be used to virtualize access to different devices to improve performance. For example, game content provided on a DVD can (optionally) be installed on harddisk and cached in memory for faster access. The storages managing the content locations (memory, harddisk, DVD) can be mounted at the same mount point to the virtual file system.
Search Order:
The order of the storages in MountInfos determines the search order for files
and directories. A file will be read from the first storage in the list that contains a
matching entry.