|
| BufferedFile (AutoFile &file, uint64_t nBufSize, uint64_t nRewindIn) |
|
bool | eof () const |
| check whether we're at the end of the source file More...
|
|
void | read (Span< std::byte > dst) |
| read a number of bytes More...
|
|
void | SkipTo (const uint64_t file_pos) |
| Move the read position ahead in the stream to the given position. More...
|
|
uint64_t | GetPos () const |
| return the current reading position More...
|
|
bool | SetPos (uint64_t nPos) |
| rewind to a given reading position More...
|
|
bool | SetLimit (uint64_t nPos=std::numeric_limits< uint64_t >::max()) |
| prevent reading beyond a certain position no argument removes the limit More...
|
|
template<typename T > |
BufferedFile & | operator>> (T &&obj) |
|
void | FindByte (std::byte byte) |
| search for a given byte in the stream, and remain positioned on it More...
|
|
Wrapper around an AutoFile& that implements a ring buffer to deserialize from.
It guarantees the ability to rewind a given number of bytes.
Will automatically close the file when it goes out of scope if not null. If you need to close the file early, use file.fclose() instead of fclose(file).
Definition at line 476 of file streams.h.
std::pair< std::byte *, size_t > BufferedFile::AdvanceStream |
( |
size_t |
length | ) |
|
|
inlineprivate |
Advance the stream's read pointer (m_read_pos) by up to 'length' bytes, filling the buffer from the file so that at least one byte is available.
Return a pointer to the available buffer data and the number of bytes (which may be less than the requested length) that may be accessed beginning at that pointer.
Definition at line 508 of file streams.h.