MCPcopy Create free account
hub / github.com/SHAILAB-IPEC/OpenFly-Platform / load

Method load

envs/gs/SIBR_viewers/src/core/system/ByteStream.cpp:110–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 }
109
110 bool ByteStream::load( const std::string& filename )
111 {
112 std::ifstream file(filename.c_str(), std::ios::in | std::ios::binary);
113
114 if (file)
115 {
116 file.seekg(0, file.end);
117 auto len = file.tellg();
118 file.seekg(0, file.beg);
119
120 _buffer.resize(len);
121 file.read(reinterpret_cast<char*>(&_buffer[0]), len);
122
123 file.close();
124 return true;
125 }
126 else
127 SIBR_WRG << "cannot load ByteStream from file '" << filename << "'." << std::endl;
128 return false;
129 }
130
131 void ByteStream::saveToFile( const std::string& filename )
132 {

Callers 4

loadFromDataMethod · 0.45
loadFromPathMethod · 0.45
loadFromDataMethod · 0.45
createFromDataMethod · 0.45

Calls 3

readMethod · 0.80
resizeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected