MCPcopy Create free account
hub / github.com/creatale/node-dv / load_file

Function load_file

deps/lodepng/lodepng.cpp:6087–6093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6085
6086#ifdef LODEPNG_COMPILE_DISK
6087unsigned load_file(std::vector<unsigned char>& buffer, const std::string& filename)
6088{
6089 long size = lodepng_filesize(filename.c_str());
6090 if(size < 0) return 78;
6091 buffer.resize((size_t)size);
6092 return size == 0 ? 0 : lodepng_buffer_file(&buffer[0], (size_t)size, filename.c_str());
6093}
6094
6095/*write given buffer to the file, overwriting the file, it doesn't append to it.*/
6096unsigned save_file(const std::vector<unsigned char>& buffer, const std::string& filename)

Callers 1

decodeFunction · 0.85

Calls 4

lodepng_filesizeFunction · 0.85
lodepng_buffer_fileFunction · 0.85
c_strMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected