#include <FileReader.h>
Public Types | |
using | SizeType = AZ::u64 |
Public Member Functions | |
FileReader () | |
Creates FileReader instance in the default state with no file opened. | |
FileReader (AZ::IO::FileIOBase *fileIoBase, const char *filePath) | |
FileReader (FileReader &&other) | |
Takes ownership of the supplied FileReader handle. | |
FileReader & | operator= (FileReader &&other) |
Moves ownership of FileReader handle to this instance. | |
bool | Open (AZ::IO::FileIOBase *fileIoBase, const char *filePath) |
bool | IsOpen () const |
void | Close () |
Closes the File. | |
SizeType | Length () const |
Retrieve the length of the OpenFile. | |
SizeType | Read (SizeType byteSize, void *buffer) |
SizeType | Tell () const |
bool | Seek (AZ::s64 offset, SeekType type) |
bool | Eof () const |
Returns true if the file is open and in the EOF state. | |
bool | GetFilePath (AZ::IO::FixedMaxPath &filePath) const |
Static Public Member Functions | |
static FileReader | GetStdin () |
Structure which encapsulates delegates File Read operations to either the FileIOBase or SystemFile classes based if a FileIOBase* instance has been supplied to the FileSystemReader class the SettingsRegistry option to use FileIO
AZ::IO::FileReader::FileReader | ( | AZ::IO::FileIOBase * | fileIoBase, |
const char * | filePath | ||
) |
Creates a new FileReader instance and attempts to open the file at the supplied path Uses the FileIOBase instance if supplied
fileIOBase | pointer to fileIOBase instance |
null-terminated | filePath to open |
bool AZ::IO::FileReader::GetFilePath | ( | AZ::IO::FixedMaxPath & | filePath | ) | const |
Store the file path of the open file into the output file path parameter The filePath reference is left unmodified, if the path was not stored
|
static |
Returns a FileReader which wraps the SystemFile handle to stdin descriptor
bool AZ::IO::FileReader::IsOpen | ( | ) | const |
Returns true if a file is currently open
bool AZ::IO::FileReader::Open | ( | AZ::IO::FileIOBase * | fileIoBase, |
const char * | filePath | ||
) |
Opens a File using the FileIOBase instance if non-nullptr Otherwise fall back to use SystemFile
fileIOBase | pointer to fileIOBase instance |
null-terminated | filePath to open |
SizeType AZ::IO::FileReader::Read | ( | SizeType | byteSize, |
void * | buffer | ||
) |
Attempts to read up to byte size bytes into the supplied buffer
byteSize | - Maximum number of bytes to read |
buffer | - Buffer to read bytes into |
bool AZ::IO::FileReader::Seek | ( | AZ::s64 | offset, |
SeekType | type | ||
) |
Seeks within the open file to the offset supplied
offset | File offset to seek to |
type | parameter to indicate the reference point to start the seek from |
SizeType AZ::IO::FileReader::Tell | ( | ) | const |
Returns the current file offset