SaturnRingLibrary 0.9.2
SGL wrapper
Loading...
Searching...
No Matches
SRL::Cd::File Struct Reference

Detailed Description

Disk file.

#include <srl_cd.hpp>

Public Member Functions

 File ()=delete
 disable default constructor
 File (const char *name)
 Open a file on CD.
 File (GfsHn handle, int32_t fid, bool getSize=true)
 Construct a new File object from Gfs handle and identifier.
 ~File ()
 Close file.
File handling and status
void Close ()
 Close file.
bool Open ()
 Open file.
constexpr bool Exists ()
 File exists.
constexpr size_t GetCurrentPosition ()
 Gets the current position in the file.
constexpr bool IsOpen ()
 File is open.
constexpr bool IsEOF ()
 EOF has been reached.
File reading
int32_t LoadBytes (size_t sectorOffset, int32_t size, void *destination)
 Loads specified amount of bytes from a file.
int32_t Read (int32_t size, void *destination)
 Read specified number of bytes from the file and advances file access pointer.
int32_t ReadSectors (const int32_t sectorCount, void *destination)
 Read specified number of sectors from the file and advances file access pointer.
int32_t Seek (int32_t offset)
 Seek file access pointer to specific byte.
Other
int32_t GetCurrentAccessPointer ()
constexpr int32_t GetIdentifier ()
 Get file identifier.
int32_t GetSectorCount (size_t bytes)
 Get number sectors take by specified byte count for this file.

Public Attributes

GfsHn Handle
 File handle.
FileSize Size
 Size of the file.