Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
|
CPP-API: Interface to the file system. More...
#include <IOSystem.hpp>
Inherits Intern::AllocateFromAssimpHeap.
Inherited by Assimp::BlobIOSystem, Assimp::DefaultIOSystem, Assimp::MemoryIOSystem, and Assimp::ZipArchiveIOSystem.
Public Member Functions | |
virtual bool | ChangeDirectory (const std::string &path) |
Will change the current directory to the given path. | |
virtual void | Close (IOStream *pFile)=0 |
Closes the given file and releases all resources associated with it. | |
virtual bool | ComparePaths (const char *one, const char *second) const |
Compares two paths and check whether the point to identical files. | |
bool | ComparePaths (const std::string &one, const std::string &second) const |
For backward compatibility. | |
virtual bool | CreateDirectory (const std::string &path) |
CReates an new directory at the given path. | |
virtual const std::string & | CurrentDirectory () const |
Returns the top directory from the stack. | |
virtual bool | DeleteFile (const std::string &file) |
Will delete the given file. | |
virtual bool | Exists (const char *pFile) const =0 |
Tests for the existence of a file at the given path. | |
AI_FORCE_INLINE bool | Exists (const std::string &pFile) const |
For backward compatibility. | |
virtual char | getOsSeparator () const =0 |
Returns the system specific directory separator. | |
IOSystem () AI_NO_EXCEPT=default | |
Default constructor. | |
virtual IOStream * | Open (const char *pFile, const char *pMode="rb")=0 |
Open a new file with a given path. | |
IOStream * | Open (const std::string &pFile, const std::string &pMode=std::string("rb")) |
For backward compatibility. | |
virtual bool | PopDirectory () |
Pops the top directory from the stack. | |
virtual bool | PushDirectory (const std::string &path) |
Pushes a new directory onto the directory stack. | |
virtual size_t | StackSize () const |
Returns the number of directories stored on the stack. | |
virtual | ~IOSystem ()=default |
Virtual destructor. | |
CPP-API: Interface to the file system.
Derive an own implementation from this interface to supply custom file handling to the importer library. If you implement this interface, you also want to supply a custom implementation for IOStream.
|
default |
Default constructor.
Create an instance of your derived class and assign it to an Assimp::Importer instance by calling Importer::SetIOHandler().
|
virtualdefault |
|
virtual |
Will change the current directory to the given path.
path | [in] The path to change to. |
Reimplemented in Assimp::MemoryIOSystem.
Closes the given file and releases all resources associated with it.
pFile | The file instance previously created by Open(). |
Implemented in Assimp::BlobIOSystem, Assimp::DefaultIOSystem, Assimp::MemoryIOSystem, and Assimp::ZipArchiveIOSystem.
Compares two paths and check whether the point to identical files.
The dummy implementation of this virtual member performs a case-insensitive comparison of the given strings. The default IO system implementation uses OS mechanisms to convert relative into absolute paths, so the result can be trusted.
one | First file |
second | Second file |
Reimplemented in Assimp::DefaultIOSystem, and Assimp::MemoryIOSystem.
|
inline |
For backward compatibility.
|
virtual |
CReates an new directory at the given path.
path | [in] The path to create. |
Reimplemented in Assimp::MemoryIOSystem.
Returns the top directory from the stack.
Reimplemented in Assimp::MemoryIOSystem.
|
virtual |
Will delete the given file.
file | [in] The filename |
Reimplemented in Assimp::MemoryIOSystem.
Tests for the existence of a file at the given path.
pFile | Path to the file |
Implemented in Assimp::BlobIOSystem, Assimp::DefaultIOSystem, Assimp::MemoryIOSystem, and Assimp::ZipArchiveIOSystem.
AI_FORCE_INLINE bool Assimp::IOSystem::Exists | ( | const std::string & | pFile | ) | const |
For backward compatibility.
Returns the system specific directory separator.
Implemented in Assimp::BlobIOSystem, Assimp::DefaultIOSystem, Assimp::MemoryIOSystem, and Assimp::ZipArchiveIOSystem.
|
pure virtual |
Open a new file with a given path.
When the access to the file is finished, call Close() to release all associated resources (or the virtual dtor of the IOStream).
pFile | Path to the file |
pMode | Desired file I/O mode. Required are: "wb", "w", "wt", "rb", "r", "rt". |
Implemented in Assimp::BlobIOSystem, Assimp::DefaultIOSystem, Assimp::MemoryIOSystem, and Assimp::ZipArchiveIOSystem.
|
inline |
For backward compatibility.
|
virtual |
Pops the top directory from the stack.
Reimplemented in Assimp::MemoryIOSystem.
|
virtual |
Pushes a new directory onto the directory stack.
path | Path to push onto the stack. |
Reimplemented in Assimp::MemoryIOSystem.
|
virtual |
Returns the number of directories stored on the stack.
Reimplemented in Assimp::MemoryIOSystem.