|
RLLib
0.1
|
A bundle is a collection of files packed in a big single file. More...
#include <Bundle.hpp>
Public Member Functions | |
| Bundle ()=default | |
| Creates an empty bundle. | |
| Bundle (FilePath path) | |
| Creates a bundle loaded from a file. More... | |
| void | load (FilePath path) |
| Load the bundle from a file. More... | |
| ByteStream | readFile (const FilePath &path) const |
| Reads a file in the bundle and returns its content. More... | |
| void | writeFile (const FilePath &path, const ByteStream &data) |
| Overwrites a file in the bundle. More... | |
Static Public Member Functions | |
| static Bundle | create (FilePath bundlePath, const std::vector< std::pair< FilePath, ByteStream >> &files) |
| Creates a new bundle file and returns its instance. More... | |
A bundle is a collection of files packed in a big single file.
It is used to store all the game assets. In particular, this is where scene are being extracted from the game.
|
explicit |
Creates a bundle loaded from a file.
| path | The path to the bundle file |
|
static |
Creates a new bundle file and returns its instance.
| bundlePath | The path to the new bundle file that is to be created |
| files | A list of pairs containing file paths with associated contents |
| void rl::Bundle::load | ( | FilePath | path | ) |
Load the bundle from a file.
| path | The path to the bundle file |
| ByteStream rl::Bundle::readFile | ( | const FilePath & | path | ) | const |
Reads a file in the bundle and returns its content.
| path | The path to the file in the bundle |
| void rl::Bundle::writeFile | ( | const FilePath & | path, |
| const ByteStream & | data | ||
| ) |
Overwrites a file in the bundle.
The file path must already exist in the bundle.
| path | The path to the file in the bundle |
| data | The data that is to be written |