MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / getsize

Method getsize

tests/streamtests/streamtests.cc:176–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174 }
175
176 static KTX_error_code getsize(ktxStream* str, ktx_size_t* size)
177 {
178 auto self = parent(str);
179 const std::streampos oldpos = self->_streambuf->pubseekoff(0, std::ios::cur, self->_seek_mode);
180 *size = ktx_size_t(self->_streambuf->pubseekoff(0, std::ios::end));
181 const std::streampos newpos = self->_streambuf->pubseekoff(oldpos, std::ios::beg, self->_seek_mode);
182 std::cerr << "\t size: " << *size << 'B' << std::endl;
183 return (oldpos == newpos) ? KTX_SUCCESS : KTX_FILE_SEEK_ERROR;
184 }
185
186 static void destruct(ktxStream* str)
187 {

Callers 1

TESTFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected