2009-01-18 23:48:25 +00:00
|
|
|
|
|
|
|
#ifndef INCLUDED_AI_IRRXML_WRAPPER
|
|
|
|
#define INCLUDED_AI_IRRXML_WRAPPER
|
|
|
|
|
|
|
|
// some long includes ....
|
|
|
|
#include "./../contrib/irrXML/irrXML.h"
|
|
|
|
#include "./../include/IOStream.h"
|
|
|
|
|
2009-03-03 15:43:26 +00:00
|
|
|
namespace Assimp
|
|
|
|
{
|
2009-01-18 23:48:25 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------
|
|
|
|
/** @brief Utility class to make IrrXML work together with our custom IO system
|
|
|
|
*
|
|
|
|
* See the IrrXML docs for more details.
|
|
|
|
*/
|
2009-03-03 15:43:26 +00:00
|
|
|
class CIrrXML_IOStreamReader : public irr::io::IFileReadCallBack
|
2009-01-18 23:48:25 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! Construction from an existing IOStream
|
|
|
|
CIrrXML_IOStreamReader(IOStream* _stream)
|
|
|
|
: stream (_stream)
|
|
|
|
{}
|
|
|
|
|
|
|
|
//! Virtual destructor
|
|
|
|
virtual ~CIrrXML_IOStreamReader() {};
|
|
|
|
|
|
|
|
//! Reads an amount of bytes from the file.
|
|
|
|
/** @param buffer: Pointer to output buffer.
|
|
|
|
* @param sizeToRead: Amount of bytes to read
|
|
|
|
* @return Returns how much bytes were read.
|
|
|
|
*/
|
|
|
|
virtual int read(void* buffer, int sizeToRead) {
|
|
|
|
return (int)stream->Read(buffer,1,sizeToRead);
|
|
|
|
}
|
|
|
|
|
|
|
|
//! Returns size of file in bytes
|
|
|
|
virtual int getSize() {
|
|
|
|
return (int)stream->FileSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
IOStream* stream;
|
|
|
|
}; // ! class CIrrXML_IOStreamReader
|
|
|
|
|
|
|
|
} // ! Assimp
|
|
|
|
|
|
|
|
#endif // !! INCLUDED_AI_IRRXML_WRAPPER
|