| 38 | } |
| 39 | |
| 40 | static std::unique_ptr<ThreadedFileReader> GetFileReader(const std::string& path) |
| 41 | { |
| 42 | const std::string_view extension = Path::GetExtension(path); |
| 43 | |
| 44 | if (StringUtil::compareNoCase(extension, "chd")) |
| 45 | return std::make_unique<ChdFileReader>(); |
| 46 | |
| 47 | if (StringUtil::compareNoCase(extension, "cso") || StringUtil::compareNoCase(extension, "zso")) |
| 48 | return std::make_unique<CsoFileReader>(); |
| 49 | |
| 50 | if (StringUtil::compareNoCase(extension, "gz")) |
| 51 | return std::make_unique<GzippedFileReader>(); |
| 52 | |
| 53 | if (StringUtil::compareNoCase(extension, "dump")) |
| 54 | return std::make_unique<BlockdumpFileReader>(); |
| 55 | |
| 56 | return std::make_unique<FlatFileReader>(); |
| 57 | } |
| 58 | |
| 59 | int InputIsoFile::ReadSync(u8* dst, uint lsn) |
| 60 | { |