14#include "../safeguards.h"
21 return this->consumer.GetBytesRead() > this->position;
29 return this->consumer.GetBytesRead() - this->position;
38 if (str.size() > unused) NOT_REACHED();
39 std::ranges::copy(str, this->dest.data() +
this->position);
40 this->position += str.size();
49 : consumer(buffer), builder(buffer, consumer)
54 : consumer(src.consumer), builder(src.builder, consumer)
Implementation of std::back_insert_iterator for non-growing destination buffer.
bool AnyBytesUnused() const noexcept
Check whether any unused bytes are left between the Builder and Consumer position.
size_type GetBytesUnused() const noexcept
Get number of unused bytes left between the Builder and Consumer position.
void PutBuffer(std::span< const char > str) override
Append buffer.
Compose data into a fixed size buffer, which is consumed at the same time.
InPlaceReplacement(std::span< char > buffer)
Create coupled Consumer+Builder pair.
InPlaceBuilder builder
Builder into shared buffer.
StringConsumer consumer
Consumer from shared buffer.
Inplace-replacement of textual and binary data.