Merge pull request #573 from jaimemachado/master

Creating the functionality to list all Importer descriptions and the …
pull/574/head
Alexander Gessler 2015-05-26 19:37:21 +02:00
commit 9a9a121b2d
3 changed files with 30 additions and 1 deletions

View File

@ -423,6 +423,21 @@ const char* aiGetErrorString()
return gLastErrorString.c_str(); return gLastErrorString.c_str();
} }
// -----------------------------------------------------------------------------------------------
// Return the description of a importer given its index
const aiImporterDesc* aiGetImportFormatDescription( size_t pIndex)
{
return Importer().GetImporterInfo(pIndex);
}
// -----------------------------------------------------------------------------------------------
// Return the number of importers
size_t aiGetImportFormatCount(void)
{
return Importer().GetImporterCount();
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Returns the error text of the last failed import process. // Returns the error text of the last failed import process.
aiBool aiIsExtensionSupported(const char* szExtension) aiBool aiIsExtensionSupported(const char* szExtension)

View File

@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_ASSIMP_H_INC #ifndef AI_ASSIMP_H_INC
#define AI_ASSIMP_H_INC #define AI_ASSIMP_H_INC
#include "types.h" #include "types.h"
#include <assimp/importerdesc.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -539,7 +540,20 @@ ASSIMP_API void aiIdentityMatrix3(
ASSIMP_API void aiIdentityMatrix4( ASSIMP_API void aiIdentityMatrix4(
C_STRUCT aiMatrix4x4* mat); C_STRUCT aiMatrix4x4* mat);
// --------------------------------------------------------------------------------
/** Returns the number of import file formats available in the current Assimp build.
* Use aiGetImportFormatDescription() to retrieve infos of a specific import format.
*/
ASSIMP_API size_t aiGetImportFormatCount(void);
// --------------------------------------------------------------------------------
/** Returns a description of the nth import file format. Use #aiGetImportFormatCount()
* to learn how many import formats are supported.
* @param pIndex Index of the import format to retrieve information for. Valid range is
* 0 to #aiGetImportFormatCount()
* @return A description of that specific import format. NULL if pIndex is out of range.
*/
ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImportFormatDescription( size_t pIndex);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -138,6 +138,6 @@ Will return a NULL-pointer if no assigned importer desc. was found for the given
\param extension [in] The extension to look for \param extension [in] The extension to look for
\return A pointer showing to the ImporterDesc, \see aiImporterDesc. \return A pointer showing to the ImporterDesc, \see aiImporterDesc.
*/ */
ASSIMP_API C_STRUCT const aiImporterDesc* aiGetImporterDesc( const char *extension ); ASSIMP_API const C_STRUCT aiImporterDesc* aiGetImporterDesc( const char *extension );
#endif #endif