29#include <EASTL/string_view.h>
55 struct ReadFileAwaiter {
57 : m_path(path), m_parser(parser), m_loader(loader) {}
59 constexpr bool await_ready()
const {
return false; }
61 void await_suspend(std::coroutine_handle<U> handle) {
62 m_loader.readFile(m_path, m_parser, [handle,
this](
Buffer<uint8_t> &&data) {
63 m_data = eastl::move(data);
70 eastl::string_view m_path;
102 setupQueue(path, parser, eastl::move(callback));
106 setupQueue(path, parser, {});
110 return {path, parser, *
this};
114 void setupQueue(eastl::string_view path,
ISO9660Parser &parser,
120 bool m_pending =
false;
A class that manages a buffer of data.
Definition buffer.hh:63
An ISO9660 parser.
Definition iso9660-parser.hh:48
The Task class.
Definition task.hh:140
A task queue for processing tasks sequentially.
Definition task.hh:46
Task schedule()
Schedules the task queue to another task queue.
Definition task.cpp:68
void run()
Runs the task queue.
Definition task.cpp:61
A class that reads files from the CDRom.
Definition cdrom-loader.hh:54
ReadFileAwaiter readFile(eastl::string_view path, ISO9660Parser &parser)
Definition cdrom-loader.hh:109
psyqo::TaskQueue::Task scheduleReadFile(eastl::string_view path, ISO9660Parser &parser)
Definition cdrom-loader.hh:105
void readFile(eastl::string_view path, ISO9660Parser &parser, eastl::function< void(Buffer< uint8_t > &&)> &&callback)
Reads a file from the CDRom.
Definition cdrom-loader.hh:100
void setBuffer(Buffer< uint8_t > &&buffer)
Set the Buffer object for the next read operation.
Definition cdrom-loader.hh:88
Definition archive-manager.hh:43
An asynchronous read request.
Definition iso9660-parser.hh:74
static void * buffer
Definition syscalls.h:230