VirtualFileSystem manages a collection of files referenced by tags.
More...
#include <VirtualFileSystem.hpp>
|
| Config & | getConfig () |
| | Access the runtime configuration.
|
| bool | getFile (const eastl::string_view &fileTag, eastl::vector< char > &bytes) |
| | Retrieve a file's bytes identified by its tag.
|
| bool | buildJSONMappingFile (const std::string &fileInName, const std::string &fileOutName) |
| | Build a binary VFS file from a JSON mapping.
|
| bool | loadFile (const std::string &fileName) |
| | Load the virtual file system from a file.
|
VirtualFileSystem manages a collection of files referenced by tags.
The virtual file system can be built from a JSON mapping (debug mode) or from a binary VFS file (release). It supports loading file contents either via stream input or by keeping the virtual file contents in memory.
◆ FileBinaryType
Types of virtual file collections that can be stored in a VFS file.
| Enumerator |
|---|
| NONE | No file type specified.
|
| ASSETS_FILE | Assets bundle.
|
| SOURCE_FILE | Source files bundle.
|
| WORLD_FILE | World data bundle.
|
◆ buildJSONMappingFile()
| bool mce::VirtualFileSystem::buildJSONMappingFile |
( |
const std::string & | fileInName, |
|
|
const std::string & | fileOutName ) |
Build a binary VFS file from a JSON mapping.
- Parameters
-
| fileInName | Path to the input JSON mapping file. |
| fileOutName | Path where the resulting binary VFS should be written. |
- Returns
- True if the output file was successfully created.
◆ getConfig()
Access the runtime configuration.
- Returns
- Reference to the VFS configuration.
◆ getFile()
| bool mce::VirtualFileSystem::getFile |
( |
const eastl::string_view & | fileTag, |
|
|
eastl::vector< char > & | bytes ) |
Retrieve a file's bytes identified by its tag.
- Parameters
-
| fileTag | Tag identifying the file in the VFS. |
| bytes | Output vector which will be filled with file data. |
- Returns
- True if the file was found and bytes were successfully loaded.
◆ loadFile()
| bool mce::VirtualFileSystem::loadFile |
( |
const std::string & | fileName | ) |
|
Load the virtual file system from a file.
- Parameters
-
| fileName | Base file name (without extension) to load. |
- Returns
- True if the VFS data was successfully loaded.
The documentation for this class was generated from the following files: