Abstract base class for deserialization data sources. More...
#include <eagine/serialize/data_source.hpp>
Public Member Functions | |
| virtual auto | top (span_size_t size) -> memory::const_block=0 |
| Returns a block covering the specified amount of data of the top. More... | |
| virtual void | pop (span_size_t size)=0 |
| Returns the specified amount of data of the top of the source. More... | |
| template<typename Function > | |
| auto | scan_until (Function predicate, const valid_if_positive< span_size_t > &max, const valid_if_positive< span_size_t > &step={256}) -> valid_if_nonnegative< span_size_t > |
| Returns the position of the first byte where predicate is true. More... | |
| auto | scan_for (byte what, const valid_if_positive< span_size_t > &max, const valid_if_positive< span_size_t > &step={256}) -> valid_if_nonnegative< span_size_t > |
| Returns the position of the first occurrence of the specified byte. More... | |
| void | fetch_all (memory::buffer &dst, valid_if_positive< span_size_t > step={256}) |
| Fetches all the remaining data into a buffer. | |
Public Member Functions inherited from eagine::interface< deserializer_data_source > | |
| constexpr | interface (const interface &)=delete |
| Not copyable. | |
| auto | operator= (interface &&)=delete |
| Not move assignable. | |
| auto | operator= (const interface &)=delete |
| Not copy assignable. | |
Additional Inherited Members | |
Protected Member Functions inherited from eagine::interface< deserializer_data_source > | |
| constexpr | interface () noexcept=default |
| Default constructible by derived. | |
| constexpr | interface (interface &&) noexcept=default |
| Move constructible by derived. | |
Abstract base class for deserialization data sources.
|
pure virtual |
Returns the specified amount of data of the top of the source.
Implemented in eagine::block_data_source, and eagine::istream_data_source.
|
inline |
Returns the position of the first occurrence of the specified byte.
| what | the searched value. |
| max | the maximum number of bytes from the top to scan. |
| step | how much data should be fetched per scan iteration. |
|
inline |
Returns the position of the first byte where predicate is true.
| predicate | the function indicating where to stop the scan. |
| max | the maximum number of bytes from the top to scan. |
| step | how much data should be fetched per scan iteration. |
|
pure virtual |
Returns a block covering the specified amount of data of the top.
Implemented in eagine::block_data_source, and eagine::istream_data_source.