MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / CreateCurrentModule

Method CreateCurrentModule

Exporter/Html/HtmlFolderStructure.cpp:95–112  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

93
94 //-------------------------------------------------------------------------
95 HtmlFile HtmlFolderStructure::CreateCurrentModule(const std::filesystem::path& modulePath)
96 {
97 if (!optionalCurrentRoot_)
98 THROW(L"No root is selected");
99
100 auto moduleFilename = modulePath.filename();
101 auto moduleName = moduleFilename.replace_extension(""); // remove extension
102 auto folderModules = optionalCurrentRoot_->path_ / HtmlFolderStructure::FolderModules;
103
104 auto moduleFolder = folderModules / moduleName;
105 auto uniqueModulesFolder = optionalCurrentRoot_->uniqueChildrenPath_.GetUniquePath(moduleFolder);
106 optionalCurrentModule_ = std::make_unique<Hierarchy>(uniqueModulesFolder);
107 fs::path moduleHtmlPath = uniqueModulesFolder.wstring() + L".html";
108
109 return HtmlFile{
110 moduleHtmlPath,
111 fs::path{ HtmlFolderStructure::FolderModules } / moduleHtmlPath.filename() };
112 }
113
114 //---------------------------------------------------------------------
115 HtmlFile HtmlFolderStructure::GetHtmlFilePath(const std::filesystem::path& filePath) const

Callers 2

TEST_FFunction · 0.80
ExportMethod · 0.80

Calls 1

GetUniquePathMethod · 0.80

Tested by 1

TEST_FFunction · 0.64