Map any symlink to "/symlink".
| 74 | } |
| 75 | // Map any symlink to "/symlink". |
| 76 | std::error_code getRealPath(const Twine &Path, |
| 77 | SmallVectorImpl<char> &Output) const override { |
| 78 | auto I = FilesAndDirs.find(Path.str()); |
| 79 | if (I == FilesAndDirs.end()) |
| 80 | return make_error_code(llvm::errc::no_such_file_or_directory); |
| 81 | if (I->second.isSymlink()) { |
| 82 | Output.clear(); |
| 83 | Twine("/symlink").toVector(Output); |
| 84 | return std::error_code(); |
| 85 | } |
| 86 | Output.clear(); |
| 87 | Path.toVector(Output); |
| 88 | return std::error_code(); |
| 89 | } |
| 90 | |
| 91 | struct DirIterImpl : public llvm::vfs::detail::DirIterImpl { |
| 92 | std::map<std::string, vfs::Status> &FilesAndDirs; |