mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
dfb9a36bb2
Implement compression of objects before they are saved into the storage provider. Each container type can specify which algorithm to use (currently `none` or `zstd`) and the compression level.
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "revng/PipeboxCommon/RawContainer.h"
|
|
|
|
namespace revng::pypeline {
|
|
|
|
class PTMLCBytesContainer : public BytesContainer {
|
|
public:
|
|
static constexpr llvm::StringRef Name = "PTMLCBytesContainer";
|
|
static constexpr llvm::StringRef MimeType = "text/x.c+ptml";
|
|
static constexpr llvm::StringRef Compression = "zstd;level=2";
|
|
};
|
|
|
|
class PTMLCFunctionBytesContainer : public FunctionToBytesContainer {
|
|
public:
|
|
static constexpr llvm::StringRef Name = "PTMLCFunctionBytesContainer";
|
|
static constexpr llvm::StringRef MimeType = "text/x.c+ptml";
|
|
static constexpr llvm::StringRef Compression = "zstd;level=1";
|
|
};
|
|
|
|
class PTMLCTypeBytesContainer : public TypeDefinitionToBytesContainer {
|
|
public:
|
|
static constexpr llvm::StringRef Name = "PTMLCTypeBytesContainer";
|
|
static constexpr llvm::StringRef MimeType = "text/x.c+ptml";
|
|
static constexpr llvm::StringRef Compression = "zstd;level=-1";
|
|
};
|
|
|
|
class RecompilableArchiveContainer : public BytesContainer {
|
|
public:
|
|
static constexpr llvm::StringRef Name = "RecompilableArchiveContainer";
|
|
static constexpr llvm::StringRef MimeType = "application/x-object";
|
|
static constexpr llvm::StringRef Compression = "none";
|
|
};
|
|
|
|
} // namespace revng::pypeline
|