Added OutputStream::writeSize and InputStream::readSize methods to help out with ensure that 32bit and 64bit builds all
use the same 32bit type for sizes.
This commit is contained in:
@@ -126,7 +126,10 @@ public:
|
||||
void advanceToCurrentEndBracket();
|
||||
void readWrappedString( std::string& str );
|
||||
void readCharArray( char* s, unsigned int size ) { _in->readCharArray(s, size); }
|
||||
|
||||
|
||||
// readSize() use unsigned int for all sizes.
|
||||
unsigned int readSize() { unsigned int size; *this>>size; return size; }
|
||||
|
||||
// Global reading functions
|
||||
osg::Array* readArray();
|
||||
osg::PrimitiveSet* readPrimitiveSet();
|
||||
@@ -149,7 +152,7 @@ protected:
|
||||
void setWrapperSchema( const std::string& name, const std::string& properties );
|
||||
|
||||
template<typename T>
|
||||
void readArrayImplementation( T* a, int readSize, bool useByteSwap=false );
|
||||
void readArrayImplementation( T* a, int read_size, bool useByteSwap=false );
|
||||
|
||||
ArrayMap _arrayMap;
|
||||
IdentifierMap _identifierMap;
|
||||
|
||||
@@ -134,7 +134,11 @@ public:
|
||||
// Convenient methods for writing
|
||||
void writeWrappedString( const std::string& str );
|
||||
void writeCharArray( const char* s, unsigned int size ) { _out->writeCharArray(s, size); }
|
||||
|
||||
|
||||
// method for converting all data structure sizes to unsigned int to ensure architecture portability.
|
||||
template<typename T>
|
||||
void writeSize(T size) { *this<<static_cast<unsigned int>(size); }
|
||||
|
||||
// Global writing functions
|
||||
void writeArray( const osg::Array* a );
|
||||
void writePrimitiveSet( const osg::PrimitiveSet* p );
|
||||
@@ -153,7 +157,7 @@ public:
|
||||
|
||||
protected:
|
||||
template<typename T>
|
||||
void writeArrayImplementation( const T*, int writeSize, unsigned int numInRow=1 );
|
||||
void writeArrayImplementation( const T*, int write_size, unsigned int numInRow=1 );
|
||||
|
||||
unsigned int findOrCreateArrayID( const osg::Array* array );
|
||||
unsigned int findOrCreateObjectID( const osg::Object* obj );
|
||||
|
||||
Reference in New Issue
Block a user