fix for dump

This commit is contained in:
john30
2016-06-26 16:35:38 +02:00
parent ae84214711
commit dc4dcdea8d
2 changed files with 2 additions and 8 deletions
+1 -7
View File
@@ -291,9 +291,7 @@ void SingleDataField::dump(ostream& output)
else if (m_partType == pt_slaveData) else if (m_partType == pt_slaveData)
output << "s"; output << "s";
output << FIELD_SEPARATOR; output << FIELD_SEPARATOR;
if (!m_dataType->dump(output, m_length)) { // no divisor appended m_dataType->dump(output, m_length);
output << FIELD_SEPARATOR; // no value list, no divisor
}
dumpString(output, m_unit); dumpString(output, m_unit);
dumpString(output, m_comment); dumpString(output, m_comment);
} }
@@ -536,10 +534,6 @@ void ValueListDataField::dump(ostream& output)
if (!m_dataType->dump(output, m_length)) { // no divisor appended if (!m_dataType->dump(output, m_length)) { // no divisor appended
bool first = true; bool first = true;
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 (first)
first = false;
else
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! } // TODO else does not fit into CSV format!
+1 -1
View File
@@ -194,7 +194,7 @@ public:
/** /**
* Dump the type identifier with the specified length and optionally the * Dump the type identifier with the specified length and optionally the
* divisor to the output. * divisor to the output (@a FIELD_SEPARATOR is always appended!).
* @param output the @a ostream to dump to. * @param output the @a ostream to dump to.
* @param length the number of symbols to read/write. * @param length the number of symbols to read/write.
* @return true when a non-default divisor was written to the output. * @return true when a non-default divisor was written to the output.