timerange: added some helper functions for comparing timeranges and rationals

This commit is contained in:
itsmattkc
2020-06-05 04:30:59 +10:00
parent cb0d89c09e
commit 8051a42fcc
2 changed files with 35 additions and 13 deletions
+4 -3
View File
@@ -43,9 +43,12 @@ public:
bool OverlapsWith(const TimeRange& a, bool in_inclusive = true, bool out_inclusive = true) const;
bool Contains(const TimeRange& a, bool in_inclusive = true, bool out_inclusive = true) const;
bool Contains(const rational& r) const;
TimeRange CombineWith(const TimeRange& a) const;
TimeRange Combined(const TimeRange& a) const;
static TimeRange Combine(const TimeRange &a, const TimeRange &b);
TimeRange Intersected(const TimeRange& a) const;
static TimeRange Intersect(const TimeRange &a, const TimeRange &b);
TimeRange operator+(const rational& rhs) const;
TimeRange operator-(const rational& rhs) const;
@@ -75,8 +78,6 @@ public:
void RemoveTimeRange(const TimeRange& remove);
static void RemoveTimeRange(QList<TimeRange>* list, const TimeRange& remove);
bool ContainsTimeRange(const TimeRange& range, bool in_inclusive = true, bool out_inclusive = true) const;
TimeRangeList Intersects(const TimeRange& range) const;