summaryrefslogtreecommitdiffstats
path: root/tests/hawd/dataset.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hawd/dataset.cpp')
-rw-r--r--tests/hawd/dataset.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/hawd/dataset.cpp b/tests/hawd/dataset.cpp
index 9211430..f6a0e4c 100644
--- a/tests/hawd/dataset.cpp
+++ b/tests/hawd/dataset.cpp
@@ -27,6 +27,8 @@
27namespace HAWD 27namespace HAWD
28{ 28{
29 29
30static const QString s_annotationKey("__annotation__");
31
30Dataset::Row::Row(const Row &other) 32Dataset::Row::Row(const Row &other)
31 : m_key(other.m_key), 33 : m_key(other.m_key),
32 m_columns(other.m_columns), 34 m_columns(other.m_columns),
@@ -88,7 +90,11 @@ void Dataset::Row::fromBinary(QByteArray &data)
88 90
89 while (!stream.atEnd()) { 91 while (!stream.atEnd()) {
90 stream >> key >> value; 92 stream >> key >> value;
91 setValue(key, value); 93 if (key == s_annotationKey) {
94 m_annotation = value.toString();
95 } else {
96 setValue(key, value);
97 }
92 } 98 }
93} 99}
94 100
@@ -102,6 +108,9 @@ QByteArray Dataset::Row::toBinary() const
102 stream << it.key() << it.value(); 108 stream << it.key() << it.value();
103 } 109 }
104 110
111 if (!m_annotation.isEmpty()) {
112 stream << s_annotationKey << m_annotation;
113 }
105 return data; 114 return data;
106} 115}
107 116