MCPcopy Create free account
hub / github.com/VitalAudio/visage / replaceFileWithData

Function replaceFileWithData

visage_utils/file_system.cpp:50–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49namespace visage {
50 bool replaceFileWithData(const File& file, const unsigned char* data, size_t size) {
51 std::ofstream stream(file, std::ios::binary);
52 if (!stream)
53 return false;
54
55 stream.write(reinterpret_cast<const char*>(data), size);
56
57 if (stream.fail())
58 return false;
59
60 return true;
61 }
62
63 bool replaceFileWithText(const File& file, const std::string& text) {
64 std::ofstream stream(file, std::ios::binary);

Callers 2

compileShaderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected