A class that reads files from the CDRom.
This class provides a PSYQo path to read files from the CDRom. The way to use it is to instantiate the class somewhere persistent, and then call readFile() with a callback. The callback will be called with the data of the file, or an empty buffer if the file could not be read. This is going to allocate memory in different places. Only one file can be read at a time, but it is safe to call readFile() again from the callback. If preferred, the loader can be cascaded into another TaskQueue
. Also, for convenience, readFile() can be awaited on using the co_await keyword in a coroutine.
void psyqo::paths::CDRomLoader::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. |