27 if (
object.m_Guid.has_value())
34 if (!
object.m_Measurements.empty() || !
object.m_Children.empty())
51 m_OutputStream << std::quoted(
"Graph") <<
":[";
55 for (std::string stringLine :
object.m_LayerDetailsList)
58 m_OutputStream << stringLine;
64 object.IsDetailsOnlyEnabled() ? m_OutputStream <<
"]" : m_OutputStream <<
"],";
69 if (!
object.m_Children.empty())
71 for (
unsigned int childIndex = 0; childIndex <
object.m_Children.size(); ++childIndex)
75 if (&
object.m_Children[childIndex] != &
object.m_Children.back())
89 std::string JsonPrinter::MakeKey(
const std::string& label,
size_t id)
92 ss << label << std::string(
"_#") << id;
99 m_OutputStream << R
"(")" << MakeKey(label, id) << R
"(": {)" << std::endl;
106 m_OutputStream << R
"("unit": ")";
108 m_OutputStream << R"(")";
119 return "Measurement";
127 return "Operator Description";
136 m_OutputStream << R
"("type": ")";
137 m_OutputStream << ToString(type);
138 m_OutputStream << R"(")";
144 m_OutputStream << std::quoted(
"GUID") <<
": " << std::quoted(std::to_string(guid)) <<
"," << std::endl;
149 if (measurementsVector.empty())
155 m_OutputStream << R
"("raw": [)" << std::endl;
158 auto iter = measurementsVector.begin();
159 m_OutputStream << *iter;
160 for (iter = std::next(iter); iter != measurementsVector.end(); ++iter)
162 m_OutputStream <<
"," << std::endl;
164 m_OutputStream << *iter;
166 m_OutputStream << std::endl;
169 m_OutputStream <<
"]";