mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
4a2cd259e3
Add the GzipTarFileWriter and GzipTarReader classes that allow reading a slightly custom `.tar.gz`.
27 lines
839 B
C
27 lines
839 B
C
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
void gzipCompress(llvm::raw_ostream &OS,
|
|
llvm::ArrayRef<uint8_t> Buffer,
|
|
int CompressionLevel = 3);
|
|
|
|
inline void gzipCompress(llvm::raw_ostream &OS, llvm::ArrayRef<char> Buffer) {
|
|
return gzipCompress(OS,
|
|
{ reinterpret_cast<const uint8_t *>(Buffer.data()),
|
|
Buffer.size() });
|
|
}
|
|
|
|
void gzipDecompress(llvm::raw_ostream &OS, llvm::ArrayRef<uint8_t> Buffer);
|
|
|
|
inline void gzipDecompress(llvm::raw_ostream &OS, llvm::ArrayRef<char> Buffer) {
|
|
return gzipDecompress(OS,
|
|
{ reinterpret_cast<const uint8_t *>(Buffer.data()),
|
|
Buffer.size() });
|
|
}
|