#include <serialise.hh>
Public Member Functions | |
SizedSource (Source &orig, size_t size) | |
size_t | read (char *data, size_t len) override |
size_t | drainAll () |
![]() | |
void | operator() (char *data, size_t len) |
void | operator() (std::string_view data) |
virtual bool | good () |
void | drainInto (Sink &sink) |
std::string | drain () |
Public Attributes | |
Source & | orig |
size_t | remain |
A reader that consumes the original Source until 'size'.
|
inline |
Consume the original source until no remain data is left to consume.
Store up to ‘len’ in the buffer pointed to by ‘data’, and return the number of bytes stored. It blocks until at least one byte is available.
Implements nix::Source.