|
void | initialize (eastl::string_view archiveName, ISO9660Parser &parser, eastl::function< void(bool)> &&callback) |
| Asynchronous initialization of the archive manager.
|
|
psyqo::TaskQueue::Task | scheduleInitialize (eastl::string_view archiveName, ISO9660Parser &parser) |
|
InitAwaiterWithFilename | initialize (eastl::string_view archiveName, ISO9660Parser &parser) |
|
void | initialize (uint32_t LBA, CDRom &device, eastl::function< void(bool)> &&callback) |
|
psyqo::TaskQueue::Task | scheduleInitialize (uint32_t LBA, CDRom &device) |
|
InitAwaiter | initialize (uint32_t LBA, CDRom &device) |
|
const IndexEntry * | getFirstIndexEntry () const |
| Get the First IndexEntry object.
|
|
uint32_t | getIndexCount () const |
| Get the number of entries in the index.
|
|
const IndexEntry * | getIndexEntry (eastl::string_view path) const |
| Get the IndexEntry object for a given path.
|
|
template<unsigned S> |
const IndexEntry * | getIndexEntry (const char(&path)[S]) const |
|
const IndexEntry * | getIndexEntry (uint64_t hash) const |
|
uint32_t | getIndexEntrySectorStart (const IndexEntry *entry) const |
| Get the LBA of the first sector of the file in the archive.
|
|
void | setBuffer (Buffer< uint8_t > &&buffer) |
| Set the Buffer object for the next read operation.
|
|
template<unsigned S> |
void | readFile (const char(&path)[S], CDRom &device, eastl::function< void(Buffer< uint8_t > &&)> &&callback) |
| Read a file from the archive.
|
|
void | readFile (eastl::string_view path, CDRom &device, eastl::function< void(Buffer< uint8_t > &&)> &&callback) |
|
void | readFile (uint64_t hash, CDRom &device, eastl::function< void(Buffer< uint8_t > &&)> &&callback) |
|
void | readFile (const IndexEntry *entry, CDRom &device, eastl::function< void(Buffer< uint8_t > &&)> &&callback) |
|
template<unsigned S> |
psyqo::TaskQueue::Task | scheduleReadFile (const char(&path)[S], CDRom &device) |
|
psyqo::TaskQueue::Task | scheduleReadFile (eastl::string_view path, CDRom &device) |
|
psyqo::TaskQueue::Task | scheduleReadFile (uint64_t hash, CDRom &device) |
|
psyqo::TaskQueue::Task | scheduleReadFile (const IndexEntry *entry, CDRom &device) |
|
template<unsigned S> |
ReadFileAwaiter | readFile (const char(&path)[S], CDRom &device) |
|
ReadFileAwaiter | readFile (eastl::string_view path, CDRom &device) |
|
ReadFileAwaiter | readFile (uint64_t hash, CDRom &device) |
|
ReadFileAwaiter | readFile (const IndexEntry *entry, CDRom &device) |
|
This class manages the reading and decompression of files from an archive.
The ArchiveManager class is a helper class that manages the reading and decompression of files from an archive. The archive format is specified in the mkarchive.lua tool available in the tools directory, and this is where the reader can find rationales and details on the format itself. The archive is a collection of files that are compressed using different compression methods, and is designed to be used specifically with the PlayStation 1. Parsing the iso9660 filesystem is an expensive operation, so using a single archive for all files will speed up loading times, as the archive index is kept in memory in a compact and efficient format.
If multiple archives are used, it is reasonable to create and destroy the ArchiveManager object multiple times, or to have multiple ArchiveManager objects. The latter is recommended, as it allows for caching of the index in memory, and allows for faster loading times.
static void psyqo::paths::ArchiveManager::registerUCL_NRV2EDecompressor |
( |
| ) |
|
|
inlinestatic |
Register a decompressor for a specific compression method.
In the spirit of paying for what you use, these functions allow the user to register a decompressor for a specific compression method. For instance, if the user knows that the archive will only contain LZ4 compressed files, they can register the LZ4 decompressor and the UCL_NRV2E decompressor will not be registered. This will reduce the final binary size of the program, as the decompressor code will not be included in the final binary. The UCL_NRV2E decompressor takes 340 bytes of code, while the LZ4 decompressor takes 200 bytes of code. It is also reasonable to not register any decompressors at all, if the user is sure that the archive will not contain any compressed files.
void psyqo::paths::ArchiveManager::setBuffer |
( |
Buffer< uint8_t > && |
buffer | ) |
|
|
inline |
Set the Buffer object for the next read operation.
This function sets the buffer to be used for the next read operation. By default, the archive manager will allocate a buffer of the appropriate size for the file being read. However, if the user wants to use an already allocated buffer, they can use this function to set the buffer to be used.
- Parameters
-
buffer | The buffer to be used for the next read operation. |