| 4432 | } |
| 4433 | |
| 4434 | void 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=\""; |