#include "components/zucchini/patch_writer.h"
#include <algorithm>
#include <iterator>
#include "base/numerics/checked_math.h"
#include "base/numerics/safe_conversions.h"
#include "components/zucchini/crc32.h"
#include "components/zucchini/element_detection.h"
#include "components/zucchini/version_info.h"
namespace zucchini {
namespace patch {
bool SerializeElementMatch(const ElementMatch& element_match,
BufferSink* sink) { … }
size_t SerializedElementMatchSize(const ElementMatch& element_match) { … }
bool SerializeBuffer(const std::vector<uint8_t>& buffer, BufferSink* sink) { … }
size_t SerializedBufferSize(const std::vector<uint8_t>& buffer) { … }
}
EquivalenceSink::EquivalenceSink() = default;
EquivalenceSink::EquivalenceSink(const std::vector<uint8_t>& src_skip,
const std::vector<uint8_t>& dst_skip,
const std::vector<uint8_t>& copy_count)
: … { … }
EquivalenceSink::EquivalenceSink(EquivalenceSink&&) = default;
EquivalenceSink::~EquivalenceSink() = default;
void EquivalenceSink::PutNext(const Equivalence& equivalence) { … }
size_t EquivalenceSink::SerializedSize() const { … }
bool EquivalenceSink::SerializeInto(BufferSink* sink) const { … }
ExtraDataSink::ExtraDataSink() = default;
ExtraDataSink::ExtraDataSink(const std::vector<uint8_t>& extra_data)
: … { … }
ExtraDataSink::ExtraDataSink(ExtraDataSink&&) = default;
ExtraDataSink::~ExtraDataSink() = default;
void ExtraDataSink::PutNext(ConstBufferView region) { … }
size_t ExtraDataSink::SerializedSize() const { … }
bool ExtraDataSink::SerializeInto(BufferSink* sink) const { … }
RawDeltaSink::RawDeltaSink() = default;
RawDeltaSink::RawDeltaSink(const std::vector<uint8_t>& raw_delta_skip,
const std::vector<uint8_t>& raw_delta_diff)
: … { … }
RawDeltaSink::RawDeltaSink(RawDeltaSink&&) = default;
RawDeltaSink::~RawDeltaSink() = default;
void RawDeltaSink::PutNext(const RawDeltaUnit& delta) { … }
size_t RawDeltaSink::SerializedSize() const { … }
bool RawDeltaSink::SerializeInto(BufferSink* sink) const { … }
ReferenceDeltaSink::ReferenceDeltaSink() = default;
ReferenceDeltaSink::ReferenceDeltaSink(
const std::vector<uint8_t>& reference_delta)
: … { … }
ReferenceDeltaSink::ReferenceDeltaSink(ReferenceDeltaSink&&) = default;
ReferenceDeltaSink::~ReferenceDeltaSink() = default;
void ReferenceDeltaSink::PutNext(int32_t diff) { … }
size_t ReferenceDeltaSink::SerializedSize() const { … }
bool ReferenceDeltaSink::SerializeInto(BufferSink* sink) const { … }
TargetSink::TargetSink() = default;
TargetSink::TargetSink(const std::vector<uint8_t>& extra_targets)
: … { … }
TargetSink::TargetSink(TargetSink&&) = default;
TargetSink::~TargetSink() = default;
void TargetSink::PutNext(uint32_t target) { … }
size_t TargetSink::SerializedSize() const { … }
bool TargetSink::SerializeInto(BufferSink* sink) const { … }
PatchElementWriter::PatchElementWriter() = default;
PatchElementWriter::PatchElementWriter(ElementMatch element_match)
: … { … }
PatchElementWriter::PatchElementWriter(PatchElementWriter&&) = default;
PatchElementWriter::~PatchElementWriter() = default;
size_t PatchElementWriter::SerializedSize() const { … }
bool PatchElementWriter::SerializeInto(BufferSink* sink) const { … }
EnsemblePatchWriter::~EnsemblePatchWriter() = default;
EnsemblePatchWriter::EnsemblePatchWriter(const PatchHeader& header)
: … { … }
EnsemblePatchWriter::EnsemblePatchWriter(ConstBufferView old_image,
ConstBufferView new_image) { … }
void EnsemblePatchWriter::AddElement(PatchElementWriter&& patch_element) { … }
size_t EnsemblePatchWriter::SerializedSize() const { … }
bool EnsemblePatchWriter::SerializeInto(BufferSink* sink) const { … }
}