54 static File *
New(
const char *pszPath,
int nMode,
int nFlags);
72 virtual int Read(
void *pBuffer,
int nBytes) = 0;
81 virtual bool ReadAsync(
void *pBuffer,
int nBytes) = 0;
90 virtual int Write(
const void *pBuffer,
int nBytes) = 0;
100 virtual int Seek(
int nOffset,
int nOrigin) = 0;
Open file of the host or the disc.
Definition file.h:29
virtual int UncompressedSize()=0
Report the size before compression.
static File * New(const char *pszPath, int nMode, int nFlags)
Open a file.
virtual int Read(void *pBuffer, int nBytes)=0
Read bytes and wait for them.
virtual ~File()
Close the file.
Definition file.h:62
virtual bool ReadAsync(void *pBuffer, int nBytes)=0
Start reading bytes.
virtual int Seek(int nOffset, int nOrigin)=0
Move the position.
static constexpr int kFlagNoArchive
The open flags New() takes to read even a disc file through AsyncFile.
Definition file.h:38
virtual int Size()=0
Report the size.
virtual bool Fail()=0
Report whether an operation failed.
virtual int Tell()=0
Report the position.
Mode
Open modes of New().
Definition file.h:32
@ kModeRead
Definition file.h:33
@ kModeWrite
Definition file.h:34
virtual bool ReadDone(int *pnBytes)=0
Report whether the read ReadAsync() started is complete.
virtual void Flush()=0
Write out buffered bytes.
virtual bool Eof()=0
Report whether the position is at the end.
virtual int Write(const void *pBuffer, int nBytes)=0
Write bytes.
Growable text buffer that is also a PrnStream.
Definition string.h:19
void FileSetTraceEnabled(int nEnabled)
Turn the trace of File::New() on or off.
void FileSetBootPath(const char *pszPath)
Record the path the executable was started from, without its device and version.
void FileNoteRead(const char *pszPath)
Note the first read of a file.
void FileInit()
Read the file settings of the system configuration.
void FileOpenTraceLog(const char *pszPath)
Open the trace log that File::New() writes the path of each file read to, and turn the trace on.
void FormatDevicePath(char *pszDest, int nSize, const char *pszFile)
Format the device path of a game file.
void MakeDevicePath(String &path, const char *pszFile)
Build the device path of a game file.
int FileIsTraceEnabled()
Report whether the trace of File::New() is on.
char FileSourceLetter()
Report the letter the module loader puts in front of a module's source.
constexpr int kImageFirstWord
The word at 0x00100000, the load address of the executable.
Definition file.h:13
std::vector< File * > gFileTable
Files the gzip reader reads by descriptor, 128 entries.
constexpr int kImageSecondWord
The word at 0x00100004.
Definition file.h:21
int FileMkDir(const char *pszPath)
Create a host directory.
int FileGetStat(const char *pszPath, FileStat *pStat)
Report the status of a host file.
void FileTerminate()
Close the trace log.
const char * FileBootExecutable()
Report the path FileSetBootPath() recorded.
Status of a host file FileGetStat() reports.
Definition file.h:150
int mSize
Definition file.h:152
unsigned char mModified[8]
Definition file.h:155
unsigned char mAccessed[8]
Definition file.h:154
int mMode
Definition file.h:151
unsigned char mCreated[8]
Definition file.h:153