22 PandaIOStream(std::istream &stream) : _istream(stream) {
30 std::streampos cur = _istream.tellg();
31 _istream.seekg(0, ios::end);
32 std::streampos end = _istream.tellg();
33 _istream.seekg(cur, ios::beg);
49 Read(
void *buffer,
size_t size,
size_t count) {
50 _istream.read((
char*) buffer, size * count);
51 return _istream.gcount();
58 Seek(
size_t offset, aiOrigin origin) {
61 _istream.seekg(offset, ios::beg);
65 _istream.seekg(offset, ios::cur);
69 _istream.seekg(offset, ios::end);
74 nassertr(
false, AI_FAILURE);
78 if (_istream.good()) {
90 return _istream.tellg();
97 Write(
const void *buffer,
size_t size,
size_t count) {
aiReturn Seek(size_t pOffset, aiOrigin pOrigin)
See fseek.
size_t Tell() const
See ftell.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
size_t Read(void *pvBuffer, size_t pSize, size_t pCount)
See fread.
size_t FileSize() const
Returns the size of this file.
size_t Write(const void *buffer, size_t size, size_t count)
See fwrite.