| 188 | } |
| 189 | |
| 190 | std::map<std::string, FileReader::FileSystemPathSet> FileReader::detectSourceUnitNameCollisions(FileSystemPathSet const& _cliPaths) const |
| 191 | { |
| 192 | std::map<std::string, FileReader::FileSystemPathSet> nameToPaths; |
| 193 | for (boost::filesystem::path const& cliPath: _cliPaths) |
| 194 | { |
| 195 | std::string sourceUnitName = cliPathToSourceUnitName(cliPath); |
| 196 | boost::filesystem::path normalizedPath = normalizeCLIPathForVFS(cliPath); |
| 197 | nameToPaths[sourceUnitName].insert(normalizedPath); |
| 198 | } |
| 199 | |
| 200 | std::map<std::string, FileReader::FileSystemPathSet> collisions; |
| 201 | for (auto&& [sourceUnitName, cliPaths]: nameToPaths) |
| 202 | if (cliPaths.size() >= 2) |
| 203 | collisions[sourceUnitName] = std::move(cliPaths); |
| 204 | |
| 205 | return collisions; |
| 206 | } |
| 207 | |
| 208 | boost::filesystem::path FileReader::normalizeCLIPathForVFS( |
| 209 | boost::filesystem::path const& _path, |
no test coverage detected