irrXMLWrapper.h 906 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef AI_IRRXML_WRAPPER_H_INCLUDED
  2. #define AI_IRRXML_WRAPPER_H_INCLUDED
  3. #include "irrXML.h"
  4. #include "./../../include/IOStream.h"
  5. namespace Assimp {
  6. using namespace irr;
  7. using namespace irr::io;
  8. class CIrrXML_IOStreamReader
  9. {
  10. public:
  11. CIrrXML_IOStreamReader(IOStream* _stream)
  12. : stream (_stream)
  13. {}
  14. //! virtual destructor
  15. virtual ~CIrrXML_IOStreamReader() {};
  16. //! Reads an amount of bytes from the file.
  17. /** \param buffer: Pointer to buffer where to read bytes will be written to.
  18. \param sizeToRead: Amount of bytes to read from the file.
  19. \return Returns how much bytes were read. */
  20. virtual int read(void* buffer, int sizeToRead)
  21. {
  22. return (int)stream->Read(buffer,1,sizeToRead);
  23. }
  24. //! Returns size of file in bytes
  25. virtual int getSize()
  26. {
  27. return (int)stream->FileSize();
  28. }
  29. private:
  30. IOStream* stream;
  31. };
  32. } // ! Assimp
  33. #endif