MCPcopy Create free account
hub / github.com/KDE/kdevelop / dumpDotGraphInternal

Method dumpDotGraphInternal

kdevplatform/language/util/setrepository.cpp:323–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323QString SetRepositoryAlgorithms::dumpDotGraphInternal(uint nodeIndex, bool master) const
324{
325 if (!nodeIndex)
326 return QStringLiteral("empty node");
327
328 const SetNodeData& node(*repository.itemFromIndex(nodeIndex));
329
330 QString color = QStringLiteral("blue");
331 if (master)
332 color = QStringLiteral("red");
333
334 QString label = QStringLiteral("%1 -> %2").arg(node.start()).arg(node.end());
335 if (!node.contiguous())
336 label += QLatin1String(", with gaps");
337
338 QString ret = QStringLiteral("%1[label=\"%2\", color=\"%3\"];\n").arg(shortLabel(node), label, color);
339
340 if (node.leftNode()) {
341 const SetNodeData& left(*repository.itemFromIndex(node.leftNode()));
342 const SetNodeData& right(*repository.itemFromIndex(node.rightNode()));
343 Q_ASSERT(node.rightNode());
344 ret += QStringLiteral("%1 -> %2;\n").arg(shortLabel(node), shortLabel(left));
345 ret += QStringLiteral("%1 -> %2;\n").arg(shortLabel(node), shortLabel(right));
346 ret += dumpDotGraphInternal(node.leftNode());
347 ret += dumpDotGraphInternal(node.rightNode());
348 }
349
350 return ret;
351}
352
353QString SetRepositoryAlgorithms::dumpDotGraph(uint nodeIndex) const
354{

Callers

nothing calls this directly

Calls 3

shortLabelFunction · 0.85
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected