MCPcopy Create free account
hub / github.com/davisking/dlib / load_contents

Function load_contents

dlib/image_loader/webp_loader.cpp:17–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15{
16
17 static std::vector<unsigned char> load_contents(const std::string& filename)
18 {
19 std::ifstream stream(filename, std::ios::binary);
20 stream.exceptions(std::ifstream::failbit | std::ifstream::badbit | std::ifstream::eofbit);
21 stream.seekg(0, std::ios_base::end);
22 std::vector<unsigned char> buffer(stream.tellg());
23 stream.seekg(0);
24 stream.read(reinterpret_cast<char*>(buffer.data()), buffer.size());
25 return buffer;
26 }
27
28// ----------------------------------------------------------------------------------------
29

Callers 1

webp_loaderMethod · 0.70

Calls 4

seekgMethod · 0.80
readMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected