| 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 | { |