Provides the common methods for the FileRead/FileWrite/FileRW classes. More...
#include <File.h>
Public Member Functions | |
| FileBase () | |
| Default constructor. | |
| FileBase (const FileBase &other) | |
| Copy constructor. | |
| FileBase & | operator= (const FileBase &other) |
| Assignment operator. | |
| virtual | ~FileBase () |
| Flushes the write buffer before destructing. This will close the file if it is the last FileBase sharing it. | |
| RStr | GetFilename () const |
| Returns the filename if one was given upon opening. | |
| void | SetFilename (const RStr &newfilename) const |
| Manually changes the associated filename. | |
| void | Close () |
| Flushes the buffers and closes the file. | |
| bool | IsOpen () const |
| True if the file is open. | |
| bool | IsClosed () const |
| True if the file is closed. | |
| bool | IsReadable () const |
| True if the file is open and readable. | |
| bool | IsWritable () const |
| True if the file is open and writable. | |
| FILE * | Raw () const |
| Returns a raw FILE* which can be used with the C file functions. | |
| void | Assert () const |
| Throws ErrorMsgFile if the file is closed. | |
| size_t | Size () const |
| Returns the file size in bytes. | |
| void | SetPosition (const size_t pos) |
| Sets the reading and writing position to pos bytes into the file. | |
| void | RelativePosition (const i64 amnt) |
| Sets the position for the next read or write operation. More... | |
| size_t | GetPosition (bool quiet_fail=false) const |
| Gets the position for the next read or write operation. More... | |
| void | Rewind () |
| Clears the read-ahead buffer used by FileRead::Get calls. | |
| void | Flush () |
| Flushes all unsaved data to the storage system. | |
| void | ClearBuffer () |
| Processes the remaining data in the Put/Get buffer. | |
Provides the common methods for the FileRead/FileWrite/FileRW classes.
|
inline |
Gets the position for the next read or write operation.
| quiet_fail | If true, does not throw an error from being unable to find the position. (0 is returned.) |
|
inline |
Sets the position for the next read or write operation.
Note: This has no effect on write operations in APPEND mode.
1.9.1