aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/basetypes/MCRange.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/basetypes/MCRange.h')
-rw-r--r--src/core/basetypes/MCRange.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/basetypes/MCRange.h b/src/core/basetypes/MCRange.h
index 7b8b497d..2687bcab 100644
--- a/src/core/basetypes/MCRange.h
+++ b/src/core/basetypes/MCRange.h
@@ -8,12 +8,24 @@
namespace mailcore {
+ class IndexSet;
+
+ // infinite length : UINT64_MAX
+ // empty range : location = UINT64_MAX
struct Range {
uint64_t location;
uint64_t length;
};
+ extern Range RangeEmpty;
+
Range RangeMake(uint64_t location, uint64_t length);
+ IndexSet * RangeRemoveRange(Range range1, Range range2);
+ IndexSet * RangeUnion(Range range1, Range range2);
+ Range RangeIntersection(Range range1, Range range2);
+ bool RangeHasIntersection(Range range1, Range range2);
+ uint64_t RangeLeftBound(Range range);
+ uint64_t RangeRightBound(Range range);
}
#endif