move helper method to SymbolString
This commit is contained in:
@@ -935,20 +935,6 @@ void Message::dumpField(const string& fieldName, bool withConditions, OutputForm
|
||||
dumpAttribute(false, outputFormat, fieldName, output);
|
||||
}
|
||||
|
||||
void addData(const SymbolString& data, ostringstream* output) {
|
||||
if (data.size() == 0) {
|
||||
return;
|
||||
}
|
||||
*output << ",\n \"" << (data.isMaster() ? "master" : "slave") << "\": [";
|
||||
for (size_t pos = 0; pos < data.size(); pos++) {
|
||||
if (pos > 0) {
|
||||
*output << ", ";
|
||||
}
|
||||
*output << dec << static_cast<unsigned>(data[pos]);
|
||||
}
|
||||
*output << "]";
|
||||
}
|
||||
|
||||
void Message::decodeJson(bool leadingSeparator, bool appendDirectionCondition, bool withData, bool addRaw,
|
||||
OutputFormat outputFormat, ostringstream* output) const {
|
||||
outputFormat |= OF_JSON;
|
||||
@@ -1005,8 +991,8 @@ void Message::decodeJson(bool leadingSeparator, bool appendDirectionCondition, b
|
||||
appendAttributes(outputFormat, output);
|
||||
if (hasData) {
|
||||
if (addRaw) {
|
||||
addData(m_lastMasterData, output);
|
||||
addData(m_lastSlaveData, output);
|
||||
m_lastMasterData.dumpJson(true, output);
|
||||
m_lastSlaveData.dumpJson(true, output);
|
||||
*output << dec;
|
||||
}
|
||||
size_t pos = (size_t)output->tellp();
|
||||
|
||||
Reference in New Issue
Block a user