MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / loadReflection

Function loadReflection

gui/cppchecklibrarydata.cpp:334–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334static CppcheckLibraryData::Reflection loadReflection(QXmlStreamReader &xmlReader)
335{
336 CppcheckLibraryData::Reflection reflection;
337
338 QXmlStreamReader::TokenType type;
339 while ((type = xmlReader.readNext()) != QXmlStreamReader::EndElement ||
340 xmlReader.name().toString() != "reflection") {
341 if (type != QXmlStreamReader::StartElement)
342 continue;
343 const QString elementName = xmlReader.name().toString();
344 if (elementName == "call") {
345 CppcheckLibraryData::Reflection::Call call;
346 if (xmlReader.attributes().hasAttribute("arg")) {
347 call.arg = xmlReader.attributes().value("arg").toInt();
348 } else {
349 mandatoryAttibuteMissing(xmlReader, "arg");
350 }
351 call.name = xmlReader.readElementText();
352 reflection.calls.append(call);
353 } else {
354 unhandledElement(xmlReader);
355 }
356 }
357
358 return reflection;
359}
360
361static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
362{

Callers 1

openMethod · 0.85

Calls 5

mandatoryAttibuteMissingFunction · 0.85
unhandledElementFunction · 0.85
toStringMethod · 0.45
nameMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected