osgDB::InputStream Class Reference

`#include <InputStream>`

## Public Types

enum | ReadType { READ_UNKNOWN = 0 , READ_SCENE , READ_IMAGE , READ_OBJECT }
typedef std::map< unsigned int, osg::ref_ptr< osg::Array > > | ArrayMap
typedef std::map< unsigned int, osg::ref_ptr< osg::Object > > | IdentifierMap

## Public Member Functions

| InputStream (const osgDB::Options *options)
virtual | ~InputStream ()
void | setFileVersion (const std::string &d, int v)
int | getFileVersion (const std::string &d=std::string()) const
bool | isBinary () const
const osgDB::Options * | getOptions () const
InputStream & | operator>> (bool &b)
InputStream & | operator>> (char &c)
InputStream & | operator>> (signed char &c)
InputStream & | operator>> (unsigned char &c)
InputStream & | operator>> (short &s)
InputStream & | operator>> (unsigned short &s)
InputStream & | operator>> (int &i)
InputStream & | operator>> (unsigned int &i)
InputStream & | operator>> (long &l)
InputStream & | operator>> (unsigned long &l)
InputStream & | operator>> (float &f)
InputStream & | operator>> (double &d)
InputStream & | operator>> (std::string &s)
InputStream & | operator>> (std::istream &(*fn)(std::istream &))
InputStream & | operator>> (std::ios_base &(*fn)(std::ios_base &))
InputStream & | operator>> (ObjectGLenum &value)
InputStream & | operator>> (ObjectProperty &prop)
InputStream & | operator>> (ObjectMark &mark)
InputStream & | operator>> (osg::Vec2b &v)
InputStream & | operator>> (osg::Vec3b &v)
InputStream & | operator>> (osg::Vec4b &v)
InputStream & | operator>> (osg::Vec2ub &v)
InputStream & | operator>> (osg::Vec3ub &v)
InputStream & | operator>> (osg::Vec4ub &v)
InputStream & | operator>> (osg::Vec2s &v)
InputStream & | operator>> (osg::Vec3s &v)
InputStream & | operator>> (osg::Vec4s &v)
InputStream & | operator>> (osg::Vec2us &v)
InputStream & | operator>> (osg::Vec3us &v)
InputStream & | operator>> (osg::Vec4us &v)
InputStream & | operator>> (osg::Vec2i &v)
InputStream & | operator>> (osg::Vec3i &v)
InputStream & | operator>> (osg::Vec4i &v)
InputStream & | operator>> (osg::Vec2ui &v)
InputStream & | operator>> (osg::Vec3ui &v)
InputStream & | operator>> (osg::Vec4ui &v)
InputStream & | operator>> (osg::Vec2f &v)
InputStream & | operator>> (osg::Vec3f &v)
InputStream & | operator>> (osg::Vec4f &v)
InputStream & | operator>> (osg::Vec2d &v)
InputStream & | operator>> (osg::Vec3d &v)
InputStream & | operator>> (osg::Vec4d &v)
InputStream & | operator>> (osg::Quat &q)
InputStream & | operator>> (osg::Plane &p)
InputStream & | operator>> (osg::Matrixf &mat)
InputStream & | operator>> (osg::Matrixd &mat)
InputStream & | operator>> (osg::BoundingBoxf &bb)
InputStream & | operator>> (osg::BoundingBoxd &bb)
InputStream & | operator>> (osg::BoundingSpheref &bs)
InputStream & | operator>> (osg::BoundingSphered &bs)
InputStream & | operator>> (osg::ref_ptr< osg::Image > &ptr)
InputStream & | operator>> (osg::ref_ptr< osg::Array > &ptr)
InputStream & | operator>> (osg::ref_ptr< osg::PrimitiveSet > &ptr)
template<typename T>
InputStream & | operator>> (osg::ref_ptr< T > &ptr)
bool | matchString (const std::string &str)
void | advanceToCurrentEndBracket ()
void | readWrappedString (std::string &str)
void | readCharArray (char *s, unsigned int size)
void | readComponentArray (char *s, unsigned int numElements, unsigned int numComponentsPerElements, unsigned int componentSizeInBytes)
unsigned int | readSize ()
osg::ref_ptr< osg::Array > | readArray ()
osg::ref_ptr< osg::PrimitiveSet > | readPrimitiveSet ()
osg::ref_ptr< osg::Image > | readImage (bool readFromExternal=true)
template<typename T>
osg::ref_ptr< T > | readObjectOfType ()
osg::ref_ptr< osg::Object > | readObject (osg::Object *existingObj=0)
osg::ref_ptr< osg::Object > | readObjectFields (const std::string &className, unsigned int id, osg::Object *existingObj=0)
template<typename T>
osg::ref_ptr< T > | readObjectFieldsOfType (const std::string &className, unsigned int id, osg::Object *existingObj=0)
void | setInputIterator (InputIterator *ii)
| set an input iterator, used directly when not using InputStream with a traditional file related stream.
ReadType | start (InputIterator *)
| start reading from InputStream treating it as a traditional file related stream, handles headers and versioning
void | decompress ()
void | readSchema (std::istream &fin)
void | resetSchema ()
void | throwException (const std::string &msg)
const InputException * | getException () const

## Public Attributes

ObjectProperty | PROPERTY
ObjectMark | BEGIN_BRACKET
ObjectMark | END_BRACKET

## Protected Types

typedef std::map< std::string, int > | VersionMap

## Protected Member Functions

void | checkStream ()
void | setWrapperSchema (const std::string &name, const std::string &properties)
template<typename T>
void | readArrayImplementation (T *a, unsigned int numComponentsPerElements, unsigned int componentSizeInBytes)

## Protected Attributes

ArrayMap | _arrayMap
IdentifierMap | _identifierMap
VersionMap | _domainVersionMap
int | _fileVersion
bool | _useSchemaData
bool | _forceReadingImage
std::vector< std::string > | _fields
osg::ref_ptr< InputIterator > | _in
osg::ref_ptr< InputException > | _exception
osg::ref_ptr< const osgDB::Options > | _options
osg::ref_ptr< osg::Object > | _dummyReadObject
std::stringstream * | _dataDecompress

## Member Typedef Documentation

## ArrayMap

typedef std::map< unsigned int, osg::ref_ptr<osg::Array> > osgDB::InputStream::ArrayMap

## IdentifierMap

typedef std::map< unsigned int, osg::ref_ptr<osg::Object> > osgDB::InputStream::IdentifierMap

## VersionMap

typedef std::map<std::string, int> osgDB::InputStream::VersionMap

protected

## Member Enumeration Documentation

## ReadType

enum osgDB::InputStream::ReadType

Enumerator
READ_UNKNOWN |
READ_SCENE |
READ_IMAGE |
READ_OBJECT |

## Constructor & Destructor Documentation

## InputStream()

osgDB::InputStream::InputStream | ( | const osgDB::Options * | options | ) |

Referenced by operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), and operator>>().

## ~InputStream()

virtual osgDB::InputStream::~InputStream | ( |  | ) |

virtual

## Member Function Documentation

## advanceToCurrentEndBracket()

void osgDB::InputStream::advanceToCurrentEndBracket | ( |  | ) |

inline

References _in.

## checkStream()

void osgDB::InputStream::checkStream | ( |  | ) |

inline protected

References _in, and throwException().

Referenced by operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), and readWrappedString().

## decompress()

void osgDB::InputStream::decompress | ( |  | ) |

## getException()

const InputException * osgDB::InputStream::getException | ( |  | ) | const

inline

References _exception.

## getFileVersion()

int osgDB::InputStream::getFileVersion | ( | const std::string & | d = std::string() | ) | const

Referenced by osgDB::BitFlagsSerializer< C, P >::read().

## getOptions()

const osgDB::Options * osgDB::InputStream::getOptions | ( |  | ) | const

inline

References _options.

## isBinary()

bool osgDB::InputStream::isBinary | ( |  | ) | const

inline

References _in.

