Assimp  v3.1.1 (June 2014)
Assimp::CIrrXML_IOStreamReader Class Reference

Utility class to make IrrXML work together with our custom IO system See the IrrXML docs for more details. More...

Inherits IFileReadCallBack.

Public Member Functions

 CIrrXML_IOStreamReader (IOStream *_stream)
 Construction from an existing IOStream. More...
 
virtual long getSize () const
 Returns size of file in bytes. More...
 
virtual int read (void *buffer, int sizeToRead)
 Reads an amount of bytes from the file. More...
 
virtual ~CIrrXML_IOStreamReader ()
 Virtual destructor. More...
 

Detailed Description

Utility class to make IrrXML work together with our custom IO system See the IrrXML docs for more details.

Construct IrrXML-Reader in BaseImporter::InternReadFile():

* // open the file
* std::unique_ptr<IOStream> file( pIOHandler->Open( pFile));
* if( file.get() == NULL) {
* throw DeadlyImportError( "Failed to open file " + pFile + ".");
* }
*
* // generate a XML reader for it
* std::unique_ptr<CIrrXML_IOStreamReader> mIOWrapper( new CIrrXML_IOStreamReader( file.get()));
* mReader = irr::io::createIrrXMLReader( mIOWrapper.get());
* if( !mReader) {
* ThrowException( "xxxx: Unable to open file.");
* }
*

Constructor & Destructor Documentation

Assimp::CIrrXML_IOStreamReader::CIrrXML_IOStreamReader ( IOStream _stream)
inlineexplicit

Construction from an existing IOStream.

virtual Assimp::CIrrXML_IOStreamReader::~CIrrXML_IOStreamReader ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

virtual long Assimp::CIrrXML_IOStreamReader::getSize ( ) const
inlinevirtual

Returns size of file in bytes.

virtual int Assimp::CIrrXML_IOStreamReader::read ( void buffer,
int  sizeToRead 
)
inlinevirtual

Reads an amount of bytes from the file.

Parameters
buffer,:Pointer to output buffer.
sizeToRead,:Amount of bytes to read
Returns
Returns how much bytes were read.

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