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

Method toString

gui/cppchecklibrarydata.cpp:862–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862QString CppcheckLibraryData::toString() const
863{
864 QString outputString;
865 QXmlStreamWriter xmlWriter(&outputString);
866 xmlWriter.setAutoFormatting(true);
867 xmlWriter.setAutoFormattingIndent(2);
868 xmlWriter.writeStartDocument("1.0");
869 xmlWriter.writeStartElement("def");
870 xmlWriter.writeAttribute("format","2");
871
872 for (const Define &define : defines) {
873 xmlWriter.writeStartElement("define");
874 xmlWriter.writeAttribute("name", define.name);
875 xmlWriter.writeAttribute("value", define.value);
876 xmlWriter.writeEndElement();
877 }
878
879 for (const QString &undef : undefines) {
880 xmlWriter.writeStartElement("undefine");
881 xmlWriter.writeAttribute("name", undef);
882 xmlWriter.writeEndElement();
883 }
884
885 for (const Function &function : functions) {
886 writeFunction(xmlWriter, function);
887 }
888
889 for (const MemoryResource &mr : memoryresource) {
890 writeMemoryResource(xmlWriter, mr);
891 }
892
893 for (const Container &container : containers) {
894 writeContainer(xmlWriter, container);
895 }
896
897 for (const PodType &podtype : podtypes) {
898 xmlWriter.writeStartElement("podtype");
899 xmlWriter.writeAttribute("name", podtype.name);
900 if (!podtype.stdtype.isEmpty())
901 xmlWriter.writeAttribute("stdtype", podtype.stdtype);
902 if (!podtype.sign.isEmpty())
903 xmlWriter.writeAttribute("sign", podtype.sign);
904 if (!podtype.size.isEmpty())
905 xmlWriter.writeAttribute("size", podtype.size);
906 xmlWriter.writeEndElement();
907 }
908
909 for (const TypeChecks &check : typeChecks) {
910 writeTypeChecks(xmlWriter, check);
911 }
912
913 for (const SmartPointer &smartPtr : smartPointers) {
914 xmlWriter.writeStartElement("smart-pointer");
915 xmlWriter.writeAttribute("class-name", smartPtr.name);
916 if (smartPtr.unique) {
917 xmlWriter.writeEmptyElement("unique");
918 }
919 xmlWriter.writeEndElement();

Callers 15

unhandledElementFunction · 0.45
mandatoryAttibuteMissingFunction · 0.45
loadContainerFunction · 0.45
loadDefineFunction · 0.45
loadUndefineFunction · 0.45
loadSmartPointerFunction · 0.45
loadTypeChecksFunction · 0.45
loadFunctionArgFunction · 0.45
loadFunctionFunction · 0.45
loadMemoryResourceFunction · 0.45
loadPodTypeFunction · 0.45
loadPlatformTypeFunction · 0.45

Calls 8

writeFunctionFunction · 0.85
writeMemoryResourceFunction · 0.85
writeContainerFunction · 0.85
writeTypeChecksFunction · 0.85
writePlatformTypeFunction · 0.85
writeReflectionFunction · 0.85
writeMarkupFunction · 0.85
isEmptyMethod · 0.80

Tested by

no test coverage detected