31 #ifndef PSFILEBUFFER_PXFILEBUF_H 32 #define PSFILEBUFFER_PXFILEBUF_H 44 namespace general_PxIOStream2
86 static const uint32_t STREAM_SEEK_END=0xFFFFFFFF;
94 OPEN_READ_WRITE_EXISTING
97 virtual OpenMode getOpenMode(
void)
const = 0;
101 return getOpenMode()!=OPEN_FILE_NOT_FOUND;
108 SEEKABLE_WRITE = 0x2,
109 SEEKABLE_READWRITE = 0x3
112 virtual SeekType isSeekable(
void)
const = 0;
117 if ( (e==ENDIAN_BIG && !isBigEndian() ) ||
118 (e==ENDIAN_LITTLE && isBigEndian() ) )
133 virtual uint32_t getFileLength(
void)
const = 0;
141 virtual uint32_t seekRead(uint32_t loc) = 0;
149 virtual uint32_t seekWrite(uint32_t loc) = 0;
159 virtual uint32_t read(
void *mem,uint32_t len) = 0;
170 virtual uint32_t peek(
void *mem,uint32_t len) = 0;
180 virtual uint32_t write(
const void *mem,uint32_t len) = 0;
187 virtual uint32_t tellRead(
void)
const = 0;
194 virtual uint32_t tellWrite(
void)
const = 0;
199 virtual void flush(
void) = 0;
214 return *(
reinterpret_cast<char*
>(&i))==0;
219 char *data =
static_cast<char *
>(_data);
221 one_byte = data[0]; data[0] = data[1]; data[1] = one_byte;
226 char *data =
static_cast<char *
>(_data);
228 one_byte = data[0]; data[0] = data[3]; data[3] = one_byte;
229 one_byte = data[1]; data[1] = data[2]; data[2] = one_byte;
234 char *data =
static_cast<char *
>(_data);
236 one_byte = data[0]; data[0] = data[7]; data[7] = one_byte;
237 one_byte = data[1]; data[1] = data[6]; data[6] = one_byte;
238 one_byte = data[2]; data[2] = data[5]; data[5] = one_byte;
239 one_byte = data[3]; data[3] = data[4]; data[4] = one_byte;
330 using namespace general_PxIOStream2;
332 namespace general_PxIOStream = general_PxIOStream2;
339 #endif // PSFILEBUFFER_PXFILEBUF_H Definition: GuContactBuffer.h:37
virtual void close(void)
Close the stream.
Definition: PxFileBuf.h:204
double readDouble(void)
Definition: PxFileBuf.h:311
bool isOpen(void) const
Definition: PxFileBuf.h:99
Callback class for data serialization.
Definition: PxFileBuf.h:60
SeekType
Definition: PxFileBuf.h:104
PxFileBuf(EndianMode mode=ENDIAN_LITTLE)
Definition: PxFileBuf.h:71
PX_INLINE void swap2Bytes(void *_data) const
Definition: PxFileBuf.h:217
void release(void)
Definition: PxFileBuf.h:206
#define PX_POP_PACK
Definition: PxPreprocessor.h:330
EndianMode getEndianMode(void) const
Definition: PxFileBuf.h:128
uint16_t readWord(void)
Definition: PxFileBuf.h:284
PX_INLINE void swap4Bytes(void *_data) const
Definition: PxFileBuf.h:224
Definition: PxFileBuf.h:91
uint32_t readDword(void)
Definition: PxFileBuf.h:293
OpenMode
Definition: PxFileBuf.h:88
bool mEndianSwap
Definition: PxFileBuf.h:321
EndianMode
Definition: PxFileBuf.h:64
PX_INLINE void storeDword(uint32_t v)
Definition: PxFileBuf.h:243
static PX_INLINE bool isBigEndian()
Definition: PxFileBuf.h:211
EndianMode mEndianMode
Definition: PxFileBuf.h:322
Definition: PxFileBuf.h:92
PX_INLINE void storeDouble(double v)
Definition: PxFileBuf.h:258
Definition: PxFileBuf.h:93
virtual ~PxFileBuf(void)
Definition: PxFileBuf.h:76
void setEndianMode(EndianMode e)
Definition: PxFileBuf.h:114
Definition: PxFileBuf.h:90
PX_INLINE void swap8Bytes(void *_data) const
Definition: PxFileBuf.h:232
PX_INLINE void storeWord(uint16_t w)
Definition: PxFileBuf.h:270
float readFloat(void)
Definition: PxFileBuf.h:302
uint8_t readByte(void)
Definition: PxFileBuf.h:277
#define PX_PUSH_PACK_DEFAULT
Definition: PxPreprocessor.h:329
#define PX_INLINE
Definition: PxPreprocessor.h:336
PX_INLINE void storeFloat(float v)
Definition: PxFileBuf.h:251
PX_INLINE void storeByte(uint8_t b)
Definition: PxFileBuf.h:265