SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLAssimpIOStream Class Reference

#include <SLAssimpIOSystem.h>

Inherits Assimp::IOStream.

Public Member Functions

 SLAssimpIOStream (SLIOStream *stream)
 
size_t Read (void *pvBuffer, size_t pSize, size_t pCount) override
 
size_t Write (const void *pvBuffer, size_t pSize, size_t pCount) override
 
aiReturn Seek (size_t pOffset, aiOrigin pOrigin) override
 
size_t Tell () const override
 
size_t FileSize () const override
 
void Flush () override
 
SLIOStreamstream ()
 

Private Attributes

SLIOStream_stream
 

Detailed Description

Definition at line 18 of file SLAssimpIOSystem.h.

Constructor & Destructor Documentation

◆ SLAssimpIOStream()

SLAssimpIOStream::SLAssimpIOStream ( SLIOStream stream)

Definition at line 13 of file SLAssimpIOSystem.cpp.

14  : _stream(stream)
15 {
16 }
SLIOStream * stream()
SLIOStream * _stream

Member Function Documentation

◆ FileSize()

size_t SLAssimpIOStream::FileSize ( ) const
override

Definition at line 52 of file SLAssimpIOSystem.cpp.

53 {
54  return _stream->size();
55 }
virtual size_t size()
Definition: SLFileStorage.h:76

◆ Flush()

void SLAssimpIOStream::Flush ( )
override

Definition at line 57 of file SLAssimpIOSystem.cpp.

58 {
59  _stream->flush();
60 }
virtual void flush()
Definition: SLFileStorage.h:77

◆ Read()

size_t SLAssimpIOStream::Read ( void pvBuffer,
size_t  pSize,
size_t  pCount 
)
override

Definition at line 18 of file SLAssimpIOSystem.cpp.

19 {
20  char* dest = (char*)pvBuffer;
21  size_t totalSize = pCount * pSize;
22  size_t sizeRead = _stream->read(dest, totalSize);
23  return sizeRead / pSize;
24 }
virtual size_t read(void *buffer, size_t size)
Definition: SLFileStorage.h:72

◆ Seek()

aiReturn SLAssimpIOStream::Seek ( size_t  pOffset,
aiOrigin  pOrigin 
)
override

Definition at line 33 of file SLAssimpIOSystem.cpp.

34 {
36  if (pOrigin == aiOrigin_SET)
37  streamOrigin = SLIOStream::IOO_beg;
38  else if (pOrigin == aiOrigin_CUR)
39  streamOrigin = SLIOStream::IOO_cur;
40  else if (pOrigin == aiOrigin_END)
41  streamOrigin = SLIOStream::IOO_end;
42 
43  bool successful = _stream->seek(pOffset, streamOrigin);
44  return successful ? aiReturn_SUCCESS : aiReturn_FAILURE;
45 }
virtual bool seek(size_t offset, Origin origin)
Definition: SLFileStorage.h:75

◆ stream()

SLIOStream* SLAssimpIOStream::stream ( )
inline

Definition at line 29 of file SLAssimpIOSystem.h.

29 { return _stream; }

◆ Tell()

size_t SLAssimpIOStream::Tell ( ) const
override

Definition at line 47 of file SLAssimpIOSystem.cpp.

48 {
49  return _stream->tell();
50 }
virtual size_t tell()
Definition: SLFileStorage.h:74

◆ Write()

size_t SLAssimpIOStream::Write ( const void pvBuffer,
size_t  pSize,
size_t  pCount 
)
override

Definition at line 26 of file SLAssimpIOSystem.cpp.

27 {
28  const char* dest = (const char*)pvBuffer;
29  size_t totalSize = pCount * pSize;
30  return _stream->write(dest, totalSize);
31 }
virtual size_t write(const void *buffer, size_t size)
Definition: SLFileStorage.h:73

Member Data Documentation

◆ _stream

SLIOStream* SLAssimpIOStream::_stream
private

Definition at line 32 of file SLAssimpIOSystem.h.


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