SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLAssimpIOSystem.h
Go to the documentation of this file.
1 /**
2  * \file SLAssimpIOStream.h
3  * \date May 2024
4  * \authors Marino von Wattenwyl
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef SLPROJECT_SLASSIMPIOSYSTEM_H
11 #define SLPROJECT_SLASSIMPIOSYSTEM_H
12 
13 #include <assimp/IOStream.hpp>
14 #include <assimp/IOSystem.hpp>
15 #include "SLFileStorage.h"
16 
17 //-----------------------------------------------------------------------------
18 class SLAssimpIOStream : public Assimp::IOStream
19 {
20 public:
22  size_t Read(void* pvBuffer, size_t pSize, size_t pCount) override;
23  size_t Write(const void* pvBuffer, size_t pSize, size_t pCount) override;
24  aiReturn Seek(size_t pOffset, aiOrigin pOrigin) override;
25  size_t Tell() const override;
26  size_t FileSize() const override;
27  void Flush() override;
28 
29  SLIOStream* stream() { return _stream; }
30 
31 private:
33 };
34 //-----------------------------------------------------------------------------
35 class SLAssimpIOSystem : public Assimp::IOSystem
36 {
37 public:
38  bool Exists(const char* pFile) const override;
39  char getOsSeparator() const override;
40  Assimp::IOStream* Open(const char* pFile, const char* pMode) override;
41  void Close(Assimp::IOStream* pFile) override;
42 };
43 //-----------------------------------------------------------------------------
44 #endif // SLPROJECT_SLASSIMPIOSYSTEM_H
void Flush() override
aiReturn Seek(size_t pOffset, aiOrigin pOrigin) override
size_t FileSize() const override
SLAssimpIOStream(SLIOStream *stream)
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
SLIOStream * _stream
size_t Tell() const override
Assimp::IOStream * Open(const char *pFile, const char *pMode) override
char getOsSeparator() const override
bool Exists(const char *pFile) const override
void Close(Assimp::IOStream *pFile) override
Interface for accessing external data using streams.
Definition: SLFileStorage.h:62