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

Function parameterListString

plugins/clang/duchain/macronavigationcontext.cpp:33–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static QString parameterListString(const MacroDefinition& macro)
34{
35 // A function-like macro can have 0 parameters, e.g. `#define m() 1`.
36 // Check isFunctionLike() rather than parametersSize() here in order to display "()" in this case.
37 if (!macro.isFunctionLike()) {
38 Q_ASSERT(macro.parametersSize() == 0);
39 return QString();
40 }
41
42 QStringList parameterList;
43 parameterList.reserve(macro.parametersSize());
44 FOREACH_FUNCTION (const auto& parameter, macro.parameters) {
45 parameterList << parameter.str();
46 }
47
48 return QLatin1Char('(') + parameterList.join(QLatin1String(", ")) + QLatin1Char(')');
49}
50
51QString MacroNavigationContext::html(bool shorten)
52{

Callers 1

htmlMethod · 0.85

Calls 5

isFunctionLikeMethod · 0.80
parametersSizeMethod · 0.80
joinMethod · 0.80
QStringClass · 0.50
reserveMethod · 0.45

Tested by

no test coverage detected