Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2020-03-11 01:17:58


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.

Thanks


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