From e760adfc16ff9b3482f4d51cf3662698d9060354 Mon Sep 17 00:00:00 2001 From: sisong Date: Tue, 9 Jan 2024 16:58:28 +0800 Subject: [PATCH] resave_single_compressed_diff() return new out_diff curPos; --- libHDiffPatch/HDiff/diff.cpp | 4 +++- libHDiffPatch/HDiff/diff.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libHDiffPatch/HDiff/diff.cpp b/libHDiffPatch/HDiff/diff.cpp index a4c50bab..2572a748 100644 --- a/libHDiffPatch/HDiff/diff.cpp +++ b/libHDiffPatch/HDiff/diff.cpp @@ -1400,7 +1400,8 @@ void resave_compressed_diff(const hpatch_TStreamInput* in_diff, } -void resave_single_compressed_diff(const hpatch_TStreamInput* in_diff, +hpatch_StreamPos_t + resave_single_compressed_diff(const hpatch_TStreamInput* in_diff, hpatch_TDecompress* decompressPlugin, const hpatch_TStreamOutput* out_diff, const hdiff_TCompress* compressPlugin, @@ -1439,6 +1440,7 @@ void resave_single_compressed_diff(const hpatch_TStreamInput* in_diff, TPlaceholder compressedSize_pos=outDiff.packUInt_pos(compressPlugin?diffInfo->uncompressedSize:0); outDiff.pushStream(&clip,compressPlugin,compressedSize_pos); } + return outDiff.getWritedPos(); } diff --git a/libHDiffPatch/HDiff/diff.h b/libHDiffPatch/HDiff/diff.h index 20caa606..fd3dae02 100644 --- a/libHDiffPatch/HDiff/diff.h +++ b/libHDiffPatch/HDiff/diff.h @@ -166,7 +166,9 @@ bool check_single_compressed_diff(const hpatch_TStreamInput* newData, //resave single_compressed_diff // decompress in_diff and recompress to out_diff // throw std::runtime_error when input file error or I/O error,etc. -void resave_single_compressed_diff(const hpatch_TStreamInput* in_diff, +// return new out_diff curPos +hpatch_StreamPos_t + resave_single_compressed_diff(const hpatch_TStreamInput* in_diff, hpatch_TDecompress* decompressPlugin, const hpatch_TStreamOutput* out_diff, const hdiff_TCompress* compressPlugin,