|
Revision 13041, 2.2 kB
(checked in by robert, 15 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | #ifndef __FLTEXP_DATA_OUTPUT_STREAM_H__ |
|---|
| 18 | #define __FLTEXP_DATA_OUTPUT_STREAM_H__ 1 |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | #include <ostream> |
|---|
| 22 | #include <string> |
|---|
| 23 | #include <osg/Vec3f> |
|---|
| 24 | #include <osg/Vec3d> |
|---|
| 25 | #include <osg/Vec4f> |
|---|
| 26 | #include "Types.h" |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | namespace flt { |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | class Record; |
|---|
| 34 | |
|---|
| 35 | class DataOutputStream : public std::ostream |
|---|
| 36 | { |
|---|
| 37 | public: |
|---|
| 38 | explicit DataOutputStream( std::streambuf* sb, bool validate=false ); |
|---|
| 39 | |
|---|
| 40 | void writeInt8( const int8 val ); |
|---|
| 41 | void writeUInt8( const uint8 val ); |
|---|
| 42 | void writeInt16( const int16 val ); |
|---|
| 43 | void writeUInt16( const uint16 val ); |
|---|
| 44 | void writeInt32( const int32 val ); |
|---|
| 45 | void writeUInt32( const uint32 val ); |
|---|
| 46 | void writeFloat32( const float32 val ); |
|---|
| 47 | void writeFloat64( const float64 val ); |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | void writeString( const std::string& val, bool nullTerminate=true ); |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | void writeString( const std::string& val, int size, char fill='\0' ); |
|---|
| 56 | |
|---|
| 57 | void writeID( const std::string& val ); |
|---|
| 58 | void writeVec2f( const osg::Vec2f& val ); |
|---|
| 59 | void writeVec3f( const osg::Vec3f& val ); |
|---|
| 60 | void writeVec4f( const osg::Vec4f& val ); |
|---|
| 61 | void writeVec3d( const osg::Vec3d& val ); |
|---|
| 62 | |
|---|
| 63 | void writeFill( int sizeBytes, const char val='\0' ); |
|---|
| 64 | |
|---|
| 65 | protected: |
|---|
| 66 | virtual std::ostream& vwrite( char_type* str, std::streamsize count ); |
|---|
| 67 | |
|---|
| 68 | bool _byteswap; |
|---|
| 69 | bool _validate; |
|---|
| 70 | |
|---|
| 71 | static char _null; |
|---|
| 72 | }; |
|---|
| 73 | |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | #endif |
|---|