Single-pass byte reader over an input iterator and sentinel. More...
#include <io.hpp>
Public Member Functions | |
| byte_reader (input_iterator first, sentinel last) | |
| Constructs a reader over an iterator range. | |
| bool | empty () const |
| Tests whether no unread byte remains. | |
| bool | peek (std::byte &value) |
| Inspects the next byte without consuming it. | |
| bool | read (std::byte &value) |
| Reads one byte. | |
| bool | read (std::uint8_t &value) |
| Reads one byte as an unsigned integer. | |
| std::size_t | consumed () const noexcept |
| Returns the number of bytes consumed from the source. | |
Single-pass byte reader over an input iterator and sentinel.
| input_iterator | Input iterator yielding std::byte or one-byte integral values. |
| sentinel | Sentinel type for the input iterator. |
One byte of lookahead supports format-boundary checks without requiring a forward iterator. The consumed count excludes a byte held by peek().
|
inline |
|
inlinenodiscardnoexcept |
|
inlinenodiscard |
Tests whether no unread byte remains.
Definition at line 86 of file io.hpp.
Referenced by rpnx::compression::bzip2_codec::decompress(), rpnx::compression::deflate_codec::decompress(), rpnx::compression::lz4_codec::decompress(), rpnx::compression::xz_codec::decompress(), and rpnx::compression::zstandard_codec::decompress().
|
inlinenodiscard |
Inspects the next byte without consuming it.
| value | Receives the next byte on success and is unchanged at end of input. |
Definition at line 96 of file io.hpp.
References rpnx::compression::implementation::to_byte().
Referenced by rpnx::compression::xz_codec::decompress().
|
inlinenodiscard |
Reads one byte.
| value | Receives the byte on success and is unchanged at end of input. |
Definition at line 116 of file io.hpp.
References rpnx::compression::implementation::to_byte().
Referenced by rpnx::compression::deflate_codec::decompress(), rpnx::compression::lz4_codec::decompress(), rpnx::compression::xz_codec::decompress(), rpnx::compression::zstandard_codec::decompress(), and read().
|
inlinenodiscard |