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