The main class responsible for loading files from a virtual file system.
More...
#include <manager.hpp>
The main class responsible for loading files from a virtual file system.
- Various archive types (e.g. directories on the filesystem, or compressed archives)
- can be registered, and will be merged into a single file tree. If the same filename is contained in multiple archives, the last added archive will have priority.
- Most of the methods in this class are considered thread-safe, see each method documentation for details.
VFS::Manager::Manager |
( |
bool |
strict | ) |
|
- Parameters
-
strict | Use strict path handling? If enabled, no case folding will be done, but slash/backslash conversions are always done. |
VFS::Manager::~Manager |
( |
| ) |
|
void VFS::Manager::addArchive |
( |
Archive * |
archive | ) |
|
Register the given archive. All files contained in it will be added to the index on the next buildIndex() call.
- Note
- Takes ownership of the given pointer.
void VFS::Manager::buildIndex |
( |
| ) |
|
Build the file index. Should be called when all archives have been registered.
bool VFS::Manager::exists |
( |
const std::string & |
name | ) |
const |
Does a file with this name exist?
- Note
- May be called from any thread once the index has been built.
Retrieve a file by name.
- Note
- Throws an exception if the file can not be found.
-
May be called from any thread once the index has been built.
const std::map< std::string, File * > & VFS::Manager::getIndex |
( |
| ) |
const |
Get a complete list of files from all archives
- Note
- May be called from any thread once the index has been built.
Files::IStreamPtr VFS::Manager::getNormalized |
( |
const std::string & |
normalizedName | ) |
const |
Retrieve a file by name (name is already normalized).
- Note
- Throws an exception if the file can not be found.
-
May be called from any thread once the index has been built.
void VFS::Manager::normalizeFilename |
( |
std::string & |
name | ) |
const |
Normalize the given filename, making slashes/backslashes consistent, and lower-casing if mStrict is false.
- Note
- May be called from any thread once the index has been built.
std::vector<Archive*> VFS::Manager::mArchives |
|
private |
std::map<std::string, File*> VFS::Manager::mIndex |
|
private |
bool VFS::Manager::mStrict |
|
private |
The documentation for this class was generated from the following files:
- /home/travis/build/OpenMW/openmw/components/vfs/manager.hpp
- /home/travis/build/OpenMW/openmw/components/vfs/manager.cpp