openscenegraph
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
osgDB::InputStream Class Reference

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::Array *&a)
 
InputStream & operator>> (osg::Image *&img)
 
InputStream & operator>> (osg::PrimitiveSet *&p)
 
InputStream & operator>> (osg::Object *&obj)
 
InputStream & operator>> (osg::ref_ptr< osg::Array > &ptr)
 
InputStream & operator>> (osg::ref_ptr< osg::Image > &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::Array * readArray ()
 
osg::PrimitiveSet * readPrimitiveSet ()
 
osg::Image * readImage (bool readFromExternal=true)
 
osg::Object * readObject (osg::Object *existingObj=0)
 
osg::Object * readObjectFields (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 releated stream. More...
 
ReadType start (InputIterator *)
 start reading from InputStream treating it as a traditional file releated stream, handles headers and versioning More...
 
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
 
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

Enumerator
READ_UNKNOWN 
READ_SCENE 
READ_IMAGE 
READ_OBJECT 

Constructor & Destructor Documentation

◆ InputStream()

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

◆ ~InputStream()

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

Member Function Documentation

◆ advanceToCurrentEndBracket()

void osgDB::InputStream::advanceToCurrentEndBracket ( )
inline

◆ checkStream()

void osgDB::InputStream::checkStream ( )
inlineprotected

◆ decompress()

void osgDB::InputStream::decompress ( )

◆ getException()

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

◆ getFileVersion()

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

◆ getOptions()

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

◆ isBinary()

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

◆ matchString()

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

◆ operator>>() [1/54]

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

◆ operator>>() [2/54]

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

◆ operator>>() [3/54]

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

◆ operator>>() [4/54]

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

◆ operator>>() [5/54]

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

◆ operator>>() [6/54]

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

◆ operator>>() [7/54]

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

◆ operator>>() [8/54]

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

◆ operator>>() [9/54]

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

◆ operator>>() [10/54]

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

◆ operator>>() [11/54]

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

◆ operator>>() [12/54]

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

◆ operator>>() [13/54]

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

◆ operator>>() [14/54]

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

◆ operator>>() [15/54]

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

◆ operator>>() [16/54]

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

◆ operator>>() [17/54]

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

◆ operator>>() [18/54]

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

◆ operator>>() [19/54]

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

◆ operator>>() [20/54]

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

◆ operator>>() [21/54]

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

◆ operator>>() [22/54]

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

◆ operator>>() [23/54]

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

◆ operator>>() [24/54]

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

◆ operator>>() [25/54]

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

◆ operator>>() [26/54]

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

◆ operator>>() [27/54]

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

◆ operator>>() [28/54]

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

◆ operator>>() [29/54]

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

◆ operator>>() [30/54]

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

◆ operator>>() [31/54]

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

◆ operator>>() [32/54]

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

◆ operator>>() [33/54]

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

◆ operator>>() [34/54]

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

◆ operator>>() [35/54]

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

◆ operator>>() [36/54]

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

◆ operator>>() [37/54]

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

◆ operator>>() [38/54]

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

◆ operator>>() [39/54]

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

◆ operator>>() [40/54]

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

◆ operator>>() [41/54]

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

◆ operator>>() [42/54]

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

◆ operator>>() [43/54]

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

◆ operator>>() [44/54]

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

◆ operator>>() [45/54]

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

◆ operator>>() [46/54]

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

◆ operator>>() [47/54]

InputStream& osgDB::InputStream::operator>> ( osg::Array *&  a)
inline

◆ operator>>() [48/54]

InputStream& osgDB::InputStream::operator>> ( osg::Image *&  img)
inline

◆ operator>>() [49/54]

InputStream& osgDB::InputStream::operator>> ( osg::PrimitiveSet *&  p)
inline

◆ operator>>() [50/54]

InputStream& osgDB::InputStream::operator>> ( osg::Object *&  obj)
inline

◆ operator>>() [51/54]

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

◆ operator>>() [52/54]

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

◆ operator>>() [53/54]

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

◆ operator>>() [54/54]

template<typename T >
InputStream& osgDB::InputStream::operator>> ( osg::ref_ptr< T > &  ptr)
inline

◆ readArray()

osg::Array* osgDB::InputStream::readArray ( )

◆ 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

◆ readComponentArray()

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

◆ readImage()

osg::Image* osgDB::InputStream::readImage ( bool  readFromExternal = true)

◆ readObject()

osg::Object* osgDB::InputStream::readObject ( osg::Object *  existingObj = 0)

◆ readObjectFields()

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

◆ readPrimitiveSet()

osg::PrimitiveSet* osgDB::InputStream::readPrimitiveSet ( )

◆ readSchema()

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

◆ readSize()

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

◆ readWrappedString()

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

◆ resetSchema()

void osgDB::InputStream::resetSchema ( )

◆ setFileVersion()

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

◆ setInputIterator()

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

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

◆ 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 releated stream, handles headers and versioning

◆ throwException()

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

Member Data Documentation

◆ _arrayMap

ArrayMap osgDB::InputStream::_arrayMap
protected

◆ _dataDecompress

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

◆ _domainVersionMap

VersionMap osgDB::InputStream::_domainVersionMap
protected

◆ _exception

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

◆ _fields

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

◆ _fileVersion

int osgDB::InputStream::_fileVersion
protected

◆ _forceReadingImage

bool osgDB::InputStream::_forceReadingImage
protected

◆ _identifierMap

IdentifierMap osgDB::InputStream::_identifierMap
protected

◆ _in

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

◆ _options

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

◆ _useSchemaData

bool osgDB::InputStream::_useSchemaData
protected

◆ BEGIN_BRACKET

ObjectMark osgDB::InputStream::BEGIN_BRACKET

◆ END_BRACKET

ObjectMark osgDB::InputStream::END_BRACKET

◆ PROPERTY

ObjectProperty osgDB::InputStream::PROPERTY

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