Variable rdf4cpp::writer::BufWriter

Variable Documentation

template<typename W> concept rdf4cpp::writer::BufWriter   = requires(W &bw, size_t additional_cap) {typename W::Buffer;{ bw.buffer() } -> std::same_as<typename W::Buffer &>;{ bw.write_area() } -> std::same_as<char *&>;{ bw.write_area_size() } -> std::same_as<size_t &>;{ bw.finalize() } -> std::convertible_to<bool>;W::flush(&bw.buffer(), &bw.write_area(), &bw.write_area_size(), additional_cap);}

A type that can be used for buffered output. To write bytes to a BufWriter use write_str(std::string_view, BufWriter &w) below.

Conceptually, it is three things. Some buffer-like object, a cursor into that buffer and a way to flush the buffer somewhere to make some room.

Users of this concept write to the provided buffer in the place where the cursor points. After writing the cursor should be advanced. If the cursor says that there is no more room flush should be called.