Panda3D
|
00001 // Filename: pandaIOStream.h 00002 // Created by: rdb (29Mar11) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef PANDAIOSTREAM_H 00016 #define PANDAIOSTREAM_H 00017 00018 #include "config_assimp.h" 00019 00020 #include "IOStream.h" 00021 00022 class PandaIOSystem; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : PandaIOStream 00026 // Description : Custom implementation of Assimp::IOStream. It 00027 // simply wraps around an istream object, and is 00028 // unable to write. 00029 //////////////////////////////////////////////////////////////////// 00030 class PandaIOStream : public Assimp::IOStream { 00031 public: 00032 PandaIOStream(istream &stream); 00033 virtual ~PandaIOStream() {}; 00034 00035 size_t FileSize() const; 00036 void Flush(); 00037 size_t Read(void *pvBuffer, size_t pSize, size_t pCount); 00038 aiReturn Seek(size_t pOffset, aiOrigin pOrigin); 00039 size_t Tell() const; 00040 size_t Write(const void *buffer, size_t size, size_t count); 00041 00042 private: 00043 istream &_istream; 00044 00045 friend class PandaIOSystem; 00046 }; 00047 00048 #endif