miniassimp

view include/miniassimp/Importer.hpp @ 0:879c81d94345

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Jan 2019 18:19:26 +0200
parents
children
line source
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
6 Copyright (c) 2006-2018, assimp team
10 All rights reserved.
12 Redistribution and use of this software in source and binary forms,
13 with or without modification, are permitted provided that the following
14 conditions are met:
16 * Redistributions of source code must retain the above
17 copyright notice, this list of conditions and the
18 following disclaimer.
20 * Redistributions in binary form must reproduce the above
21 copyright notice, this list of conditions and the
22 following disclaimer in the documentation and/or other
23 materials provided with the distribution.
25 * Neither the name of the assimp team, nor the names of its
26 contributors may be used to endorse or promote products
27 derived from this software without specific prior
28 written permission of the assimp team.
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 ---------------------------------------------------------------------------
42 */
44 /** @file Importer.hpp
45 * @brief Defines the C++-API to the Open Asset Import Library.
46 */
47 #pragma once
48 #ifndef AI_ASSIMP_HPP_INC
49 #define AI_ASSIMP_HPP_INC
51 #ifndef __cplusplus
52 # error This header requires C++ to be used. Use assimp.h for plain C.
53 #endif // __cplusplus
55 // Public ASSIMP data structures
56 #include <miniassimp/types.h>
58 namespace Assimp {
59 // =======================================================================
60 // Public interface to Assimp
61 class Importer;
62 class IOStream;
63 class IOSystem;
64 class ProgressHandler;
66 // =======================================================================
67 // Plugin development
68 //
69 // Include the following headers for the declarations:
70 // BaseImporter.h
71 // BaseProcess.h
72 class BaseImporter;
73 class BaseProcess;
74 class SharedPostProcessInfo;
75 class BatchLoader;
77 // =======================================================================
78 // Holy stuff, only for members of the high council of the Jedi.
79 class ImporterPimpl;
80 } //! namespace Assimp
82 #define AI_PROPERTY_WAS_NOT_EXISTING 0xffffffff
84 struct aiScene;
86 // importerdesc.h
87 struct aiImporterDesc;
89 /** @namespace Assimp Assimp's CPP-API and all internal APIs */
90 namespace Assimp {
92 // ----------------------------------------------------------------------------------
93 /** CPP-API: The Importer class forms an C++ interface to the functionality of the
94 * Open Asset Import Library.
95 *
96 * Create an object of this class and call ReadFile() to import a file.
97 * If the import succeeds, the function returns a pointer to the imported data.
98 * The data remains property of the object, it is intended to be accessed
99 * read-only. The imported data will be destroyed along with the Importer
100 * object. If the import fails, ReadFile() returns a NULL pointer. In this
101 * case you can retrieve a human-readable error description be calling
102 * GetErrorString(). You can call ReadFile() multiple times with a single Importer
103 * instance. Actually, constructing Importer objects involves quite many
104 * allocations and may take some time, so it's better to reuse them as often as
105 * possible.
106 *
107 * If you need the Importer to do custom file handling to access the files,
108 * implement IOSystem and IOStream and supply an instance of your custom
109 * IOSystem implementation by calling SetIOHandler() before calling ReadFile().
110 * If you do not assign a custion IO handler, a default handler using the
111 * standard C++ IO logic will be used.
112 *
113 * @note One Importer instance is not thread-safe. If you use multiple
114 * threads for loading, each thread should maintain its own Importer instance.
115 */
116 class ASSIMP_API Importer {
117 private:
118 Importer(const Importer& other);
119 Importer &operator=(const Importer &);
121 public:
122 /**
123 * @brief The upper limit for hints.
124 */
125 static const unsigned int MaxLenHint = 200;
127 public:
129 // -------------------------------------------------------------------
130 /** Constructor. Creates an empty importer object.
131 *
132 * Call ReadFile() to start the import process. The configuration
133 * property table is initially empty.
134 */
135 Importer();
137 // -------------------------------------------------------------------
138 /** Destructor. The object kept ownership of the imported data,
139 * which now will be destroyed along with the object.
140 */
141 ~Importer();
144 // -------------------------------------------------------------------
145 /** Registers a new loader.
146 *
147 * @param pImp Importer to be added. The Importer instance takes
148 * ownership of the pointer, so it will be automatically deleted
149 * with the Importer instance.
150 * @return AI_SUCCESS if the loader has been added. The registration
151 * fails if there is already a loader for a specific file extension.
152 */
153 aiReturn RegisterLoader(BaseImporter* pImp);
155 // -------------------------------------------------------------------
156 /** Unregisters a loader.
157 *
158 * @param pImp Importer to be unregistered.
159 * @return AI_SUCCESS if the loader has been removed. The function
160 * fails if the loader is currently in use (this could happen
161 * if the #Importer instance is used by more than one thread) or
162 * if it has not yet been registered.
163 */
164 aiReturn UnregisterLoader(BaseImporter* pImp);
166 // -------------------------------------------------------------------
167 /** Registers a new post-process step.
168 *
169 * At the moment, there's a small limitation: new post processing
170 * steps are added to end of the list, or in other words, executed
171 * last, after all built-in steps.
172 * @param pImp Post-process step to be added. The Importer instance
173 * takes ownership of the pointer, so it will be automatically
174 * deleted with the Importer instance.
175 * @return AI_SUCCESS if the step has been added correctly.
176 */
177 aiReturn RegisterPPStep(BaseProcess* pImp);
179 // -------------------------------------------------------------------
180 /** Unregisters a post-process step.
181 *
182 * @param pImp Step to be unregistered.
183 * @return AI_SUCCESS if the step has been removed. The function
184 * fails if the step is currently in use (this could happen
185 * if the #Importer instance is used by more than one thread) or
186 * if it has not yet been registered.
187 */
188 aiReturn UnregisterPPStep(BaseProcess* pImp);
190 // -------------------------------------------------------------------
191 /** Set an integer configuration property.
192 * @param szName Name of the property. All supported properties
193 * are defined in the aiConfig.g header (all constants share the
194 * prefix AI_CONFIG_XXX and are simple strings).
195 * @param iValue New value of the property
196 * @return true if the property was set before. The new value replaces
197 * the previous value in this case.
198 * @note Property of different types (float, int, string ..) are kept
199 * on different stacks, so calling SetPropertyInteger() for a
200 * floating-point property has no effect - the loader will call
201 * GetPropertyFloat() to read the property, but it won't be there.
202 */
203 bool SetPropertyInteger(const char* szName, int iValue);
205 // -------------------------------------------------------------------
206 /** Set a boolean configuration property. Boolean properties
207 * are stored on the integer stack internally so it's possible
208 * to set them via #SetPropertyBool and query them with
209 * #GetPropertyBool and vice versa.
210 * @see SetPropertyInteger()
211 */
212 bool SetPropertyBool(const char* szName, bool value) {
213 return SetPropertyInteger(szName,value);
214 }
216 // -------------------------------------------------------------------
217 /** Set a floating-point configuration property.
218 * @see SetPropertyInteger()
219 */
220 bool SetPropertyFloat(const char* szName, ai_real fValue);
222 // -------------------------------------------------------------------
223 /** Set a string configuration property.
224 * @see SetPropertyInteger()
225 */
226 bool SetPropertyString(const char* szName, const std::string& sValue);
228 // -------------------------------------------------------------------
229 /** Set a matrix configuration property.
230 * @see SetPropertyInteger()
231 */
232 bool SetPropertyMatrix(const char* szName, const aiMatrix4x4& sValue);
234 // -------------------------------------------------------------------
235 /** Get a configuration property.
236 * @param szName Name of the property. All supported properties
237 * are defined in the aiConfig.g header (all constants share the
238 * prefix AI_CONFIG_XXX).
239 * @param iErrorReturn Value that is returned if the property
240 * is not found.
241 * @return Current value of the property
242 * @note Property of different types (float, int, string ..) are kept
243 * on different lists, so calling SetPropertyInteger() for a
244 * floating-point property has no effect - the loader will call
245 * GetPropertyFloat() to read the property, but it won't be there.
246 */
247 int GetPropertyInteger(const char* szName,
248 int iErrorReturn = 0xffffffff) const;
250 // -------------------------------------------------------------------
251 /** Get a boolean configuration property. Boolean properties
252 * are stored on the integer stack internally so it's possible
253 * to set them via #SetPropertyBool and query them with
254 * #GetPropertyBool and vice versa.
255 * @see GetPropertyInteger()
256 */
257 bool GetPropertyBool(const char* szName, bool bErrorReturn = false) const {
258 return GetPropertyInteger(szName,bErrorReturn)!=0;
259 }
261 // -------------------------------------------------------------------
262 /** Get a floating-point configuration property
263 * @see GetPropertyInteger()
264 */
265 ai_real GetPropertyFloat(const char* szName,
266 ai_real fErrorReturn = 10e10) const;
268 // -------------------------------------------------------------------
269 /** Get a string configuration property
270 *
271 * The return value remains valid until the property is modified.
272 * @see GetPropertyInteger()
273 */
274 const std::string GetPropertyString(const char* szName,
275 const std::string& sErrorReturn = "") const;
277 // -------------------------------------------------------------------
278 /** Get a matrix configuration property
279 *
280 * The return value remains valid until the property is modified.
281 * @see GetPropertyInteger()
282 */
283 const aiMatrix4x4 GetPropertyMatrix(const char* szName,
284 const aiMatrix4x4& sErrorReturn = aiMatrix4x4()) const;
286 // -------------------------------------------------------------------
287 /** Supplies a custom IO handler to the importer to use to open and
288 * access files. If you need the importer to use custom IO logic to
289 * access the files, you need to provide a custom implementation of
290 * IOSystem and IOFile to the importer. Then create an instance of
291 * your custom IOSystem implementation and supply it by this function.
292 *
293 * The Importer takes ownership of the object and will destroy it
294 * afterwards. The previously assigned handler will be deleted.
295 * Pass NULL to take again ownership of your IOSystem and reset Assimp
296 * to use its default implementation.
297 *
298 * @param pIOHandler The IO handler to be used in all file accesses
299 * of the Importer.
300 */
301 void SetIOHandler( IOSystem* pIOHandler);
303 // -------------------------------------------------------------------
304 /** Retrieves the IO handler that is currently set.
305 * You can use #IsDefaultIOHandler() to check whether the returned
306 * interface is the default IO handler provided by ASSIMP. The default
307 * handler is active as long the application doesn't supply its own
308 * custom IO handler via #SetIOHandler().
309 * @return A valid IOSystem interface, never NULL.
310 */
311 IOSystem* GetIOHandler() const;
313 // -------------------------------------------------------------------
314 /** Checks whether a default IO handler is active
315 * A default handler is active as long the application doesn't
316 * supply its own custom IO handler via #SetIOHandler().
317 * @return true by default
318 */
319 bool IsDefaultIOHandler() const;
321 // -------------------------------------------------------------------
322 /** Supplies a custom progress handler to the importer. This
323 * interface exposes an #Update() callback, which is called
324 * more or less periodically (please don't sue us if it
325 * isn't as periodically as you'd like it to have ...).
326 * This can be used to implement progress bars and loading
327 * timeouts.
328 * @param pHandler Progress callback interface. Pass NULL to
329 * disable progress reporting.
330 * @note Progress handlers can be used to abort the loading
331 * at almost any time.*/
332 void SetProgressHandler ( ProgressHandler* pHandler );
334 // -------------------------------------------------------------------
335 /** Retrieves the progress handler that is currently set.
336 * You can use #IsDefaultProgressHandler() to check whether the returned
337 * interface is the default handler provided by ASSIMP. The default
338 * handler is active as long the application doesn't supply its own
339 * custom handler via #SetProgressHandler().
340 * @return A valid ProgressHandler interface, never NULL.
341 */
342 ProgressHandler* GetProgressHandler() const;
344 // -------------------------------------------------------------------
345 /** Checks whether a default progress handler is active
346 * A default handler is active as long the application doesn't
347 * supply its own custom progress handler via #SetProgressHandler().
348 * @return true by default
349 */
350 bool IsDefaultProgressHandler() const;
352 // -------------------------------------------------------------------
353 /** @brief Check whether a given set of post-processing flags
354 * is supported.
355 *
356 * Some flags are mutually exclusive, others are probably
357 * not available because your excluded them from your
358 * Assimp builds. Calling this function is recommended if
359 * you're unsure.
360 *
361 * @param pFlags Bitwise combination of the aiPostProcess flags.
362 * @return true if this flag combination is fine.
363 */
364 bool ValidateFlags(unsigned int pFlags) const;
366 // -------------------------------------------------------------------
367 /** Reads the given file and returns its contents if successful.
368 *
369 * If the call succeeds, the contents of the file are returned as a
370 * pointer to an aiScene object. The returned data is intended to be
371 * read-only, the importer object keeps ownership of the data and will
372 * destroy it upon destruction. If the import fails, NULL is returned.
373 * A human-readable error description can be retrieved by calling
374 * GetErrorString(). The previous scene will be deleted during this call.
375 * @param pFile Path and filename to the file to be imported.
376 * @param pFlags Optional post processing steps to be executed after
377 * a successful import. Provide a bitwise combination of the
378 * #aiPostProcessSteps flags. If you wish to inspect the imported
379 * scene first in order to fine-tune your post-processing setup,
380 * consider to use #ApplyPostProcessing().
381 * @return A pointer to the imported data, NULL if the import failed.
382 * The pointer to the scene remains in possession of the Importer
383 * instance. Use GetOrphanedScene() to take ownership of it.
384 *
385 * @note Assimp is able to determine the file format of a file
386 * automatically.
387 */
388 const aiScene* ReadFile(
389 const char* pFile,
390 unsigned int pFlags);
392 // -------------------------------------------------------------------
393 /** Reads the given file from a memory buffer and returns its
394 * contents if successful.
395 *
396 * If the call succeeds, the contents of the file are returned as a
397 * pointer to an aiScene object. The returned data is intended to be
398 * read-only, the importer object keeps ownership of the data and will
399 * destroy it upon destruction. If the import fails, NULL is returned.
400 * A human-readable error description can be retrieved by calling
401 * GetErrorString(). The previous scene will be deleted during this call.
402 * Calling this method doesn't affect the active IOSystem.
403 * @param pBuffer Pointer to the file data
404 * @param pLength Length of pBuffer, in bytes
405 * @param pFlags Optional post processing steps to be executed after
406 * a successful import. Provide a bitwise combination of the
407 * #aiPostProcessSteps flags. If you wish to inspect the imported
408 * scene first in order to fine-tune your post-processing setup,
409 * consider to use #ApplyPostProcessing().
410 * @param pHint An additional hint to the library. If this is a non
411 * empty string, the library looks for a loader to support
412 * the file extension specified by pHint and passes the file to
413 * the first matching loader. If this loader is unable to completely
414 * the request, the library continues and tries to determine the
415 * file format on its own, a task that may or may not be successful.
416 * Check the return value, and you'll know ...
417 * @return A pointer to the imported data, NULL if the import failed.
418 * The pointer to the scene remains in possession of the Importer
419 * instance. Use GetOrphanedScene() to take ownership of it.
420 *
421 * @note This is a straightforward way to decode models from memory
422 * buffers, but it doesn't handle model formats that spread their
423 * data across multiple files or even directories. Examples include
424 * OBJ or MD3, which outsource parts of their material info into
425 * external scripts. If you need full functionality, provide
426 * a custom IOSystem to make Assimp find these files and use
427 * the regular ReadFile() API.
428 */
429 const aiScene* ReadFileFromMemory(
430 const void* pBuffer,
431 size_t pLength,
432 unsigned int pFlags,
433 const char* pHint = "");
435 // -------------------------------------------------------------------
436 /** Apply post-processing to an already-imported scene.
437 *
438 * This is strictly equivalent to calling #ReadFile() with the same
439 * flags. However, you can use this separate function to inspect
440 * the imported scene first to fine-tune your post-processing setup.
441 * @param pFlags Provide a bitwise combination of the
442 * #aiPostProcessSteps flags.
443 * @return A pointer to the post-processed data. This is still the
444 * same as the pointer returned by #ReadFile(). However, if
445 * post-processing fails, the scene could now be NULL.
446 * That's quite a rare case, post processing steps are not really
447 * designed to 'fail'. To be exact, the #aiProcess_ValidateDS
448 * flag is currently the only post processing step which can actually
449 * cause the scene to be reset to NULL.
450 *
451 * @note The method does nothing if no scene is currently bound
452 * to the #Importer instance. */
453 const aiScene* ApplyPostProcessing(unsigned int pFlags);
455 const aiScene* ApplyCustomizedPostProcessing( BaseProcess *rootProcess, bool requestValidation );
457 // -------------------------------------------------------------------
458 /** @brief Reads the given file and returns its contents if successful.
459 *
460 * This function is provided for backward compatibility.
461 * See the const char* version for detailed docs.
462 * @see ReadFile(const char*, pFlags) */
463 const aiScene* ReadFile(
464 const std::string& pFile,
465 unsigned int pFlags);
467 // -------------------------------------------------------------------
468 /** Frees the current scene.
469 *
470 * The function does nothing if no scene has previously been
471 * read via ReadFile(). FreeScene() is called automatically by the
472 * destructor and ReadFile() itself. */
473 void FreeScene( );
475 // -------------------------------------------------------------------
476 /** Returns an error description of an error that occurred in ReadFile().
477 *
478 * Returns an empty string if no error occurred.
479 * @return A description of the last error, an empty string if no
480 * error occurred. The string is never NULL.
481 *
482 * @note The returned function remains valid until one of the
483 * following methods is called: #ReadFile(), #FreeScene(). */
484 const char* GetErrorString() const;
486 // -------------------------------------------------------------------
487 /** Returns the scene loaded by the last successful call to ReadFile()
488 *
489 * @return Current scene or NULL if there is currently no scene loaded */
490 const aiScene* GetScene() const;
492 // -------------------------------------------------------------------
493 /** Returns the scene loaded by the last successful call to ReadFile()
494 * and releases the scene from the ownership of the Importer
495 * instance. The application is now responsible for deleting the
496 * scene. Any further calls to GetScene() or GetOrphanedScene()
497 * will return NULL - until a new scene has been loaded via ReadFile().
498 *
499 * @return Current scene or NULL if there is currently no scene loaded
500 * @note Use this method with maximal caution, and only if you have to.
501 * By design, aiScene's are exclusively maintained, allocated and
502 * deallocated by Assimp and no one else. The reasoning behind this
503 * is the golden rule that deallocations should always be done
504 * by the module that did the original allocation because heaps
505 * are not necessarily shared. GetOrphanedScene() enforces you
506 * to delete the returned scene by yourself, but this will only
507 * be fine if and only if you're using the same heap as assimp.
508 * On Windows, it's typically fine provided everything is linked
509 * against the multithreaded-dll version of the runtime library.
510 * It will work as well for static linkage with Assimp.*/
511 aiScene* GetOrphanedScene();
513 // -------------------------------------------------------------------
514 /** Returns whether a given file extension is supported by ASSIMP.
515 *
516 * @param szExtension Extension to be checked.
517 * Must include a trailing dot '.'. Example: ".3ds", ".md3".
518 * Cases-insensitive.
519 * @return true if the extension is supported, false otherwise */
520 bool IsExtensionSupported(const char* szExtension) const;
522 // -------------------------------------------------------------------
523 /** @brief Returns whether a given file extension is supported by ASSIMP.
524 *
525 * This function is provided for backward compatibility.
526 * See the const char* version for detailed and up-to-date docs.
527 * @see IsExtensionSupported(const char*) */
528 inline bool IsExtensionSupported(const std::string& szExtension) const;
530 // -------------------------------------------------------------------
531 /** Get a full list of all file extensions supported by ASSIMP.
532 *
533 * If a file extension is contained in the list this does of course not
534 * mean that ASSIMP is able to load all files with this extension ---
535 * it simply means there is an importer loaded which claims to handle
536 * files with this file extension.
537 * @param szOut String to receive the extension list.
538 * Format of the list: "*.3ds;*.obj;*.dae". This is useful for
539 * use with the WinAPI call GetOpenFileName(Ex). */
540 void GetExtensionList(aiString& szOut) const;
542 // -------------------------------------------------------------------
543 /** @brief Get a full list of all file extensions supported by ASSIMP.
544 *
545 * This function is provided for backward compatibility.
546 * See the aiString version for detailed and up-to-date docs.
547 * @see GetExtensionList(aiString&)*/
548 inline void GetExtensionList(std::string& szOut) const;
550 // -------------------------------------------------------------------
551 /** Get the number of importers currently registered with Assimp. */
552 size_t GetImporterCount() const;
554 // -------------------------------------------------------------------
555 /** Get meta data for the importer corresponding to a specific index..
556 *
557 * For the declaration of #aiImporterDesc, include <assimp/importerdesc.h>.
558 * @param index Index to query, must be within [0,GetImporterCount())
559 * @return Importer meta data structure, NULL if the index does not
560 * exist or if the importer doesn't offer meta information (
561 * importers may do this at the cost of being hated by their peers).*/
562 const aiImporterDesc* GetImporterInfo(size_t index) const;
564 // -------------------------------------------------------------------
565 /** Find the importer corresponding to a specific index.
566 *
567 * @param index Index to query, must be within [0,GetImporterCount())
568 * @return Importer instance. NULL if the index does not
569 * exist. */
570 BaseImporter* GetImporter(size_t index) const;
572 // -------------------------------------------------------------------
573 /** Find the importer corresponding to a specific file extension.
574 *
575 * This is quite similar to #IsExtensionSupported except a
576 * BaseImporter instance is returned.
577 * @param szExtension Extension to check for. The following formats
578 * are recognized (BAH being the file extension): "BAH" (comparison
579 * is case-insensitive), ".bah", "*.bah" (wild card and dot
580 * characters at the beginning of the extension are skipped).
581 * @return NULL if no importer is found*/
582 BaseImporter* GetImporter (const char* szExtension) const;
584 // -------------------------------------------------------------------
585 /** Find the importer index corresponding to a specific file extension.
586 *
587 * @param szExtension Extension to check for. The following formats
588 * are recognized (BAH being the file extension): "BAH" (comparison
589 * is case-insensitive), ".bah", "*.bah" (wild card and dot
590 * characters at the beginning of the extension are skipped).
591 * @return (size_t)-1 if no importer is found */
592 size_t GetImporterIndex (const char* szExtension) const;
594 // -------------------------------------------------------------------
595 /** Returns the storage allocated by ASSIMP to hold the scene data
596 * in memory.
597 *
598 * This refers to the currently loaded file, see #ReadFile().
599 * @param in Data structure to be filled.
600 * @note The returned memory statistics refer to the actual
601 * size of the use data of the aiScene. Heap-related overhead
602 * is (naturally) not included.*/
603 void GetMemoryRequirements(aiMemoryInfo& in) const;
605 // -------------------------------------------------------------------
606 /** Enables "extra verbose" mode.
607 *
608 * 'Extra verbose' means the data structure is validated after *every*
609 * single post processing step to make sure everyone modifies the data
610 * structure in a well-defined manner. This is a debug feature and not
611 * intended for use in production environments. */
612 void SetExtraVerbose(bool bDo);
614 // -------------------------------------------------------------------
615 /** Private, do not use. */
616 ImporterPimpl* Pimpl() { return pimpl; }
617 const ImporterPimpl* Pimpl() const { return pimpl; }
619 protected:
621 // Just because we don't want you to know how we're hacking around.
622 ImporterPimpl* pimpl;
623 }; //! class Importer
626 // ----------------------------------------------------------------------------
627 // For compatibility, the interface of some functions taking a std::string was
628 // changed to const char* to avoid crashes between binary incompatible STL
629 // versions. This code her is inlined, so it shouldn't cause any problems.
630 // ----------------------------------------------------------------------------
632 // ----------------------------------------------------------------------------
633 AI_FORCE_INLINE const aiScene* Importer::ReadFile( const std::string& pFile,unsigned int pFlags){
634 return ReadFile(pFile.c_str(),pFlags);
635 }
636 // ----------------------------------------------------------------------------
637 AI_FORCE_INLINE void Importer::GetExtensionList(std::string& szOut) const {
638 aiString s;
639 GetExtensionList(s);
640 szOut = s.data;
641 }
642 // ----------------------------------------------------------------------------
643 AI_FORCE_INLINE bool Importer::IsExtensionSupported(const std::string& szExtension) const {
644 return IsExtensionSupported(szExtension.c_str());
645 }
647 } // !namespace Assimp
649 #endif // AI_ASSIMP_HPP_INC