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

Function read_file

OfflineModRecomp/main.cpp:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 1

goodMethod · 0.45

Tested by

no test coverage detected