From 5b523f96c24ca868731f4fed87bff62af8c78055 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 2 Mar 2016 09:18:19 -0500 Subject: [PATCH] Interval: Implemented ::dump --- src/Interval.cpp | 10 ++++++++++ src/Interval.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/Interval.cpp b/src/Interval.cpp index 42856475..16ae4e6c 100644 --- a/src/Interval.cpp +++ b/src/Interval.cpp @@ -33,6 +33,16 @@ std::string Interval::dump () const { std::stringstream out; + out << "Interval _from '" + << _from.toEpoch () + << "' _to '" + << _to.toEpoch () + << "' _tags"; + + for (const auto& tag : _tags) + out << " '" << tag << "'"; + + out << "\n"; return out.str (); } diff --git a/src/Interval.h b/src/Interval.h index 89c30e94..b988a127 100644 --- a/src/Interval.h +++ b/src/Interval.h @@ -27,7 +27,9 @@ #ifndef INCLUDED_INTERVAL #define INCLUDED_INTERVAL +#include #include +#include class Interval { @@ -36,6 +38,9 @@ public: std::string dump () const; private: + Datetime _from {0}; + Datetime _to {0}; + std::vector _tags {}; }; #endif