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

Method plistData

lib/errorlogger.cpp:854–923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

852}
853
854std::string ErrorLogger::plistData(const ErrorMessage &msg)
855{
856 std::ostringstream plist;
857 plist << " <dict>\r\n"
858 << " <key>path</key>\r\n"
859 << " <array>\r\n";
860
861 auto prev = msg.callStack.cbegin();
862
863 for (auto it = msg.callStack.cbegin(); it != msg.callStack.cend(); ++it) {
864 if (prev != it) {
865 plist << " <dict>\r\n"
866 << " <key>kind</key><string>control</string>\r\n"
867 << " <key>edges</key>\r\n"
868 << " <array>\r\n"
869 << " <dict>\r\n"
870 << " <key>start</key>\r\n"
871 << " <array>\r\n"
872 << plistLoc(" ", *prev)
873 << plistLoc(" ", *prev)
874 << " </array>\r\n"
875 << " <key>end</key>\r\n"
876 << " <array>\r\n"
877 << plistLoc(" ", *it)
878 << plistLoc(" ", *it)
879 << " </array>\r\n"
880 << " </dict>\r\n"
881 << " </array>\r\n"
882 << " </dict>\r\n";
883 prev = it;
884 }
885
886 auto next = it;
887 ++next;
888 const std::string message = (it->getinfo().empty() && next == msg.callStack.cend() ? msg.shortMessage() : it->getinfo());
889
890 plist << " <dict>\r\n"
891 << " <key>kind</key><string>event</string>\r\n"
892 << " <key>location</key>\r\n"
893 << plistLoc(" ", *it)
894 << " <key>ranges</key>\r\n"
895 << " <array>\r\n"
896 << " <array>\r\n"
897 << plistLoc(" ", *it)
898 << plistLoc(" ", *it)
899 << " </array>\r\n"
900 << " </array>\r\n"
901 << " <key>depth</key><integer>0</integer>\r\n"
902 << " <key>extended_message</key>\r\n"
903 << " <string>" << ErrorLogger::toxml(message) << "</string>\r\n"
904 << " <key>message</key>\r\n"
905 << " <string>" << ErrorLogger::toxml(message) << "</string>\r\n"
906 << " </dict>\r\n";
907 }
908
909 plist << " </array>\r\n"
910 << " <key>description</key><string>" << ErrorLogger::toxml(msg.shortMessage()) << "</string>\r\n"
911 << " <key>category</key><string>" << severityToString(msg.severity) << "</string>\r\n"

Callers

nothing calls this directly

Calls 4

plistLocFunction · 0.85
severityToStringFunction · 0.85
emptyMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected