nix-super/src/libutil/compression.hh

29 lines
670 B
C++
Raw Normal View History

#pragma once
#include "ref.hh"
#include "types.hh"
2016-05-04 16:46:25 +03:00
#include "serialise.hh"
#include <string>
namespace nix {
2016-05-04 16:46:25 +03:00
struct CompressionSink : BufferedSink
{
virtual void finish() = 0;
};
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);
ref<CompressionSink> makeCompressionSink(const std::string & method, Sink & nextSink, const bool parallel = false);
2016-05-04 16:46:25 +03:00
MakeError(UnknownCompressionMethod, Error);
MakeError(CompressionError, Error);
}