From 1280bdd7bb23c6320f14b6f5160eb9826778df04 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sun, 15 Nov 2020 18:23:34 +0100 Subject: [PATCH 1/2] apparently some people want this --- src/zstr.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/zstr.hpp b/src/zstr.hpp index d2b3c57..f08117d 100644 --- a/src/zstr.hpp +++ b/src/zstr.hpp @@ -441,6 +441,12 @@ class ifstream { if (rdbuf()) delete rdbuf(); } + + /// Return the position within the compressed file (wrapped filestream) + std::streampos compressed_tellg() + { + return _fs.tellg(); + } }; // class ifstream class ofstream @@ -474,6 +480,12 @@ class ofstream { if (rdbuf()) delete rdbuf(); } + + // Return the position within the compressed file (wrapped filestream) + std::streampos compressed_tellp() + { + return _fs.tellp(); + } }; // class ofstream } // namespace zstr From 7abde357b82f79857b635500abe68ea0fe1e5109 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Wed, 28 Jul 2021 20:13:40 +0200 Subject: [PATCH 2/2] Update readme with info about miniz, just in case someone doesn't know about it --- README.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index f7a7ae4..dc4e41b 100644 --- a/README.org +++ b/README.org @@ -18,10 +18,12 @@ Alternatives to this library include: - The [[http://www.boost.org/doc/libs/release/libs/iostreams/][Boost IOStreams]] library. The library does not auto-detect input compression (by default, though that can be easily implemented with filters), and more importantly, it is not a header-only Boost library. -- The [[https://github.com/tmaklin/bxzstr][bxzstr]] library. +- The [[https://github.com/tmaklin/bxzstr][bxzstr]] library, if you want support for BZ2 and/or LZMA as well. For an example usage, see [[examples/ztxtpipe.cpp]] and [[examples/zc.cpp]]. +It is compatible with [[https://github.com/richgel999/miniz][miniz]] in case you don't want to get frustrated with zlib e. g. on Windows. + **** Input Auto-detection For input access, the library seamlessly auto-detects whether the source stream is compressed or not. The following compressed streams are detected: