diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-10-14 20:07:20 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-10-14 20:07:20 +0000 |
commit | 7869be49c2735280ceabbd13c087b4a06444ae63 (patch) | |
tree | a93530cdfba9f3056f727de26548c71157de19e5 /src/libutil/compression.hh | |
parent | 2dd11f07808c8b86513260b85f35a70cbe9b1249 (diff) | |
parent | 4c0cde95ad8dc95f876e5cf32790e73e08f49b28 (diff) |
Merge remote-tracking branch 'upstream/master' into trustless-remote-builder-simple
Diffstat (limited to 'src/libutil/compression.hh')
-rw-r--r-- | src/libutil/compression.hh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh index dd666a4e1..9b1e4a9d4 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/compression.hh @@ -8,18 +8,20 @@ namespace nix { -struct CompressionSink : BufferedSink +struct CompressionSink : BufferedSink, FinishSink { - virtual void finish() = 0; + using BufferedSink::operator (); + using BufferedSink::write; + using FinishSink::finish; }; 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); +ref<std::string> compress(const std::string & method, const std::string & in, const bool parallel = false, int level = -1); -ref<CompressionSink> makeCompressionSink(const std::string & method, Sink & nextSink, const bool parallel = false); +ref<CompressionSink> makeCompressionSink(const std::string & method, Sink & nextSink, const bool parallel = false, int level = -1); MakeError(UnknownCompressionMethod, Error); |