Nugget
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
psyqo::paths::CDRomLoader Class Reference

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)
 

Detailed Description

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.

Member Function Documentation

◆ readFile() [1/2]

ReadFileAwaiter psyqo::paths::CDRomLoader::readFile ( eastl::string_view  path,
GPU gpu,
ISO9660Parser parser 
)
inline

◆ readFile() [2/2]

void psyqo::paths::CDRomLoader::readFile ( eastl::string_view  path,
GPU gpu,
ISO9660Parser parser,
eastl::function< void(eastl::vector< uint8_t > &&)> &&  callback 
)
inline

Reads a file from the CDRom.

Parameters
pathThe path to the file to read. The view must be persistent until the callback is called.
gpuThe GPU class used by the application, in order to set timers.
parserThe ISO9660Parser to use for reading the file.
callbackThe 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.

◆ scheduleReadFile()

psyqo::TaskQueue::Task psyqo::paths::CDRomLoader::scheduleReadFile ( eastl::string_view  path,
GPU gpu,
ISO9660Parser parser 
)
inline

The documentation for this class was generated from the following files: