| 647 | } |
| 648 | |
| 649 | PathId PlatformFileSystem::getChunkFile(PathId ppFileId, int32_t chunkIndex, |
| 650 | SymbolTable *symbolTable) { |
| 651 | std::filesystem::path ppFile = toPath(ppFileId); |
| 652 | if (ppFile.empty()) return BadPathId; |
| 653 | |
| 654 | std::ostringstream strm; |
| 655 | const char filler = strm.fill(); |
| 656 | const std::streamsize width = strm.width(); |
| 657 | |
| 658 | strm << "." << std::setfill('0') << std::setw(4) << chunkIndex |
| 659 | << std::setfill(filler) << std::setw(width) |
| 660 | << ppFile.extension().string(); |
| 661 | |
| 662 | std::filesystem::path chunkFile = ppFile; |
| 663 | chunkFile.replace_extension(strm.str()); |
| 664 | PathId chunkFileId = toPathId(chunkFile.string(), symbolTable); |
| 665 | if (kEnableLogs) { |
| 666 | std::cerr << "getChunkFile: " << PathIdPP(ppFileId) << " => " |
| 667 | << PathIdPP(chunkFileId) << std::endl; |
| 668 | } |
| 669 | return chunkFileId; |
| 670 | } |
| 671 | |
| 672 | PathId PlatformFileSystem::getCheckerDir(bool isUnitCompilation, |
| 673 | SymbolTable *symbolTable) { |