|
OpenNN
Open-source neural networks library
|
Thread-safe positional file reader (pread on POSIX, overlapped ReadFile on Windows). More...
#include <io_utilities.h>
Public Member Functions | |
| FileReader ()=default | |
| ~FileReader () | |
| FileReader (const FileReader &)=delete | |
| FileReader & | operator= (const FileReader &)=delete |
| FileReader (FileReader &&)=delete | |
| FileReader & | operator= (FileReader &&)=delete |
| void | open (const filesystem::path &path) |
| Opens the file at the given path for reading. | |
| void | close () |
| Closes the underlying file handle, if any. | |
| bool | is_open () const |
| Returns true while the underlying handle is open. | |
| void | read_at (void *buffer, size_t bytes, uint64_t offset) const |
| Reads bytes from a specific offset into the provided buffer (thread-safe). | |
| uint64_t | file_size () const |
| Returns the total size of the open file in bytes. | |
Thread-safe positional file reader (pread on POSIX, overlapped ReadFile on Windows).
|
default |
| opennn::FileReader::~FileReader | ( | ) |
|
delete |
|
delete |
| void opennn::FileReader::close | ( | ) |
Closes the underlying file handle, if any.
|
nodiscard |
Returns the total size of the open file in bytes.
|
nodiscard |
Returns true while the underlying handle is open.
| void opennn::FileReader::open | ( | const filesystem::path & | path | ) |
Opens the file at the given path for reading.
|
delete |
|
delete |
| void opennn::FileReader::read_at | ( | void * | buffer, |
| size_t | bytes, | ||
| uint64_t | offset ) const |
Reads bytes from a specific offset into the provided buffer (thread-safe).
| buffer | Destination buffer (must hold at least bytes). |
| bytes | Number of bytes to read. |
| offset | Byte offset within the file to read from. |