bxzstr icon indicating copy to clipboard operation
bxzstr copied to clipboard

clean up and readme edit

Open robertnurnberg opened this issue 11 months ago • 4 comments

This PR offers a cleaner implementation of the new istreambuf constructor introduced in https://github.com/tmaklin/bxzstr/pull/32. We also add a new overloaded ifstream constructor, allowing the simpler syntax

bxz::ifstream input(file, bxz::zstd);

as for ofstream.

Also edit the readme.

robertnurnberg avatar Feb 03 '25 13:02 robertnurnberg

Btw, with the new none compression method the old auto_detect parameter for the istreambuf constructor could be dropped completely. Going either for the syntax

istreambuf(std::streambuf * _sbuf_p, Compression _type = none, std::size_t _buff_size = default_buff_size)

or

istreambuf(std::streambuf * _sbuf_p, std::size_t _buff_size = default_buff_size, Compression _type = none)

And with the convention that none means we attempt auto detection.

Let me know if you think this is a good idea and which of the two syntax you would prefer. (Only the latter would give backward compatibility.) I could then prepare a PR.

robertnurnberg avatar Feb 03 '25 13:02 robertnurnberg

Thanks again, I need to do a major version bump anyway to fix #23 and #27 so the first one looks better to me. Feel free to make a PR if you like.

tmaklin avatar Feb 03 '25 16:02 tmaklin

~~Can do the PR as discussed once this is merged.~~ See https://github.com/tmaklin/bxzstr/pull/35 for an implementation.

robertnurnberg avatar Feb 03 '25 16:02 robertnurnberg

Changing this to draft in favour of #35.

robertnurnberg avatar Feb 03 '25 18:02 robertnurnberg