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

Function writeContainerFunctions

gui/cppchecklibrarydata.cpp:518–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518static void writeContainerFunctions(QXmlStreamWriter &xmlWriter, const QString &name, int extra, const QList<CppcheckLibraryData::Container::Function> &functions)
519{
520 if (functions.isEmpty() && extra < 0)
521 return;
522 xmlWriter.writeStartElement(name);
523 if (extra >= 0) {
524 if (name == "access")
525 xmlWriter.writeAttribute("indexOperator", "array-like");
526 else if (name == "size")
527 xmlWriter.writeAttribute("templateParameter", QString::number(extra));
528 }
529 for (const CppcheckLibraryData::Container::Function &function : functions) {
530 xmlWriter.writeStartElement("function");
531 xmlWriter.writeAttribute("name", function.name);
532 if (!function.action.isEmpty())
533 xmlWriter.writeAttribute("action", function.action);
534 if (!function.yields.isEmpty())
535 xmlWriter.writeAttribute("yields", function.yields);
536 xmlWriter.writeEndElement();
537 }
538 xmlWriter.writeEndElement();
539}
540
541static void writeContainerRangeItemRecords(QXmlStreamWriter &xmlWriter, const QList<CppcheckLibraryData::Container::RangeItemRecordType> &rangeItemRecords)
542{

Callers 1

writeContainerFunction · 0.85

Calls 1

isEmptyMethod · 0.80

Tested by

no test coverage detected