Nugget
|
An ISO9660 parser. More...
#include <psyqo/iso9660-parser.hh>
Classes | |
struct | DirEntry |
An ISO9660 directory entry. More... | |
struct | GetDirentryAwaiter |
struct | InitializeAwaiter |
struct | ReadRequest |
An asynchronous read request. More... | |
Public Member Functions | |
ISO9660Parser (CDRom *cdrom) | |
The ISO9660Parser constructor. | |
void | initialize (eastl::function< void(bool success)> callback) |
Initializes the parser. | |
TaskQueue::Task | scheduleInitialize () |
InitializeAwaiter | initialize () |
void | getDirentry (eastl::string_view path, DirEntry *entry, eastl::function< void(bool success)> callback) |
Get the Direntry object for a given path. | |
TaskQueue::Task | scheduleGetDirentry (eastl::string_view path, DirEntry *entry) |
GetDirentryAwaiter | getDirentry (eastl::string_view path, DirEntry *entry) |
TaskQueue::Task | scheduleReadRequest (ReadRequest *request) |
Read a file asynchronously. | |
bool | initialized () |
Returns the state of the parser. | |
CDRom * | getCDRom () |
Returns the CDRom object used by the parser. | |
An ISO9660 parser.
This class is a simple ISO9660 parser. It is not meant to be a full implementation, but rather a simple parser that can be used to find the files to be loaded.
|
inline |
The ISO9660Parser constructor.
This constructor takes a CDRom device as a parameter. It will use that device to read the structure of the ISO9660 filesystem.
cdrom | The CDRom device to use. |
|
inline |
|
inline |
void psyqo::ISO9660Parser::getDirentry | ( | eastl::string_view | path, |
DirEntry * | entry, | ||
eastl::function< void(bool success)> | callback | ||
) |
Get the Direntry object for a given path.
This method looks up the directory entry for a given path. It will fail if the CDRom device fails reading the disk, or if the parser hasn't been initialized yet. If the directory entry is not found, the callback or task will still be successful, but the directory entry will be invalid.
[in] | path | The path to look for. |
[out] | entry | The DirEntry object to fill. |
|
inline |
Initializes the parser.
This method initializes the basic internal structures of the parser. It must be called before any other method. If the underlying CDRom device fails reading, or if the filesystem is not an ISO9660, the callback or task will fail. It can be called multiple times, and has to be called when the user changes the disc in the drive.
|
inline |
Returns the state of the parser.
This method returns true if the parser was initialized successfully, and false otherwise.
psyqo::TaskQueue::Task psyqo::ISO9660Parser::scheduleGetDirentry | ( | eastl::string_view | path, |
DirEntry * | entry | ||
) |
psyqo::TaskQueue::Task psyqo::ISO9660Parser::scheduleInitialize | ( | ) |
psyqo::TaskQueue::Task psyqo::ISO9660Parser::scheduleReadRequest | ( | ReadRequest * | request | ) |
Read a file asynchronously.
This method reads a file asynchronously. It will read the file from the given entry
in the ReadRequest
, and will read the number of sectors corresponding to the entry's size. The buffer is specified by the buffer
field in the ReadRequest
, and must be large enough to hold the whole file. This method is mainly a helper around the CDRom device's readSectors
method.
[in] | request | The request to fill. |