MCPcopy Create free account
hub / github.com/ByteCorum/DragonBurn / ReadFile

Function ReadFile

Crypto/Crypto.cpp:52–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool ReadFile(const std::string& filename, std::vector<uint8_t>& bin)
53{
54 std::ifstream infile(filename, std::ios::in | std::ios::binary | std::ios::ate);
55 if (!infile)
56 {
57 std::cerr << "Error: Could not open file for reading: " + filename << std::endl;
58 return false;
59 }
60
61 std::streamsize size = infile.tellg();
62 infile.seekg(0, std::ios::beg);
63
64 bin.resize(size);
65 infile.read(reinterpret_cast<char*>(bin.data()), size);
66 infile.close();
67 return true;
68}
69
70int main(int argc, char* argv[])
71{

Callers 1

mainFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected