MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / read_file

Function read_file

src/main.cpp:278–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278static std::vector<uint8_t> read_file(const std::filesystem::path& path) {
279 std::vector<uint8_t> ret;
280
281 std::ifstream file{ path, std::ios::binary};
282
283 if (file.good()) {
284 file.seekg(0, std::ios::end);
285 ret.resize(file.tellg());
286 file.seekg(0, std::ios::beg);
287
288 file.read(reinterpret_cast<char*>(ret.data()), ret.size());
289 }
290
291 return ret;
292}
293
294int main(int argc, char** argv) {
295 auto exit_failure = [] (const std::string& error_str) {

Callers 1

mainFunction · 0.70

Calls 1

goodMethod · 0.45

Tested by

no test coverage detected