|
wavelength 1.0.0
|
Open file of the host or the disc. More...
#include <file.h>

Public Types | |
| enum | Mode { kModeRead = 1 , kModeWrite = 2 } |
| Open modes of New(). More... | |
Public Member Functions | |
| virtual | ~File () |
| Close the file. | |
| virtual int | Read (void *pBuffer, int nBytes)=0 |
| Read bytes and wait for them. | |
| virtual bool | ReadAsync (void *pBuffer, int nBytes)=0 |
| Start reading bytes. | |
| virtual int | Write (const void *pBuffer, int nBytes)=0 |
| Write bytes. | |
| virtual int | Seek (int nOffset, int nOrigin)=0 |
| Move the position. | |
| virtual int | Tell ()=0 |
| Report the position. | |
| virtual void | Flush ()=0 |
| Write out buffered bytes. | |
| virtual bool | Eof ()=0 |
| Report whether the position is at the end. | |
| virtual bool | Fail ()=0 |
| Report whether an operation failed. | |
| virtual int | Size ()=0 |
| Report the size. | |
| virtual int | UncompressedSize ()=0 |
| Report the size before compression. | |
| virtual bool | ReadDone (int *pnBytes)=0 |
| Report whether the read ReadAsync() started is complete. | |
| virtual | ~File () |
| Close the file. | |
| virtual int | Read (void *data, int bytes)=0 |
| Read bytes and wait for them. | |
| virtual bool | ReadAsync (void *data, int bytes)=0 |
| Start a read that ReadDone() finishes. | |
| virtual int | Write (const void *data, int bytes)=0 |
| Write bytes. | |
| virtual int | Seek (int offset, int origin)=0 |
| Move the position. | |
| virtual int | Tell ()=0 |
| virtual void | Flush ()=0 |
| Write out buffered data. | |
| virtual bool | Eof ()=0 |
| virtual bool | Fail ()=0 |
| virtual int | Size ()=0 |
| virtual int | UncompressedSize ()=0 |
| virtual bool | ReadDone (int *bytes)=0 |
| Report whether the read ReadAsync() started has finished. | |
Static Public Member Functions | |
| static File * | New (const char *pszPath, int nMode, int nFlags) |
| Open a file. | |
Static Public Attributes | |
| static constexpr int | kFlagNoArchive = 1 |
| The open flags New() takes to read even a disc file through AsyncFile. | |
Open file of the host or the disc.
An open file, read from the archive, the disc, or the host.
The RTTI includes the class name. The class is polymorphic, each kind of storage implements it, and the members after the destructor are pure in this class.
The RTTI records the class. It has no members, and its subclasses provide every operation.
| enum File::Mode |
Open modes of New().
| Enumerator | |
|---|---|
| kModeRead | Read the file. |
| kModeWrite | Write the file. |
|
inlinevirtual |
Close the file.
|
virtual |
Close the file.
|
static |
Open a file.
A file read from the disc comes from the archive through ArkFile unless nFlags is kFlagNoArchive. Every other file is an AsyncFile. While the trace is on, the path of each file opened to read is written to the trace log.
| pszPath | The path. |
| nMode | The open mode, one or more of Mode. |
| nFlags | The open flags. |
|
pure virtual |
|
pure virtual |
Start reading bytes.
ReadDone() reports when they arrived.
| pBuffer | Receives the bytes. |
| nBytes | The number of bytes. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Report whether the read ReadAsync() started is complete.
| pnBytes | Receives the number of bytes read. |
|
pure virtual |
|
pure virtual |
Start a read that ReadDone() finishes.
| data | Receives the bytes. |
| bytes | The number of bytes. |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Report whether the read ReadAsync() started has finished.
| bytes | Receives the number of bytes read. |
|
staticconstexpr |