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