2013-04-23 10:28:39 +02:00
|
|
|
//===-- llvm/Support/Compression.h ---Compression----------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-04-23 10:28:39 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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 {
|
|
|
|
|
2018-08-04 02:13:13 +02:00
|
|
|
static constexpr int NoCompression = 0;
|
|
|
|
static constexpr int BestSpeedCompression = 1;
|
|
|
|
static constexpr int DefaultCompression = 6;
|
|
|
|
static constexpr int BestSizeCompression = 9;
|
2013-04-23 10:28:39 +02:00
|
|
|
|
|
|
|
bool isAvailable();
|
|
|
|
|
2017-01-17 16:45:07 +01:00
|
|
|
Error compress(StringRef InputBuffer, SmallVectorImpl<char> &CompressedBuffer,
|
2018-08-04 02:13:13 +02:00
|
|
|
int 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
|