Click or drag to resize
DigitalRuneVfsStorage Class
Provides a virtual file system that maps existing storages into a virtual directory hierarchy.
Inheritance Hierarchy

Namespace: DigitalRune.Storages
Assembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax
public class VfsStorage : Storage, IStorageInternal

The VfsStorage type exposes the following members.

Constructors
  NameDescription
Public methodVfsStorage
Initializes a new instance of the VfsStorage class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the Storage class.
(Inherited from Storage.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the Storage class and optionally releases the managed resources.
(Inherited from Storage.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetRealPath
Gets the real path and name of the specified file.
(Overrides StorageGetRealPath(String).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpenFile
Opens the specified file for reading.
(Overrides StorageOpenFile(String).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Protected propertyDirectorySeparator
Gets the directory separator character used natively by this storage.
(Overrides StorageDirectorySeparator.)
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed of.
(Inherited from Storage.)
Public propertyMountInfos
Gets the storage providers mounted into the virtual file system.
Top
Remarks

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 note 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.

See Also