31#include "iceberg/iceberg_data_export.h"
33#include "iceberg/result.h"
35namespace iceberg::puffin {
40 static constexpr std::array<uint8_t, 4> kMagicV1 = {0x50, 0x46, 0x41, 0x31};
42 static constexpr int32_t kMagicLength = 4;
43 static constexpr int32_t kFooterStartMagicOffset = 0;
44 static constexpr int32_t kFooterStartMagicLength = kMagicLength;
45 static constexpr int32_t kFooterStructPayloadSizeOffset = 0;
46 static constexpr int32_t kFooterStructFlagsOffset = kFooterStructPayloadSizeOffset + 4;
47 static constexpr int32_t kFooterStructFlagsLength = 4;
48 static constexpr int32_t kFooterStructMagicOffset =
49 kFooterStructFlagsOffset + kFooterStructFlagsLength;
52 static constexpr int32_t kFooterStructLength = kFooterStructMagicOffset + kMagicLength;
56 PuffinCompressionCodec::kLz4;
66ICEBERG_DATA_EXPORT
bool IsFlagSet(std::span<const uint8_t, 4> flags, PuffinFlag flag);
69ICEBERG_DATA_EXPORT
void SetFlag(std::span<uint8_t, 4> flags, PuffinFlag flag);
72ICEBERG_DATA_EXPORT Result<std::vector<std::byte>> Compress(
73 PuffinCompressionCodec codec, std::span<const std::byte> input);
76ICEBERG_DATA_EXPORT Result<std::vector<std::byte>> Decompress(
77 PuffinCompressionCodec codec, std::span<const std::byte> input);