MCPcopy Create free account
hub / github.com/Kitware/CMake / DumpDirectoryObject

Method DumpDirectoryObject

Source/cmFileAPICodemodel.cxx:836–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

834}
835
836Json::Value CodemodelConfig::DumpDirectoryObject(Directory& d)
837{
838 std::string prefix = "directory";
839 std::string sourceDirRel = RelativeIfUnder(
840 this->TopSource, d.Snapshot.GetDirectory().GetCurrentSource());
841 std::string buildDirRel = RelativeIfUnder(
842 this->TopBuild, d.Snapshot.GetDirectory().GetCurrentBinary());
843 if (!cmSystemTools::FileIsFullPath(buildDirRel)) {
844 prefix = cmStrCat(prefix, '-', buildDirRel);
845 } else if (!cmSystemTools::FileIsFullPath(sourceDirRel)) {
846 prefix = cmStrCat(prefix, '-', sourceDirRel);
847 }
848 for (char& c : prefix) {
849 if (c == '/' || c == '\\') {
850 c = '.';
851 }
852 }
853 if (!this->Config.empty()) {
854 prefix += "-" + this->Config;
855 }
856
857 DirectoryObject dir(d.LocalGenerator, this->VersionMajor, this->VersionMinor,
858 this->Config, this->TargetIndexMap);
859 return this->FileAPI.MaybeJsonFile(dir.Dump(), prefix);
860}
861
862Json::Value CodemodelConfig::DumpProjects()
863{

Callers 1

DumpDirectoryMethod · 0.95

Calls 6

RelativeIfUnderFunction · 0.85
MaybeJsonFileMethod · 0.80
cmStrCatFunction · 0.70
GetDirectoryMethod · 0.45
emptyMethod · 0.45
DumpMethod · 0.45

Tested by

no test coverage detected