From 8952f17e278088be95094ddb8e81a09131c9154b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 10 Oct 2017 17:16:49 +0200 Subject: hawd json output module --- tests/hawd/dataset.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'tests/hawd/dataset.cpp') diff --git a/tests/hawd/dataset.cpp b/tests/hawd/dataset.cpp index fb2d7e6..62fa0d7 100644 --- a/tests/hawd/dataset.cpp +++ b/tests/hawd/dataset.cpp @@ -77,6 +77,11 @@ void Dataset::Row::setValue(const QString &col, const QVariant &value) } } +QVariant Dataset::Row::value(const QString &col) const +{ + return m_data.value(col); +} + void Dataset::Row::annotate(const QString ¬e) { m_annotation = note; @@ -176,6 +181,19 @@ QString Dataset::tableHeaders(const QStringList &cols, int standardCols, const Q return strings.join(seperator); } + +QString Dataset::Row::commitHash() const +{ + return m_commitHash; +} + +QDateTime Dataset::Row::timestamp() const +{ + QDateTime dt; + dt.setMSecsSinceEpoch(m_key); + return dt; +} + QString Dataset::Row::toString(const QStringList &cols, int standardCols, const QString &seperator) const { if (m_data.isEmpty()) { @@ -185,9 +203,7 @@ QString Dataset::Row::toString(const QStringList &cols, int standardCols, const QStringList strings; if (standardCols & Timestamp) { - QDateTime dt; - dt.setMSecsSinceEpoch(m_key); - strings << dt.toString("yyMMdd:hhmmss").leftJustified(s_fieldWidth, ' '); + strings << timestamp().toString("yyMMdd:hhmmss").leftJustified(s_fieldWidth, ' '); } if (standardCols & CommitHash) { -- cgit v1.2.3