|
roo_io
API Documentation for roo_io
|
Bounded iterator reading from [begin, end).
More...
#include <memory_input_iterator.h>
Public Types | |
| using | PtrType = PtrTypeT |
Public Member Functions | |
| SafeGenericMemoryIterator (PtrType begin, PtrType end) | |
Creates bounded iterator over [begin, end). | |
| byte | read () |
| Reads one byte when available. | |
| size_t | read (byte *result, size_t count) |
Reads up to count bytes when available. | |
| void | skip (size_t count) |
Skips up to count bytes. | |
| Status | status () const |
Returns kEndOfStream after EOS marker is set, otherwise kOk. | |
| PtrType | ptr () const |
| Returns current pointer. | |
Bounded iterator reading from [begin, end).
Reaching end transitions status to kEndOfStream.
Memory footprint: two pointers (8 bytes on 32-bit targets).
Implements input iterator contract.
Definition at line 63 of file memory_input_iterator.h.
| using roo_io::SafeGenericMemoryIterator< PtrTypeT >::PtrType = PtrTypeT |
Definition at line 65 of file memory_input_iterator.h.
|
inline |
Creates bounded iterator over [begin, end).
Definition at line 68 of file memory_input_iterator.h.
|
inline |
Returns current pointer.
Definition at line 125 of file memory_input_iterator.h.
|
inline |
Reads one byte when available.
If already exhausted, returns zero byte and keeps EOS state. If this call detects exhaustion, marks EOS by setting internal end marker to null.
Definition at line 76 of file memory_input_iterator.h.
|
inline |
Reads up to count bytes when available.
Returns zero when exhausted and keeps EOS state. If this call detects exhaustion before reading, marks EOS. Reading exactly to the original end keeps status kOk until a later call detects exhaustion.
Definition at line 90 of file memory_input_iterator.h.
References roo_io::count.
|
inline |
Skips up to count bytes.
Skipping past available range sets EOS. Skipping exactly to end keeps status kOk until a later operation detects exhaustion.
Definition at line 109 of file memory_input_iterator.h.
References roo_io::count.
|
inline |
Returns kEndOfStream after EOS marker is set, otherwise kOk.
Definition at line 122 of file memory_input_iterator.h.
References roo_io::kEndOfStream, and roo_io::kOk.