Skip to content

Commit

Permalink
Minor formatting tweaks to match the rest of the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewman committed Dec 3, 2023
1 parent 2a2ab67 commit 92760e5
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions common/messaging/MessagePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,44 +45,44 @@ string MessagePrinter::AsString(const Message *message) {


void GenericMessagePrinter::Visit(const BoolMessageField *message) {
Stream() << string(m_indent, ' ') <<
TransformLabel(message->GetDescriptor()->Name()) << ": "
<< (message->Value() ? "true" : "false") << endl;
Stream() << string(m_indent, ' ')
<< TransformLabel(message->GetDescriptor()->Name()) << ": "
<< (message->Value() ? "true" : "false") << endl;
}


void GenericMessagePrinter::Visit(const IPV4MessageField *message) {
Stream() << string(m_indent, ' ') <<
TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value() << endl;
Stream() << string(m_indent, ' ')
<< TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value() << endl;
}


void GenericMessagePrinter::Visit(const IPV6MessageField *message) {
Stream() << string(m_indent, ' ') <<
TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value() << endl;
Stream() << string(m_indent, ' ')
<< TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value() << endl;
}


void GenericMessagePrinter::Visit(const MACMessageField *message) {
Stream() << string(m_indent, ' ') <<
TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value().ToString() << endl;
Stream() << string(m_indent, ' ')
<< TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value().ToString() << endl;
}


void GenericMessagePrinter::Visit(const UIDMessageField *message) {
Stream() << string(m_indent, ' ') <<
TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value().ToString() << endl;
Stream() << string(m_indent, ' ')
<< TransformLabel(message->GetDescriptor()->Name()) << ": "
<< message->Value().ToString() << endl;
}


void GenericMessagePrinter::Visit(const StringMessageField *message) {
Stream() << string(m_indent, ' ') <<
TransformLabel(message->GetDescriptor()->Name()) << ": "
<< EncodeString(message->Value()) << endl;
Stream() << string(m_indent, ' ')
<< TransformLabel(message->GetDescriptor()->Name()) << ": "
<< EncodeString(message->Value()) << endl;
}


Expand Down Expand Up @@ -141,8 +141,8 @@ void GenericMessagePrinter::Visit(const BasicMessageField<int32_t> *message) {


void GenericMessagePrinter::Visit(const GroupMessageField *message) {
Stream() << string(m_indent, ' ') <<
TransformLabel(message->GetDescriptor()->Name()) << " {" << endl;
Stream() << string(m_indent, ' ')
<< TransformLabel(message->GetDescriptor()->Name()) << " {" << endl;
m_indent += m_indent_size;
}

Expand Down Expand Up @@ -185,8 +185,9 @@ void GenericMessagePrinter::AppendInt(const string &name,


void GenericMessagePrinter::AppendMultiplier(int8_t multiplier) {
if (multiplier)
if (multiplier) {
Stream() << " x 10 ^ " << static_cast<int>(multiplier);
}
}
} // namespace messaging
} // namespace ola

0 comments on commit 92760e5

Please sign in to comment.