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

Method ReadFileToMemory

DragonBurn-kernel/utils.cpp:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool kdmUtils::ReadFileToMemory(const std::wstring& file_path, std::vector<BYTE>* out_buffer) {
23 std::ifstream file_ifstream(file_path, std::ios::binary);
24
25 if (!file_ifstream)
26 return false;
27
28 out_buffer->assign((std::istreambuf_iterator<char>(file_ifstream)), std::istreambuf_iterator<char>());
29 file_ifstream.close();
30
31 return true;
32}
33
34bool kdmUtils::CreateFileFromMemory(const std::wstring& desired_file_path, const char* address, size_t size) {
35 std::ofstream file_ofstream(desired_file_path.c_str(), std::ios_base::out | std::ios_base::binary);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected