On Wed, Mar 11, 2020 at 2:18 AM Vinnie Falco
fyi w.r.t streaming there is already a proposal in this area -- which I
On Tue, Mar 10, 2020 at 5:03 PM Jeff Garland
wrote: 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