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

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.
 
CDRomgetCDRom ()
 Returns the CDRom object used by the parser.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ISO9660Parser()

psyqo::ISO9660Parser::ISO9660Parser ( CDRom cdrom)
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.

Parameters
cdromThe CDRom device to use.

Member Function Documentation

◆ getCDRom()

CDRom * psyqo::ISO9660Parser::getCDRom ( )
inline

Returns the CDRom object used by the parser.

Returns
The CDRom object.

◆ getDirentry() [1/2]

GetDirentryAwaiter psyqo::ISO9660Parser::getDirentry ( eastl::string_view  path,
DirEntry entry 
)
inline

◆ getDirentry() [2/2]

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.

Parameters
[in]pathThe path to look for.
[out]entryThe DirEntry object to fill.

◆ initialize() [1/2]

InitializeAwaiter psyqo::ISO9660Parser::initialize ( )
inline

◆ initialize() [2/2]

void psyqo::ISO9660Parser::initialize ( eastl::function< void(bool success)>  callback)

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.

◆ initialized()

bool psyqo::ISO9660Parser::initialized ( )
inline

Returns the state of the parser.

This method returns true if the parser was initialized successfully, and false otherwise.

Returns
The root directory entry.

◆ scheduleGetDirentry()

psyqo::TaskQueue::Task psyqo::ISO9660Parser::scheduleGetDirentry ( eastl::string_view  path,
DirEntry entry 
)

◆ scheduleInitialize()

psyqo::TaskQueue::Task psyqo::ISO9660Parser::scheduleInitialize ( )

◆ scheduleReadRequest()

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.

Parameters
[in]requestThe request to fill.

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