Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp::IOStream Class Referenceabstract

CPP-API: Class to handle file I/O for C++. More...

#include <IOStream.hpp>

Inherits Intern::AllocateFromAssimpHeap.

Inherited by Assimp::BlobIOStream, Assimp::DefaultIOStream, and Assimp::MemoryIOStream.

Public Member Functions

virtual size_t FileSize () const =0
 Returns filesize Returns the filesize. More...
 
virtual void Flush ()=0
 Flush the contents of the file buffer (for writers) See fflush() for more details. More...
 
virtual size_t Read (void *pvBuffer, size_t pSize, size_t pCount)=0
 Read from the file. More...
 
virtual aiReturn Seek (size_t pOffset, aiOrigin pOrigin)=0
 Set the read/write cursor of the file. More...
 
virtual size_t Tell () const =0
 Get the current position of the read/write cursor. More...
 
virtual size_t Write (const void *pvBuffer, size_t pSize, size_t pCount)=0
 Write to the file. More...
 
virtual ~IOStream ()
 Destructor. More...
 

Protected Member Functions

 IOStream () AI_NO_EXCEPT
 Constructor protected, use IOSystem::Open() to create an instance. More...
 

Detailed Description

CPP-API: Class to handle file I/O for C++.

Derive an own implementation from this interface to provide custom IO handling to the Importer. If you implement this interface, be sure to also provide an implementation for IOSystem that creates instances of your custom IO class.

Constructor & Destructor Documentation

◆ IOStream()

AI_FORCE_INLINE Assimp::IOStream::IOStream ( )
protected

Constructor protected, use IOSystem::Open() to create an instance.

class IOStream

◆ ~IOStream()

AI_FORCE_INLINE Assimp::IOStream::~IOStream ( )
virtualdefault

Destructor.

Deleting the object closes the underlying file, alternatively you may use IOSystem::Close() to release the file.

Member Function Documentation

◆ FileSize()

virtual size_t Assimp::IOStream::FileSize ( ) const
pure virtual

Returns filesize Returns the filesize.

Implemented in Assimp::MemoryIOStream, Assimp::BlobIOStream, and Assimp::DefaultIOStream.

◆ Flush()

virtual void Assimp::IOStream::Flush ( )
pure virtual

Flush the contents of the file buffer (for writers) See fflush() for more details.

Implemented in Assimp::MemoryIOStream, Assimp::BlobIOStream, and Assimp::DefaultIOStream.

◆ Read()

virtual size_t Assimp::IOStream::Read ( void *  pvBuffer,
size_t  pSize,
size_t  pCount 
)
pure virtual

Read from the file.

See fread() for more details This fails for write-only files

Implemented in Assimp::BlobIOStream, Assimp::MemoryIOStream, and Assimp::DefaultIOStream.

◆ Seek()

virtual aiReturn Assimp::IOStream::Seek ( size_t  pOffset,
aiOrigin  pOrigin 
)
pure virtual

Set the read/write cursor of the file.

Note that the offset is negative for aiOrigin_END. See fseek() for more details

Implemented in Assimp::MemoryIOStream, Assimp::BlobIOStream, and Assimp::DefaultIOStream.

◆ Tell()

virtual size_t Assimp::IOStream::Tell ( ) const
pure virtual

Get the current position of the read/write cursor.

See ftell() for more details

Implemented in Assimp::MemoryIOStream, Assimp::BlobIOStream, and Assimp::DefaultIOStream.

◆ Write()

virtual size_t Assimp::IOStream::Write ( const void *  pvBuffer,
size_t  pSize,
size_t  pCount 
)
pure virtual

Write to the file.

See fwrite() for more details This fails for read-only files

Implemented in Assimp::MemoryIOStream, Assimp::BlobIOStream, and Assimp::DefaultIOStream.


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