Torque::FS::VirtualMountSystem
Engine/source/core/virtualMountSystem.h
The VirtualMountSystem extend the mount system by allowing you to mount and access multiple filesystems on a single root.
Private Types
Parent
Protected Types
Map< String, Vector< FileSystemRef > >
PathFSMap
RootToFSVec
Protected Attributes
Public Functions
bool
createPath(const Path & path)
bool
mount(String root, FileSystemRef fs)
bool
unmount(FileSystemRef fs)
Protected Functions
_getFileSystemFromList(const Path & path)
Detailed Description
The VirtualMountSystem extend the mount system by allowing you to mount and access multiple filesystems on a single root.
This allows you to mount multiple volume files on a single root without needing to change source paths that reference those volumes to use new roots. For instance, you could mount "missions1.zip" and "missions2.zip", on the same root "", and you could access files from either one.
If you need to mount a writeable filesystem on a VMS, you should mount it as the first filesystem on a root.
File writes are handled as follows: 1) If you try to open a file for write, and it exists on one of the virtual mounts, that is the mount that will be used for writing. But if the filesystem is read-only then the writes will fail (and you will get appropriate error codes from your FileStream or whatever).
2) If you try to open a file for write that doesn't exist, the VMS falls back to the default MountSystem behavior, which is to use the first filesystem mounted on the root. If this filesystem happens to be writable, then you will be able to write to the file. 3) Nothing special is done for the WriteAppend case; that is, it follows the same logic as if you were just trying to Write the file.
Because of rule 1) above, you should take care that any files you need to write (such as prefs.tscript), are not included in read-only zip archive files.
Private Types
typedef MountSystem Parent
Protected Types
typedef Map< String, Vector< FileSystemRef > > PathFSMap
typedef Vector< FileSystemRef > RootToFSVec
Protected Attributes
PathFSMap mRootMap
bool mUseParentFind
Public Functions
VirtualMountSystem()
~VirtualMountSystem()
createPath(const Path & path)
Reimplemented from: Torque::FS::MountSystem
findByPattern(const Path & inBasePath, const String & inFilePattern, bool inRecursive, Vector< String > & outList, bool includeDirs, bool multiMatch)
Reimplemented from: Torque::FS::MountSystem
mount(String root, const Path & path)
Reimplemented from: Torque::FS::MountSystem
mount(String root, FileSystemRef fs)
Reimplemented from: Torque::FS::MountSystem
unmount(FileSystemRef fs)
Reimplemented from: Torque::FS::MountSystem
unmount(String root)
Reimplemented from: Torque::FS::MountSystem
Protected Functions
_getFileSystemFromList(const Path & path)
Reimplemented from: Torque::FS::MountSystem
_log(const String & msg)
Reimplemented from: Torque::FS::MountSystem
_removeMountFromList(String root)
Reimplemented from: Torque::FS::MountSystem