mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Timeline: Added ::dump for debugging
This commit is contained in:
parent
23c7e420b5
commit
2c329374e4
2 changed files with 17 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <cmake.h>
|
||||
#include <Timeline.h>
|
||||
#include <sstream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// The Timeline object represents a continuum with a defined start and end
|
||||
|
@ -94,3 +95,17 @@ std::vector <Interval> Timeline::untracked (Rules& rules) const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Timeline::dump () const
|
||||
{
|
||||
std::stringstream out;
|
||||
|
||||
out << "Timeline _range " << _range.dump ();
|
||||
for (auto& i : _inclusions)
|
||||
out << " " << i.dump ();
|
||||
for (auto& e : _exclusions)
|
||||
out << " " << e.dump ();
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
std::vector <Interval> tracked (Rules&) const;
|
||||
std::vector <Interval> untracked (Rules&) const;
|
||||
|
||||
std::string dump () const;
|
||||
|
||||
private:
|
||||
Interval _range {};
|
||||
std::vector <Interval> _inclusions {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue