From 49400da50b9095ea8b935135877ed76163552c7f Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 10 Dec 2014 08:49:30 +0100 Subject: add printing features and stub in hashes --- tests/hawd/dataset.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tests/hawd/dataset.h') diff --git a/tests/hawd/dataset.h b/tests/hawd/dataset.h index eb18b70..f23d67c 100644 --- a/tests/hawd/dataset.h +++ b/tests/hawd/dataset.h @@ -36,6 +36,12 @@ public: class Row { public: + enum StandardCols { + Annotation, + CommitHash, + Timestamp, + All = Annotation | CommitHash | Timestamp + }; Row(const Row &other); Row &operator=(const Row &rhs); void setValue(const QString &column, const QVariant &value); @@ -43,7 +49,7 @@ public: void annotate(const QString ¬e); qint64 key() const; QByteArray toBinary() const; - QString toString() const; + QString toString(const QStringList &cols = QStringList(), int standardCols = All, const QString &seperator = "\t") const; private: Row(); @@ -54,6 +60,7 @@ public: QHash m_columns; QHash m_data; QString m_annotation; + QString m_hash; const Dataset *m_dataset; friend class Dataset; }; @@ -62,11 +69,13 @@ public: Dataset(const QString &name, const State &state); ~Dataset(); - bool isValid(); + bool isValid() const; const DatasetDefinition &definition() const; + QString tableHeaders(const QStringList &cols = QStringList(), int standardCols = Row::All, const QString &seperator = "\t") const; qint64 insertRow(const Row &row); void removeRow(const Row &row); + void eachRow(const std::function &resultHandler); Row row(qint64 key = 0); Row lastRow(); //TODO: row cursor -- cgit v1.2.3