MCPcopy Create free account
hub / github.com/KDAB/codebrowser / pathTo

Method pathTo

generator/annotator.cpp:490–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488
489
490std::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
523std::string Annotator::pathTo(clang::FileID From, const clang::FileEntry *To)
524{

Callers 4

MacroExpandsMethod · 0.80
MacroUndefinedMethod · 0.80
InclusionDirectiveMethod · 0.80
DefinedMethod · 0.80

Calls 5

naive_uncompleteFunction · 0.85
canonicalizeFunction · 0.85
projectForFileMethod · 0.80
addProjectMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected