| 80 | } |
| 81 | |
| 82 | PathId PlatformFileSystem::toPathId(std::string_view path, |
| 83 | SymbolTable *symbolTable) { |
| 84 | if (path.empty()) return BadPathId; |
| 85 | |
| 86 | std::filesystem::path normpath = normalize(path); |
| 87 | if (normpath.empty() || normpath.is_relative()) return BadPathId; |
| 88 | |
| 89 | auto [symbolId, symbol] = symbolTable->add(normpath.string()); |
| 90 | return PathId(symbolTable, (RawSymbolId)symbolId, symbol); |
| 91 | } |
| 92 | |
| 93 | std::filesystem::path PlatformFileSystem::toPlatformAbsPath(PathId id) { |
| 94 | return toPath(id); |