#include <File.h>
Inherits MCore::Stream.
Inherited by MCore::DiskFile, and MCore::MemoryFile.
Public Member Functions | |
| File () | |
| virtual | ~File () |
| virtual void | Close ()=0 |
| virtual void | Flush ()=0 |
| virtual bool | GetIsEOF () const =0 |
| virtual uint8 | GetNextByte ()=0 |
| virtual size_t | GetPos () const =0 |
| virtual size_t | GetFileSize () const =0 |
| virtual bool | WriteByte (uint8 value)=0 |
| virtual bool | Forward (size_t numBytes)=0 |
| virtual bool | Seek (size_t offset)=0 |
| virtual size_t | Read (void *data, size_t length)=0 |
| virtual size_t | Write (const void *data, size_t length)=0 |
| virtual bool | GetIsOpen () const =0 |
Public Member Functions inherited from MCore::Stream | |
| Stream () | |
| virtual | ~Stream () |
| virtual uint32 | GetType () const =0 |
| virtual Stream & | operator<< (bool b) |
| virtual Stream & | operator<< (char ch) |
| virtual Stream & | operator<< (uint8 ch) |
| virtual Stream & | operator<< (int16 number) |
| virtual Stream & | operator<< (uint16 number) |
| virtual Stream & | operator<< (int32 number) |
| virtual Stream & | operator<< (uint32 number) |
| virtual Stream & | operator<< (uint64 number) |
| virtual Stream & | operator<< (int64 number) |
| virtual Stream & | operator<< (float number) |
| virtual Stream & | operator<< (double number) |
| virtual Stream & | operator<< (AZStd::string &text) |
| virtual Stream & | operator<< (const char *text) |
| virtual Stream & | operator>> (bool &b) |
| virtual Stream & | operator>> (char &ch) |
| virtual Stream & | operator>> (uint8 &ch) |
| virtual Stream & | operator>> (int16 &number) |
| virtual Stream & | operator>> (uint16 &number) |
| virtual Stream & | operator>> (int32 &number) |
| virtual Stream & | operator>> (uint32 &number) |
| virtual Stream & | operator>> (int64 &number) |
| virtual Stream & | operator>> (uint64 &number) |
| virtual Stream & | operator>> (float &number) |
| virtual Stream & | operator>> (double &number) |
| virtual Stream & | operator>> (AZStd::string &text) |
The file abstract base class. This class represents some file from which the user can read, write, etc. Do not just think of this as only a file on disk. A file could be virtually anything from which can be read and to which can be written. Like a stream, but with more functionalities. For example the file could also be a specified section in your systems main memory. Another example could be the file being some sort of network stream.
|
inline |
The constructor.
|
inlinevirtual |
The destructor.
|
pure virtual |
Close the file.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Flush the file. All cached (not yet written) data will be forced to written when calling this method.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Seek ahead a given number of bytes. This can be used to skip a given number of upcoming bytes in the file.
| numBytes | The number of bytes to seek ahead. |
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Returns the size of this file in bytes.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Check if we reached the end of the file or not.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Check if the file has been opened already.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Reads and returns the next byte/character in the file. So this will increase the position in the file with one.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Returns the position in the file.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Read a given amount of data from the file.
| data | The pointer where to store the read data. |
| length | The size in bytes of the data to read. |
Reimplemented from MCore::Stream.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Seek to a given byte position in the file, where 0 would be the beginning of the file. So we're talking about the absolute position in the file. After successfully executing this method the method GetPos will return the given offset.
| offset | The offset in bytes (the position) in the file to seek to. |
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Writes a given amount of data to the file.
| data | The pointer to the data to write. |
| length | The size in bytes of the data to write. |
Reimplemented from MCore::Stream.
Implemented in MCore::DiskFile, and MCore::MemoryFile.
|
pure virtual |
Write a character or byte in the file.
| value | The character or byte to write. |
Implemented in MCore::DiskFile, and MCore::MemoryFile.