| 5 | namespace util { |
| 6 | |
| 7 | std::vector<uint8> LoadFile(std::filesystem::path romPath) { |
| 8 | std::vector<uint8> data{}; |
| 9 | std::ifstream stream{romPath, std::ios::binary | std::ios::ate}; |
| 10 | if (stream.is_open()) { |
| 11 | auto size = stream.tellg(); |
| 12 | stream.seekg(0, std::ios::beg); |
| 13 | data.resize(size); |
| 14 | stream.read(reinterpret_cast<char *>(data.data()), size); |
| 15 | } |
| 16 | return data; |
| 17 | } |
| 18 | |
| 19 | std::vector<uint8> LoadFile(std::filesystem::path romPath, std::error_code &error) { |
| 20 | std::vector<uint8> data{}; |
no outgoing calls
no test coverage detected