| 1109 | } |
| 1110 | |
| 1111 | PathId PlatformFileSystem::getParent(PathId id, SymbolTable *symbolTable) { |
| 1112 | if (!id) return BadPathId; |
| 1113 | |
| 1114 | std::filesystem::path filepath = toPath(id); |
| 1115 | if (filepath.empty()) return BadPathId; |
| 1116 | |
| 1117 | return filepath.has_parent_path() |
| 1118 | ? toPathId(filepath.parent_path().string(), symbolTable) |
| 1119 | : toPathId(".", symbolTable); |
| 1120 | } |
| 1121 | |
| 1122 | std::pair<SymbolId, std::string_view> PlatformFileSystem::getLeaf( |
| 1123 | PathId id, SymbolTable *symbolTable) { |
no outgoing calls