aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/compression.hh
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2019-12-10 15:47:38 +0700
committerLars Jellema <lars.jellema@gmail.com>2021-03-10 22:34:29 +0100
commit8a0c00b85600991cdb9aa05902defec6ac44b777 (patch)
tree79ec2c00b1c0131abbdb8d9e433274d51d8a5e95 /src/libutil/compression.hh
parentb19aec7eeb8353be6c59b2967a511a5072612d99 (diff)
Use libarchive for all compression
Diffstat (limited to 'src/libutil/compression.hh')
-rw-r--r--src/libutil/compression.hh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh
index dd666a4e1..192cb3e91 100644
--- a/src/libutil/compression.hh
+++ b/src/libutil/compression.hh
@@ -8,14 +8,18 @@
namespace nix {
-struct CompressionSink : BufferedSink
+struct CompressionSink : BufferedSink, FinishSink
{
- virtual void finish() = 0;
+ using BufferedSink::operator ();
+ using BufferedSink::write;
+ using FinishSink::finish;
};
+std::unique_ptr<Source> makeDecompressionSource(Source & prev);
+
ref<std::string> decompress(const std::string & method, const std::string & in);
-ref<CompressionSink> makeDecompressionSink(const std::string & method, Sink & nextSink);
+std::unique_ptr<FinishSink> makeDecompressionSink(const std::string & method, Sink & nextSink);
ref<std::string> compress(const std::string & method, const std::string & in, const bool parallel = false);