MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / save_file

Function save_file

samples/shared/lodepng.cpp:5900–5904  ·  view source on GitHub ↗

write given buffer to the file, overwriting the file, it doesn't append to it.*/

Source from the content-addressed store, hash-verified

5898
5899/*write given buffer to the file, overwriting the file, it doesn't append to it.*/
5900void save_file(const std::vector<unsigned char>& buffer, const std::string& filename)
5901{
5902 std::ofstream file(filename.c_str(), std::ios::out|std::ios::binary);
5903 file.write(buffer.empty() ? 0 : (char*)&buffer[0], std::streamsize(buffer.size()));
5904}
5905#endif //LODEPNG_COMPILE_DISK
5906
5907#ifdef LODEPNG_COMPILE_ZLIB

Callers 1

encodeFunction · 0.85

Calls 3

writeMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected