2015-10-30 13:33:40 +02:00
|
|
|
#pragma once
|
|
|
|
|
2016-04-15 16:11:34 +03:00
|
|
|
#include "ref.hh"
|
2016-04-29 18:02:57 +03:00
|
|
|
#include "types.hh"
|
2016-05-04 16:46:25 +03:00
|
|
|
#include "serialise.hh"
|
2016-04-15 16:11:34 +03:00
|
|
|
|
2015-10-30 13:33:40 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
2016-05-04 16:46:25 +03:00
|
|
|
struct CompressionSink : BufferedSink
|
|
|
|
{
|
|
|
|
virtual void finish() = 0;
|
|
|
|
};
|
|
|
|
|
2018-08-06 16:40:29 +03:00
|
|
|
ref<std::string> decompress(const std::string & method, const std::string & in);
|
|
|
|
|
|
|
|
ref<CompressionSink> makeDecompressionSink(const std::string & method, Sink & nextSink);
|
|
|
|
|
|
|
|
ref<std::string> compress(const std::string & method, const std::string & in, const bool parallel = false);
|
|
|
|
|
2018-02-07 18:54:08 +02:00
|
|
|
ref<CompressionSink> makeCompressionSink(const std::string & method, Sink & nextSink, const bool parallel = false);
|
2016-05-04 16:46:25 +03:00
|
|
|
|
2016-04-29 18:02:57 +03:00
|
|
|
MakeError(UnknownCompressionMethod, Error);
|
2015-10-30 13:33:40 +02:00
|
|
|
|
2017-03-21 20:23:07 +02:00
|
|
|
MakeError(CompressionError, Error);
|
|
|
|
|
2015-10-30 13:33:40 +02:00
|
|
|
}
|