MCPcopy Create free account
hub / github.com/StrikerX3/Ymir / LoadFile

Function LoadFile

apps/ymir-sdl3/src/util/file_loader.cpp:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace util {
6
7std::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
19std::vector<uint8> LoadFile(std::filesystem::path romPath, std::error_code &error) {
20 std::vector<uint8> data{};

Callers 5

InsertROMCartridgeFunction · 0.85
LoadStateFunction · 0.85
LoadIPLROMFunction · 0.85
LoadCDBlockROMFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected