The file reader provides features to read bytes from a binary file.
More...
#include <FileReader.hpp>
The file reader provides features to read bytes from a binary file.
◆ FileReader()
rl::FileReader::FileReader |
( |
const FilePath & |
path | ) |
|
|
explicit |
Creates and opens a file with reading permissions.
- Parameters
-
◆ open()
void rl::FileReader::open |
( |
const FilePath & |
path | ) |
|
Opens a file with reading permissions.
- Parameters
-
◆ operator bool()
rl::FileReader::operator bool |
( |
| ) |
const |
Tells if the file is in a good state.
- Returns
true
if no errors occurred while reading the file, false
if something went wrong
◆ read() [1/2]
ByteStream rl::FileReader::read |
( |
std::size_t |
size | ) |
|
Reads a chunk of bytes from the file.
- Parameters
-
size | The number of bytes that are to be read |
- Returns
- A data stream containing the bytes
◆ read() [2/2]
ByteStream rl::FileReader::read |
( |
std::size_t |
size, |
|
|
std::streampos |
pos |
|
) |
| |
Reads a chunk of bytes from a specific position in the file.
- Parameters
-
size | The number of bytes that are to be read |
pos | The position of the file cursor |
- Returns
- A data stream containing the bytes
◆ readAll()
Reads all bytes from the file.
- Returns
- A data stream containing all bytes
The documentation for this class was generated from the following file: