Panda3D
 All Classes Functions Variables Enumerations
pandaIOStream.h
1 // Filename: pandaIOStream.h
2 // Created by: rdb (29Mar11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PANDAIOSTREAM_H
16 #define PANDAIOSTREAM_H
17 
18 #include "config_assimp.h"
19 
20 #include "IOStream.h"
21 
22 class PandaIOSystem;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : PandaIOStream
26 // Description : Custom implementation of Assimp::IOStream. It
27 // simply wraps around an istream object, and is
28 // unable to write.
29 ////////////////////////////////////////////////////////////////////
30 class PandaIOStream : public Assimp::IOStream {
31 public:
32  PandaIOStream(istream &stream);
33  virtual ~PandaIOStream() {};
34 
35  size_t FileSize() const;
36  void Flush();
37  size_t Read(void *pvBuffer, size_t pSize, size_t pCount);
38  aiReturn Seek(size_t pOffset, aiOrigin pOrigin);
39  size_t Tell() const;
40  size_t Write(const void *buffer, size_t size, size_t count);
41 
42 private:
43  istream &_istream;
44 
45  friend class PandaIOSystem;
46 };
47 
48 #endif
size_t Tell() const
See ftell.
aiReturn Seek(size_t pOffset, aiOrigin pOrigin)
See fseek.
size_t FileSize() const
Returns the size of this file.
size_t Read(void *pvBuffer, size_t pSize, size_t pCount)
See fread.
void Flush()
See fflush.
size_t Write(const void *buffer, size_t size, size_t count)
See fwrite.
Custom implementation of Assimp::IOSystem.
Definition: pandaIOSystem.h:27
Custom implementation of Assimp::IOStream.
Definition: pandaIOStream.h:30