| 7 | namespace Files |
| 8 | { |
| 9 | std::unique_ptr<std::ifstream> openBinaryInputFileStream(const std::filesystem::path& path) |
| 10 | { |
| 11 | auto stream = std::make_unique<std::ifstream>(path, std::ios::binary); |
| 12 | if (!stream->is_open()) |
| 13 | throw std::system_error(errno, std::generic_category(), |
| 14 | "Failed to open '" + Files::pathToUnicodeString(path) + "' for reading"); |
| 15 | stream->exceptions(std::ios::badbit); |
| 16 | return stream; |
| 17 | } |
| 18 | } |