-------------------------------------------------------------------------
| 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 | } |
no outgoing calls
no test coverage detected