34 #include "../my_config.h"
50 range & operator = (
const range & ref) =
default;
51 range & operator = (
range && ref) noexcept =
default;
54 void operator += (
const range & ref);
55 range operator + (
const range & ref)
const {
range ret = *
this; ret += ref;
return ret; };
56 std::string display()
const;
64 void reset_read()
const { read_cursor = parts.begin(); };
74 void clear() { parts.clear(); };
80 segment(
const infinint & x_low,
const infinint & x_high) { low = x_low; high = x_high; };
82 const infinint & get_low()
const {
return low; };
83 const infinint & get_high()
const {
return high; };
85 bool overlaps_with(
const segment & ref)
const {
return !(ref < *
this) && !(ref > *
this); };
86 void merge_with(
const segment & ref);
89 bool operator < (
const segment & ref)
const {
return high + 1 < ref.low; };
90 bool operator > (
const segment & ref)
const {
return ref < *
this; };
91 bool operator == (
const segment & ref)
const {
return ref.high == high && ref.low == low; };
92 bool operator != (
const segment & ref)
const {
return ! (*
this == ref); };
95 bool operator <= (
const segment & ref)
const {
return ref.low < low && low <= ref.high + 1 && ref.high < high; };
96 bool operator >= (
const segment &ref)
const {
return ref <= *
this; };
97 bool contains(
const segment & ref)
const {
return low <= ref.low && ref.high <= high; };
99 std::string display()
const;
105 std::list<segment> parts;
106 mutable std::list<segment>::const_iterator read_cursor;
the arbitrary large positive integer class
stores a range of integers or a set of ranges
void reset_read() const
provides a way to read range contents segment by segment
bool read_next_segment(infinint &low, infinint &high) const
read the next available segment
switch module to limitint (32 ou 64 bits integers) or infinint
libdar namespace encapsulate all libdar symbols