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

Method GetUniquePath

Tools/UniquePath.cpp:26–38  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

24{
25 //-------------------------------------------------------------------------
26 std::filesystem::path UniquePath::GetUniquePath(const std::filesystem::path& path)
27 {
28 auto uniquePath = path;
29 auto filenameWithoutExtension = path.filename().replace_extension(L"");
30
31 for (int i = 2; existingPathSet_.count(uniquePath) != 0; ++i)
32 {
33 auto filename = filenameWithoutExtension.wstring() + std::to_wstring(i) + path.extension().wstring();
34 uniquePath = path.parent_path() / filename;
35 }
36 existingPathSet_.insert(uniquePath);
37 return uniquePath;
38 }
39}

Callers 2

CreateCurrentModuleMethod · 0.80
GetHtmlFilePathMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected