| 25 | using namespace agi::fs; |
| 26 | |
| 27 | std::unique_ptr<std::istream> Open(path const& file, bool binary) { |
| 28 | LOG_D("agi/io/open/file") << file; |
| 29 | |
| 30 | auto stream = std::make_unique<std::ifstream>(file, (binary ? std::ios::binary : std::ios::in)); |
| 31 | if (stream->fail()) { |
| 32 | acs::CheckFileRead(file); |
| 33 | throw IOFatal("Unknown fatal error occurred opening " + file.string()); |
| 34 | } |
| 35 | |
| 36 | return std::unique_ptr<std::istream>(stream.release()); |
| 37 | } |
| 38 | |
| 39 | Save::Save(path const& file, bool binary) |
| 40 | : file_name(file) |
no test coverage detected