11 #ifndef SLPROJECT_SLASSIMPIOSYSTEM_H
12 #define SLPROJECT_SLASSIMPIOSYSTEM_H
14 #include <assimp/IOStream.hpp>
15 #include <assimp/IOSystem.hpp>
32 size_t Read(
void* pvBuffer,
size_t pSize,
size_t pCount)
override;
35 size_t Write(
const void* pvBuffer,
size_t pSize,
size_t pCount)
override;
38 aiReturn
Seek(
size_t pOffset, aiOrigin pOrigin)
override;
41 size_t Tell()
const override;
47 void Flush()
override;
64 bool Exists(
const char* pFile)
const override;
74 Assimp::IOStream*
Open(
const char* pFile,
const char* pMode)
override;
77 void Close(Assimp::IOStream* pFile)
override;
Adapts a single SLIOStream to the stream interface Assimp expects.
void Flush() override
Flushes the wrapped stream.
aiReturn Seek(size_t pOffset, aiOrigin pOrigin) override
Moves the read position to pOffset relative to pOrigin.
size_t FileSize() const override
Returns the total size of the stream in bytes.
SLAssimpIOStream(SLIOStream *stream)
SLIOStream * stream()
Returns the wrapped SLProject stream.
size_t Read(void *pvBuffer, size_t pSize, size_t pCount) override
Reads pCount records of pSize bytes into pvBuffer, returns records read.
size_t Write(const void *pvBuffer, size_t pSize, size_t pCount) override
Writes pCount records of pSize bytes from pvBuffer, returns bytes written.
SLIOStream * _stream
Wrapped SLProject stream, not owned.
size_t Tell() const override
Returns the current read position in bytes.
Assimp file system handler backed by SLFileStorage.
Assimp::IOStream * Open(const char *pFile, const char *pMode) override
Opens pFile through SLFileStorage and wraps it in an SLAssimpIOStream.
char getOsSeparator() const override
Returns the path separator, always '/' for SLProject paths.
bool Exists(const char *pFile) const override
Returns true if pFile can be opened through SLFileStorage.
void Close(Assimp::IOStream *pFile) override
Closes the stream and deletes the adapter created by Open.
Interface for accessing external data using streams.