1
0
mirror of https://github.com/Zygo/bees.git synced 2025-07-01 00:02:27 +02:00

types: add shrink_begin and shrink_end methods for BeesFileRange and BeesRangePair

These allow trimming of overlapping dedupes.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell
2024-11-18 23:57:29 -05:00
parent 05bf1ebf76
commit 97eab9655c
2 changed files with 41 additions and 0 deletions

View File

@ -300,6 +300,11 @@ public:
off_t grow_begin(off_t delta);
/// @}
/// @{ Make range smaller
off_t shrink_end(off_t delta);
off_t shrink_begin(off_t delta);
/// @}
friend ostream & operator<<(ostream &os, const BeesFileRange &bfr);
};
@ -665,6 +670,8 @@ class BeesRangePair : public pair<BeesFileRange, BeesFileRange> {
public:
BeesRangePair(const BeesFileRange &src, const BeesFileRange &dst);
bool grow(shared_ptr<BeesContext> ctx, bool constrained);
void shrink_begin(const off_t delta);
void shrink_end(const off_t delta);
BeesRangePair copy_closed() const;
bool operator<(const BeesRangePair &that) const;
friend ostream & operator<<(ostream &os, const BeesRangePair &brp);