timerange: added debug output functions for the TimeRange and TimeRangeList classes

This commit is contained in:
itsmattkc
2020-04-06 17:08:13 +10:00
parent 8cbac84c96
commit 4a8a44a8b1
2 changed files with 20 additions and 0 deletions
+15
View File
@@ -195,9 +195,24 @@ TimeRangeList TimeRangeList::Intersects(const TimeRange &range)
return intersect_list;
}
void TimeRangeList::PrintTimeList()
{
qDebug() << "TimeRangeList now contains:";
for (int i=0;i<size();i++) {
qDebug() << " " << at(i);
}
}
uint qHash(const TimeRange &r, uint seed)
{
return qHash(r.in(), seed) ^ qHash(r.out(), seed);
}
OLIVE_NAMESPACE_EXIT
QDebug operator<<(QDebug debug, const OLIVE_NAMESPACE::TimeRange &r)
{
debug.nospace() << r.in() << " - " << r.out();
return debug.space();
}
+5
View File
@@ -68,12 +68,17 @@ public:
TimeRangeList Intersects(const TimeRange& range);
private:
void PrintTimeList();
};
uint qHash(const TimeRange& r, uint seed);
OLIVE_NAMESPACE_EXIT
QDebug operator<<(QDebug debug, const OLIVE_NAMESPACE::TimeRange& r);
Q_DECLARE_METATYPE(OLIVE_NAMESPACE::TimeRange)
#endif // TIMERANGE_H