| 81 | } |
| 82 | |
| 83 | std::vector<std::byte> loadIntoMemory(const std::filesystem::path& path) |
| 84 | { |
| 85 | std::ifstream file(path, std::ios::binary | std::ios::ate); |
| 86 | assert(file); |
| 87 | const auto size = file.tellg(); |
| 88 | file.seekg(0, std::ios::beg); |
| 89 | std::vector<std::byte> buffer(static_cast<std::size_t>(size)); |
| 90 | [[maybe_unused]] const auto& result = file.read(reinterpret_cast<char*>(buffer.data()), |
| 91 | static_cast<std::streamsize>(size)); |
| 92 | assert(result); |
| 93 | return buffer; |
| 94 | } |
no test coverage detected