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

Function WriteFile

Crypto/Crypto.cpp:38–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38bool WriteFile(const std::string& filename, const std::vector<uint8_t>& bin)
39{
40 std::ofstream outfile(filename, std::ios::out | std::ios::binary);
41 if (!outfile)
42 {
43 std::cerr << "Error: Could not open file for writing: " + filename << std::endl;
44 return false;
45 }
46
47 outfile.write(reinterpret_cast<const char*>(bin.data()), bin.size());
48 outfile.close();
49 return true;
50}
51
52bool ReadFile(const std::string& filename, std::vector<uint8_t>& bin)
53{

Callers 1

mainFunction · 0.85

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected