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

Method printXml

lib/symboldatabase.cpp:4434–4664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4432}
4433
4434void SymbolDatabase::printXml(std::ostream &out) const
4435{
4436 std::string outs;
4437
4438 std::set<const Variable *> variables;
4439
4440 // Scopes..
4441 outs += " <scopes>\n";
4442 for (auto scope = scopeList.cbegin(); scope != scopeList.cend(); ++scope) {
4443 outs += " <scope";
4444 outs += " id=\"";
4445 outs += id_string(&*scope);
4446 outs += "\"";
4447 outs += " type=\"";
4448 outs += scopeTypeToString(scope->type);
4449 outs += "\"";
4450 if (!scope->className.empty()) {
4451 outs += " className=\"";
4452 outs += ErrorLogger::toxml(scope->className);
4453 outs += "\"";
4454 }
4455 if (scope->bodyStart) {
4456 outs += " bodyStart=\"";
4457 outs += id_string(scope->bodyStart);
4458 outs += '\"';
4459 }
4460 if (scope->bodyEnd) {
4461 outs += " bodyEnd=\"";
4462 outs += id_string(scope->bodyEnd);
4463 outs += '\"';
4464 }
4465 if (scope->nestedIn) {
4466 outs += " nestedIn=\"";
4467 outs += id_string(scope->nestedIn);
4468 outs += "\"";
4469 }
4470 if (scope->function) {
4471 outs += " function=\"";
4472 outs += id_string(scope->function);
4473 outs += "\"";
4474 }
4475 if (scope->definedType) {
4476 outs += " definedType=\"";
4477 outs += id_string(scope->definedType);
4478 outs += "\"";
4479 }
4480 if (scope->functionList.empty() && scope->varlist.empty())
4481 outs += "/>\n";
4482 else {
4483 outs += ">\n";
4484 if (!scope->functionList.empty()) {
4485 outs += " <functionList>\n";
4486 for (auto function = scope->functionList.cbegin(); function != scope->functionList.cend(); ++function) {
4487 outs += " <function id=\"";
4488 outs += id_string(&*function);
4489 outs += "\" token=\"";
4490 outs += id_string(function->token);
4491 outs += "\" tokenDef=\"";

Callers 3

printDebugOutputMethod · 0.80
dumpMethod · 0.80
dumpFriendMethod · 0.80

Calls 15

id_stringFunction · 0.85
scopeTypeToStringFunction · 0.85
functionTypeToStringFunction · 0.85
accessControlToStringFunction · 0.85
bool_to_stringFunction · 0.85
isFriendMethod · 0.80
getOverriddenFunctionMethod · 0.80
getArgumentVarMethod · 0.80
scopeMethod · 0.80
isArrayMethod · 0.80
isClassMethod · 0.80
isConstMethod · 0.80

Tested by 1

dumpFriendMethod · 0.64