Nugget
|
A class that reads files from the CDRom. More...
#include <psyqo-paths/cdrom-loader.hh>
Public Member Functions | |
void | readFile (eastl::string_view path, GPU &gpu, ISO9660Parser &parser, eastl::function< void(eastl::vector< uint8_t > &&)> &&callback) |
Reads a file from the CDRom. | |
psyqo::TaskQueue::Task | scheduleReadFile (eastl::string_view path, GPU &gpu, ISO9660Parser &parser) |
ReadFileAwaiter | readFile (eastl::string_view path, GPU &gpu, ISO9660Parser &parser) |
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 vector 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.
|
inline |
|
inline |
Reads a file from the CDRom.
path | The path to the file to read. The view must be persistent until the callback is called. |
gpu | The GPU class used by the application, in order to set timers. |
parser | The ISO9660Parser to use for reading the file. |
callback | The callback to call when the file is read. The callback will be called with the data of the file, or an empty vector if the file could not be read. |
|
inline |