Referenced by osgDB::BitFlagsSerializer< C, P >::read(), osgDB::EnumSerializer< C, P, B >::read(), osgDB::GLenumSerializer< C, P >::read(), osgDB::ImageSerializer< C, P >::read(), osgDB::IsAVectorSerializer< C >::read(), osgDB::ListSerializer< C, P >::read(), osgDB::MapSerializer< C, P >::read(), osgDB::MatrixSerializer< C >::read(), osgDB::ObjectSerializer< C, P >::read(), osgDB::PropByRefSerializer< C, P >::read(), osgDB::PropByValSerializer< C, P >::read(), osgDB::StringSerializer< C >::read(), osgDB::UserSerializer< C >::read(), and osgDB::VectorSerializer< C, P >::read().

## matchString()

bool osgDB::InputStream::matchString | ( | const std::string & | str | ) |

inline

References _in.

Referenced by osgDB::BitFlagsSerializer< C, P >::read(), osgDB::EnumSerializer< C, P, B >::read(), osgDB::GLenumSerializer< C, P >::read(), osgDB::ImageSerializer< C, P >::read(), osgDB::IsAVectorSerializer< C >::read(), osgDB::ListSerializer< C, P >::read(), osgDB::MapSerializer< C, P >::read(), osgDB::MatrixSerializer< C >::read(), osgDB::ObjectSerializer< C, P >::read(), osgDB::PropByRefSerializer< C, P >::read(), osgDB::PropByValSerializer< C, P >::read(), osgDB::StringSerializer< C >::read(), osgDB::UserSerializer< C >::read(), and osgDB::VectorSerializer< C, P >::read().

## operator>>() [1/54]

