| 38 | } |
| 39 | |
| 40 | void SymlinkResolver::addFile(Diagnostics& diags, std::string path) { |
| 41 | if (path.front() != '/') { |
| 42 | diags.error("Path must start with '/'"); |
| 43 | return; |
| 44 | } |
| 45 | if (symlinks.find(path) != symlinks.end()) { |
| 46 | diags.error("Cannot add regular file as it is already a symlink"); |
| 47 | return; |
| 48 | } |
| 49 | filePaths.insert(path); |
| 50 | } |
| 51 | |
| 52 | void SymlinkResolver::addSymlink(Diagnostics& diags, std::string fromPath, std::string toPath) { |
| 53 | normalizePath(fromPath); |