Class IOSystem
Defines a custom IO handler that can be registered to an importer that will handle I/O for assimp. This includes searching/opening files to read during import, and creating/writing to files during export.
Implements
Inherited Members
Namespace: SharpAssimp
Assembly: SharpAssimp.dll
Syntax
public abstract class IOSystem : IDisposable
Constructors
| Edit this page View SourceIOSystem()
Constructs a new IOSystem.
Declaration
public IOSystem()
IOSystem(bool)
Constructs a new IOSystem.
Declaration
protected IOSystem(bool initialize = true)
Parameters
Type | Name | Description |
---|---|---|
bool | initialize | True if initialize should be immediately called with the default callbacks. Set this to false if your subclass requires a different way to setup the function pointers. |
Properties
| Edit this page View SourceIsDisposed
Gets whether or not this IOSystem has been disposed.
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
bool |
OpenFileCount
Gets the number of currently opened streams.
Declaration
public int OpenFileCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceCloseAllFiles()
Closes all outstanding streams owned by this IOSystem.
Declaration
public virtual void CloseAllFiles()
CloseFile(IOStream)
Closes a stream that is owned by this IOSystem.
Declaration
public virtual void CloseFile(IOStream stream)
Parameters
Type | Name | Description |
---|---|---|
IOStream | stream | Stream to close |
Dispose()
Disposes of all resources held by this object.
Declaration
public void Dispose()
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | True to release both managed and unmanaged resources; False to release only unmanaged resources. |
~IOSystem()
Finalizes an instance of the IOSystem class.
Declaration
protected ~IOSystem()
Initialize(AiFileOpenProc, AiFileCloseProc, nint)
Initializes the system by setting up native pointers for Assimp to the specified functions.
Declaration
protected void Initialize(AiFileOpenProc fileOpenProc, AiFileCloseProc fileCloseProc, nint userData = 0)
Parameters
Type | Name | Description |
---|---|---|
AiFileOpenProc | fileOpenProc | Handles open file requests. |
AiFileCloseProc | fileCloseProc | Handles close file requests. |
nint | userData | Additional user data, if any. |
OnAiFileCloseProc(nint, nint)
Callback for Assimp that handles a file being closed.
Declaration
protected void OnAiFileCloseProc(nint fileIO, nint file)
Parameters
Type | Name | Description |
---|---|---|
nint | fileIO | |
nint | file |
OnAiFileOpenProc(nint, string, string)
Callback for Assimp that handles a file being opened.
Declaration
protected nint OnAiFileOpenProc(nint fileIO, string pathToFile, string mode)
Parameters
Type | Name | Description |
---|---|---|
nint | fileIO | |
string | pathToFile | |
string | mode |
Returns
Type | Description |
---|---|
nint |
OpenFile(string, FileIOMode)
Opens a stream to a file.
Declaration
public abstract IOStream OpenFile(string pathToFile, FileIOMode fileMode)
Parameters
Type | Name | Description |
---|---|---|
string | pathToFile | Path to the file |
FileIOMode | fileMode | Desired file access mode |
Returns
Type | Description |
---|---|
IOStream | The IO stream |