InputStream & osgDB::InputStream::operator>> | ( | bool & | b | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [2/54]

InputStream & osgDB::InputStream::operator>> | ( | char & | c | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [3/54]

InputStream & osgDB::InputStream::operator>> | ( | double & | d | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [4/54]

InputStream & osgDB::InputStream::operator>> | ( | float & | f | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [5/54]

InputStream & osgDB::InputStream::operator>> | ( | int & | i | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [6/54]

InputStream & osgDB::InputStream::operator>> | ( | long & | l | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [7/54]

InputStream & osgDB::InputStream::operator>> | ( | ObjectGLenum & | value | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [8/54]

InputStream & osgDB::InputStream::operator>> | ( | ObjectMark & | mark | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [9/54]

InputStream & osgDB::InputStream::operator>> | ( | ObjectProperty & | prop | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [10/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::BoundingBoxd & | bb | ) |

References InputStream().

## operator>>() [11/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::BoundingBoxf & | bb | ) |

References InputStream().

## operator>>() [12/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::BoundingSphered & | bs | ) |

References InputStream().

## operator>>() [13/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::BoundingSpheref & | bs | ) |

References InputStream().

## operator>>() [14/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Matrixd & | mat | ) |

References InputStream().

## operator>>() [15/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Matrixf & | mat | ) |

References InputStream().

## operator>>() [16/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Plane & | p | ) |

References InputStream().

## operator>>() [17/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Quat & | q | ) |

References InputStream().

## operator>>() [18/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::ref_ptr< osg::Array > & | ptr | ) |

inline

References _fileVersion, InputStream(), readArray(), and readObjectOfType().

## operator>>() [19/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::ref_ptr< osg::Image > & | ptr | ) |

inline

References InputStream(), and readImage().

## operator>>() [20/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::ref_ptr< osg::PrimitiveSet > & | ptr | ) |

inline

References _fileVersion, InputStream(), readObjectOfType(), and readPrimitiveSet().

## operator>>() [21/54]

template<typename T>

InputStream & osgDB::InputStream::operator>> | ( | osg::ref_ptr< T > & | ptr | ) |

inline

References InputStream(), and readObjectOfType().

## operator>>() [22/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2b & | v | ) |

References InputStream().

## operator>>() [23/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2d & | v | ) |

References InputStream().

## operator>>() [24/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2f & | v | ) |

References InputStream().

## operator>>() [25/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2i & | v | ) |

References InputStream().

## operator>>() [26/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2s & | v | ) |

References InputStream().

## operator>>() [27/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2ub & | v | ) |

References InputStream().

## operator>>() [28/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2ui & | v | ) |

References InputStream().

## operator>>() [29/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec2us & | v | ) |

References InputStream().

## operator>>() [30/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3b & | v | ) |

References InputStream().

## operator>>() [31/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3d & | v | ) |

References InputStream().

## operator>>() [32/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3f & | v | ) |

References InputStream().

## operator>>() [33/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3i & | v | ) |

References InputStream().

## operator>>() [34/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3s & | v | ) |

References InputStream().

## operator>>() [35/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3ub & | v | ) |

References InputStream().

## operator>>() [36/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3ui & | v | ) |

References InputStream().

## operator>>() [37/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec3us & | v | ) |

References InputStream().

## operator>>() [38/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4b & | v | ) |

References InputStream().

## operator>>() [39/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4d & | v | ) |

References InputStream().

## operator>>() [40/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4f & | v | ) |

References InputStream().

## operator>>() [41/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4i & | v | ) |

References InputStream().

## operator>>() [42/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4s & | v | ) |

References InputStream().

## operator>>() [43/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4ub & | v | ) |

References InputStream().

## operator>>() [44/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4ui & | v | ) |

References InputStream().

## operator>>() [45/54]

InputStream & osgDB::InputStream::operator>> | ( | osg::Vec4us & | v | ) |

References InputStream().

## operator>>() [46/54]

InputStream & osgDB::InputStream::operator>> | ( | short & | s | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [47/54]

InputStream & osgDB::InputStream::operator>> | ( | signed char & | c | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [48/54]

InputStream & osgDB::InputStream::operator>> | ( | std::ios_base &(* | fn )(std::ios_base &) | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [49/54]

InputStream & osgDB::InputStream::operator>> | ( | std::istream &(* | fn )(std::istream &) | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [50/54]

InputStream & osgDB::InputStream::operator>> | ( | std::string & | s | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [51/54]

InputStream & osgDB::InputStream::operator>> | ( | unsigned char & | c | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [52/54]

InputStream & osgDB::InputStream::operator>> | ( | unsigned int & | i | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [53/54]

InputStream & osgDB::InputStream::operator>> | ( | unsigned long & | l | ) |

inline

References _in, checkStream(), and InputStream().

## operator>>() [54/54]

InputStream & osgDB::InputStream::operator>> | ( | unsigned short & | s | ) |

inline

References _in, checkStream(), and InputStream().

## readArray()

osg::ref_ptr< osg::Array > osgDB::InputStream::readArray | ( |  | ) |

Referenced by operator>>().

## readArrayImplementation()

template<typename T>

void osgDB::InputStream::readArrayImplementation | ( | T * | a,
|  | unsigned int | numComponentsPerElements,
|  | unsigned int | componentSizeInBytes )

protected

## readCharArray()

void osgDB::InputStream::readCharArray | ( | char * | s,
|  | unsigned int | size )

inline

References _in.

## readComponentArray()

void osgDB::InputStream::readComponentArray | ( | char * | s,
|  | unsigned int | numElements,
|  | unsigned int | numComponentsPerElements,
|  | unsigned int | componentSizeInBytes )

inline

References _in.

## readImage()

osg::ref_ptr< osg::Image > osgDB::InputStream::readImage | ( | bool | readFromExternal = true | ) |

Referenced by operator>>(), and osgDB::ImageSerializer< C, P >::read().

## readObject()

osg::ref_ptr< osg::Object > osgDB::InputStream::readObject | ( | osg::Object * | existingObj = 0 | ) |

Referenced by readObjectOfType().

## readObjectFields()

osg::ref_ptr< osg::Object > osgDB::InputStream::readObjectFields | ( | const std::string & | className,
|  | unsigned int | id,
|  | osg::Object * | existingObj = 0 )

Referenced by readObjectFieldsOfType().

## readObjectFieldsOfType()

template<typename T>

osg::ref_ptr< T > osgDB::InputStream::readObjectFieldsOfType | ( | const std::string & | className,
|  | unsigned int | id,
|  | osg::Object * | existingObj = 0 )

inline

References osg::ref_ptr< T >::get(), and readObjectFields().

## readObjectOfType()

template<typename T>

osg::ref_ptr< T > osgDB::InputStream::readObjectOfType | ( |  | ) |

inline

References osg::ref_ptr< T >::get(), and readObject().

Referenced by operator>>(), operator>>(), operator>>(), and osgDB::ObjectSerializer< C, P >::read().

## readPrimitiveSet()

osg::ref_ptr< osg::PrimitiveSet > osgDB::InputStream::readPrimitiveSet | ( |  | ) |

Referenced by operator>>().

## readSchema()

void osgDB::InputStream::readSchema | ( | std::istream & | fin | ) |

## readSize()

unsigned int osgDB::InputStream::readSize | ( |  | ) |

inline

## readWrappedString()

void osgDB::InputStream::readWrappedString | ( | std::string & | str | ) |

inline

References _in, and checkStream().

Referenced by osgDB::StringSerializer< C >::read().

## resetSchema()

void osgDB::InputStream::resetSchema | ( |  | ) |

References throwException().

## setFileVersion()

void osgDB::InputStream::setFileVersion | ( | const std::string & | d,
|  | int | v )

inline

References _domainVersionMap.

## setInputIterator()

void osgDB::InputStream::setInputIterator | ( | InputIterator * | ii | ) |

inline

set an input iterator, used directly when not using InputStream with a traditional file related stream.

References _in.

## setWrapperSchema()

void osgDB::InputStream::setWrapperSchema | ( | const std::string & | name,
|  | const std::string & | properties )

protected

## start()

ReadType osgDB::InputStream::start | ( | InputIterator * |  | ) |

start reading from InputStream treating it as a traditional file related stream, handles headers and versioning

## throwException()

void osgDB::InputStream::throwException | ( | const std::string & | msg | ) |

inline

References _exception, and _fields.

Referenced by checkStream(), and resetSchema().

## Member Data Documentation

## _arrayMap

ArrayMap osgDB::InputStream::_arrayMap

protected

## _dataDecompress

std::stringstream* osgDB::InputStream::_dataDecompress

protected

## _domainVersionMap

VersionMap osgDB::InputStream::_domainVersionMap

protected

Referenced by setFileVersion().

## _dummyReadObject

osg::ref_ptr<osg::Object> osgDB::InputStream::_dummyReadObject

protected

## _exception

osg::ref_ptr<InputException> osgDB::InputStream::_exception

protected

Referenced by getException(), and throwException().

## _fields

std::vector<std::string> osgDB::InputStream::_fields

protected

Referenced by throwException().

## _fileVersion

int osgDB::InputStream::_fileVersion

protected

Referenced by operator>>(), and operator>>().

## _forceReadingImage

bool osgDB::InputStream::_forceReadingImage

protected

## _identifierMap

IdentifierMap osgDB::InputStream::_identifierMap

protected

## _in

osg::ref_ptr<InputIterator> osgDB::InputStream::_in

protected

Referenced by advanceToCurrentEndBracket(), checkStream(), isBinary(), matchString(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), readCharArray(), readComponentArray(), readWrappedString(), and setInputIterator().

## _options

osg::ref_ptr<const osgDB::Options> osgDB::InputStream::_options

protected

Referenced by getOptions().

## _useSchemaData

bool osgDB::InputStream::_useSchemaData

protected

## BEGIN_BRACKET

ObjectMark osgDB::InputStream::BEGIN_BRACKET

Referenced by osgDB::ImageSerializer< C, P >::read(), osgDB::IsAVectorSerializer< C >::read(), osgDB::ListSerializer< C, P >::read(), osgDB::MapSerializer< C, P >::read(), osgDB::ObjectSerializer< C, P >::read(), and osgDB::VectorSerializer< C, P >::read().

## END_BRACKET

ObjectMark osgDB::InputStream::END_BRACKET

Referenced by osgDB::ImageSerializer< C, P >::read(), osgDB::IsAVectorSerializer< C >::read(), osgDB::ListSerializer< C, P >::read(), osgDB::MapSerializer< C, P >::read(), osgDB::ObjectSerializer< C, P >::read(), and osgDB::VectorSerializer< C, P >::read().

## PROPERTY

ObjectProperty osgDB::InputStream::PROPERTY

The documentation for this class was generated from the following file:

- InputStream