Boost logo

Boost :

From: Domen Vrankar (domen.vrankar_at_[hidden])
Date: 2020-03-11 06:15:51


On Wed, Mar 11, 2020 at 2:18 AM Vinnie Falco <vinnie.falco_at_[hidden]> wrote:

> On Tue, Mar 10, 2020 at 5:03 PM Jeff Garland <azswdude_at_[hidden]> wrote:
> > fyi w.r.t streaming there is already a proposal in this area -- which I
> thought got put into the library fundamentals TS, but not seeing that it
> happened now. There is a github for it, but I think Peter got tired of
> championing this and would like others to pick it up.
>
> "streambuf" is far too heavyweight to use as a low-level interface. I
> already pointed out that a codec needs to have as arguments not only
> the input and output "spans" but also return the number of bytes
> transacted for input and output.
>
> signal-to-noise in this discussion is low...in a sense, zlib gets the
> crux of it right with the z_params:
>
> struct z_params
> {
> void const* next_in;
> std::size_t avail_in;
> std::size_t total_in = 0;
> void* next_out;
> std::size_t avail_out;
> std::size_t total_out = 0;
> int data_type = unknown; // best guess about the data type:
> binary or text
> };
>
> The question is, can we do better than this? I'm certain that all
> answers which boil down to "copy std stream APIs" are wrong.
>

"copy std stream APIs" answer is wrong in my opinion as well but I would
most certainly expect such a library to provide a convenient way to adapt a
stream - I really dislike libraries that do their own thing and don't
provide a convenient way to adapt to existing standard constructs.

Regards,
Domen

>
> Thanks
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk