corrected dumping of value lists

This commit is contained in:
john30
2016-10-08 19:50:07 +02:00
parent bb19e57bea
commit 0c0ea8e967
+4 -1
View File
@@ -552,9 +552,12 @@ void ValueListDataField::dump(ostream& output)
output << FIELD_SEPARATOR; output << FIELD_SEPARATOR;
if (!m_dataType->dump(output, m_length)) { // no divisor appended if (!m_dataType->dump(output, m_length)) { // no divisor appended
for (map<unsigned int, string>::iterator it = m_values.begin(); it != m_values.end(); it++) { for (map<unsigned int, string>::iterator it = m_values.begin(); it != m_values.end(); it++) {
if (it != m_values.begin()) {
output << VALUE_SEPARATOR;
}
output << static_cast<unsigned>(it->first) << "=" << it->second; output << static_cast<unsigned>(it->first) << "=" << it->second;
} }
} // TODO else does not fit into CSV format! } // else: impossible since divisor is not allowed for ValueListDataField
dumpString(output, m_unit); dumpString(output, m_unit);
dumpString(output, m_comment); dumpString(output, m_comment);
} }