blob: 2d191abe4b1afc537b9babd3027c78e76ccda96a [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===-- llvm/Support/Compression.h ---Compression----------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file contains basic functions for compression/uncompression.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_SUPPORT_COMPRESSION_H
15#define LLVM_SUPPORT_COMPRESSION_H
16
17#include "llvm/Support/DataTypes.h"
18
19namespace llvm {
20template <typename T> class SmallVectorImpl;
21class Error;
22class StringRef;
23
24namespace zlib {
25
26enum CompressionLevel {
27 NoCompression,
28 DefaultCompression,
29 BestSpeedCompression,
30 BestSizeCompression
31};
32
33bool isAvailable();
34
35Error compress(StringRef InputBuffer, SmallVectorImpl<char> &CompressedBuffer,
36 CompressionLevel Level = DefaultCompression);
37
38Error uncompress(StringRef InputBuffer, char *UncompressedBuffer,
39 size_t &UncompressedSize);
40
41Error uncompress(StringRef InputBuffer,
42 SmallVectorImpl<char> &UncompressedBuffer,
43 size_t UncompressedSize);
44
45uint32_t crc32(StringRef Buffer);
46
47} // End of namespace zlib
48
49} // End of namespace llvm
50
51#endif
52