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

Function read_file

LiveRecomp/live_recompiler_test.cpp:10–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "recomp.h"
9
10static std::vector<uint8_t> read_file(const std::filesystem::path& path, bool& found) {
11 std::vector<uint8_t> ret;
12 found = false;
13
14 std::ifstream file{ path, std::ios::binary};
15
16 if (file.good()) {
17 file.seekg(0, std::ios::end);
18 ret.resize(file.tellg());
19 file.seekg(0, std::ios::beg);
20
21 file.read(reinterpret_cast<char*>(ret.data()), ret.size());
22 found = true;
23 }
24
25 return ret;
26}
27
28
29uint32_t read_u32_swap(const std::vector<uint8_t>& vec, size_t offset) {

Callers 1

run_testFunction · 0.70

Calls 1

goodMethod · 0.45

Tested by

no test coverage detected