Panda3D
 All Classes Functions Variables Enumerations
physxFileStream.h
1 // Filename: physxFileStream.h
2 // Created by: enn0x (11Oct09)
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 PHYSXFILESTREAM_H
16 #define PHYSXFILESTREAM_H
17 
18 #include "pandabase.h"
19 #include "virtualFile.h"
20 #include "filename.h"
21 
22 #include "physx_includes.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : PhysxFileStream
26 // Description :
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_PANDAPHYSX PhysxFileStream : public NxStream {
29 
30 public:
31  PhysxFileStream(const Filename &fn, bool load);
32  virtual ~PhysxFileStream();
33 
34  virtual NxU8 readByte() const;
35  virtual NxU16 readWord() const;
36  virtual NxU32 readDword() const;
37  virtual float readFloat() const;
38  virtual double readDouble() const;
39  virtual void readBuffer(void *buffer, NxU32 size) const;
40 
41  virtual NxStream &storeByte(NxU8 b);
42  virtual NxStream &storeWord(NxU16 w);
43  virtual NxStream &storeDword(NxU32 d);
44  virtual NxStream &storeFloat(NxReal f);
45  virtual NxStream &storeDouble(NxF64 f);
46  virtual NxStream &storeBuffer(const void *buffer, NxU32 size);
47 
48 private:
49 
50  // write
51  FILE* _fp;
52 
53  // read
54  PT(VirtualFile) _vf;
55  istream *_in;
56 };
57 
58 #endif // PHYSXFILESTREAM_H
The abstract base class for a file or directory within the VirtualFileSystem.
Definition: virtualFile.h:37
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44