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. | |
Public Attributes | |
GfsHn | Handle |
File handle. | |
FileSize | Size |
Size of the file. | |
File handling and status | |
void | Close () |
Close file. | |
bool | Open () |
Open file. | |
constexpr bool | Exists () |
File exists. | |
constexpr bool | IsOpen () |
File is open. | |
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 | 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. | |
|
inline |
|
inline |
Open a file on CD.
name | File name |
|
inlineconstexpr |
File exists.
|
inline |
|
inlineconstexpr |
Get file identifier.
|
inline |
Get number sectors take by specified byte count for this file.
bytes | Number of bytes |
|
inlineconstexpr |
File is open.
|
inline |
Loads specified amount of bytes from a file.
sectorOffset | Number of sectors to skip at the start |
size | Number of bytes to read (length of the batch) |
destination | Buffer to read batch into |
|
inline |
Open file.
|
inline |
Read specified number of bytes from the file and advances file access pointer.
size | Number of bytes to read |
destination | Buffer to read bytes into |
|
inline |
Seek file access pointer to specific byte.
offset | offset from start of the file |