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

Method formatSource

plugins/astyle/astyle_formatter.cpp:50–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50QString AStyleFormatter::formatSource(const QString &text, const QString& leftContext, const QString& rightContext)
51{
52 QString useText = leftContext + text + rightContext;
53
54 AStyleStringIterator is(useText);
55 QString output;
56 QTextStream os(&output, QIODevice::WriteOnly);
57
58 m_engine.init(&is);
59
60 while (m_engine.hasMoreLines())
61 os << QString::fromUtf8(m_engine.nextLine().c_str()) << QLatin1Char('\n');
62
63 m_engine.init(nullptr);
64
65 return extractFormattedTextFromContext(output, text, leftContext, rightContext, m_options[QStringLiteral("FillCount")].toInt());
66}
67
68void AStyleFormatter::updateFormatter()
69{

Callers 10

formatSourceWithStyleMethod · 0.80
renameVariableMethod · 0.80
overrideHelperMethod · 0.80
varTypeAssistantMethod · 0.80
testMacroFormattingMethod · 0.80
testContextMethod · 0.80
testTabIndentationMethod · 0.80
testForeachMethod · 0.80
testPointerAlignmentMethod · 0.80
testKdeFrameworksMethod · 0.80

Calls 5

toIntMethod · 0.80
initMethod · 0.45
hasMoreLinesMethod · 0.45
c_strMethod · 0.45
nextLineMethod · 0.45

Tested by 9

renameVariableMethod · 0.64
overrideHelperMethod · 0.64
varTypeAssistantMethod · 0.64
testMacroFormattingMethod · 0.64
testContextMethod · 0.64
testTabIndentationMethod · 0.64
testForeachMethod · 0.64
testPointerAlignmentMethod · 0.64
testKdeFrameworksMethod · 0.64