26 virtual void apply(std::span<uint8_t> dst)
const = 0;
38 static inline size_t globalAllocSize = 0;
48 void apply(std::span<uint8_t> dst)
const override;
50 [[nodiscard]]
const uint8_t*
getData();
53 [[nodiscard]]
bool compressed()
const {
return compressedSize != 0; }
56 size_t compressedSize = 0;
64 std::span<const uint8_t> data);
65 void apply(std::span<uint8_t> dst)
const override;
69 const std::shared_ptr<DeltaBlockCopy> prev;
70 const std::vector<uint8_t> delta;
77 [[nodiscard]] std::shared_ptr<DeltaBlock>
createNew(
78 const void*
id, std::span<const uint8_t> data);
80 const void*
id, std::span<const uint8_t> data);
85 Info(
const void* id_,
size_t size_)
86 :
id(id_), size(size_) {}
90 std::weak_ptr<DeltaBlockCopy> ref;
91 std::weak_ptr<DeltaBlock> last;
95 std::vector<Info> infos;
const uint8_t * getData()
void apply(std::span< uint8_t > dst) const override
void compress(size_t size)
void apply(std::span< uint8_t > dst) const override
size_t getDeltaSize() const
virtual void apply(std::span< uint8_t > dst) const =0
virtual ~DeltaBlock()=default
std::shared_ptr< DeltaBlock > createNew(const void *id, std::span< const uint8_t > data)
std::shared_ptr< DeltaBlock > createNullDiff(const void *id, std::span< const uint8_t > data)
This class manages the lifetime of a block of memory.
This class represents the result of a sha1 calculation (a 160-bit value).
This file implemented 3 utility functions: