| 488 | |
| 489 | |
| 490 | std::string Annotator::pathTo(clang::FileID From, clang::FileID To, std::string *dataProj) |
| 491 | { |
| 492 | std::string &result = pathTo_cache[{From.getHashValue(), To.getHashValue()}]; |
| 493 | if (!result.empty()) { |
| 494 | if (dataProj) { |
| 495 | auto pr_it = project_cache.find(To); |
| 496 | if (pr_it != project_cache.end()) { |
| 497 | if (pr_it->second->type == ProjectInfo::External) { |
| 498 | *dataProj = pr_it->second->name; |
| 499 | } |
| 500 | } |
| 501 | } |
| 502 | return result; |
| 503 | } |
| 504 | |
| 505 | std::string fromFN = htmlNameForFile(From); |
| 506 | std::string toFN = htmlNameForFile(To); |
| 507 | |
| 508 | auto pr_it = project_cache.find(To); |
| 509 | if (pr_it == project_cache.end()) |
| 510 | return result = {}; |
| 511 | |
| 512 | if (pr_it->second->type == ProjectInfo::External) { |
| 513 | generator(From).addProject(pr_it->second->name, pr_it->second->external_root_url); |
| 514 | if (dataProj) { |
| 515 | *dataProj = pr_it->second->name % "\" "; |
| 516 | } |
| 517 | return result = pr_it->second->external_root_url % "/" % toFN % ".html"; |
| 518 | } |
| 519 | |
| 520 | return result = naive_uncomplete(llvm::sys::path::parent_path(fromFN), toFN) + ".html"; |
| 521 | } |
| 522 | |
| 523 | std::string Annotator::pathTo(clang::FileID From, const clang::FileEntry *To) |
| 524 | { |
no test coverage detected