PxDefaultStreams.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12 
13 
14 #ifndef PX_PHYSICS_EXTENSIONS_DEFAULT_STREAMS_H
15 #define PX_PHYSICS_EXTENSIONS_DEFAULT_STREAMS_H
16 
20 #include <stdio.h>
22 #include "foundation/PxIO.h"
24 
25 #ifndef PX_WIIU
26  typedef FILE* PxFileHandle;
27 #else
28  #include "extensions/wiiu/PxWiiUFileHandle.h"
29 #endif
30 
31 #ifndef PX_DOXYGEN
32 namespace physx
33 {
34 #endif
35 
43 {
44 public:
45  PxDefaultMemoryOutputStream(PxAllocatorCallback &allocator = PxGetFoundation().getAllocatorCallback());
46  virtual ~PxDefaultMemoryOutputStream();
47 
48  virtual PxU32 write(const void* src, PxU32 count);
49 
50  virtual PxU32 getSize() const { return mSize; }
51  virtual PxU8* getData() const { return mData; }
52 
53 private:
56 
61 };
62 
70 {
71 public:
72  PxDefaultMemoryInputData(PxU8* data, PxU32 length);
73 
74  virtual PxU32 read(void* dest, PxU32 count);
75  virtual PxU32 getLength() const;
76  virtual void seek(PxU32 pos);
77  virtual PxU32 tell() const;
78 
79 private:
81  const PxU8* mData;
83 };
84 
85 
86 
94 {
95 public:
96  PxDefaultFileOutputStream(const char* name);
97  virtual ~PxDefaultFileOutputStream();
98 
99  virtual PxU32 write(const void* src, PxU32 count);
100  virtual bool isValid();
101 private:
103 };
104 
105 
113 {
114 public:
115  PxDefaultFileInputData(const char* name);
116  virtual ~PxDefaultFileInputData();
117 
118  virtual PxU32 read(void* dest, PxU32 count);
119  virtual void seek(PxU32 pos);
120  virtual PxU32 tell() const;
121  virtual PxU32 getLength() const;
122 
123  bool isValid() const;
124 private:
127 };
128 
129 #ifndef PX_DOXYGEN
130 }
131 #endif
132 
135 #endif
136 


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com