2013-04-23 10:28:39 +02:00
|
|
|
//===-- llvm/Support/Compression.h ---Compression----------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains basic functions for compression/uncompression.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_SUPPORT_COMPRESSION_H
|
|
|
|
#define LLVM_SUPPORT_COMPRESSION_H
|
|
|
|
|
|
|
|
#include "llvm/Support/DataTypes.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2015-03-23 19:07:13 +01:00
|
|
|
template <typename T> class SmallVectorImpl;
|
2017-01-17 16:45:07 +01:00
|
|
|
class Error;
|
2013-04-23 10:28:39 +02:00
|
|
|
class StringRef;
|
|
|
|
|
|
|
|
namespace zlib {
|
|
|
|
|
|
|
|
enum CompressionLevel {
|
|
|
|
NoCompression,
|
|
|
|
DefaultCompression,
|
|
|
|
BestSpeedCompression,
|
|
|
|
BestSizeCompression
|
|
|
|
};
|
|
|
|
|
|
|
|
bool isAvailable();
|
|
|
|
|
2017-01-17 16:45:07 +01:00
|
|
|
Error compress(StringRef InputBuffer, SmallVectorImpl<char> &CompressedBuffer,
|
|
|
|
CompressionLevel Level = DefaultCompression);
|
2013-04-23 10:28:39 +02:00
|
|
|
|
2017-01-17 16:45:07 +01:00
|
|
|
Error uncompress(StringRef InputBuffer, char *UncompressedBuffer,
|
|
|
|
size_t &UncompressedSize);
|
2016-09-09 21:32:36 +02:00
|
|
|
|
2017-01-17 16:45:07 +01:00
|
|
|
Error uncompress(StringRef InputBuffer,
|
|
|
|
SmallVectorImpl<char> &UncompressedBuffer,
|
|
|
|
size_t UncompressedSize);
|
2013-04-23 10:28:39 +02:00
|
|
|
|
2013-08-14 18:03:29 +02:00
|
|
|
uint32_t crc32(StringRef Buffer);
|
|
|
|
|
2013-04-23 10:28:39 +02:00
|
|
|
} // End of namespace zlib
|
|
|
|
|
|
|
|
} // End of namespace llvm
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|