guess_extension.h 694 B

1234567891011121314151617181920212223
  1. #ifndef IGL_GUESS_EXTENSION_H
  2. #define IGL_GUESS_EXTENSION_H
  3. #include "igl_inline.h"
  4. #include <string>
  5. #include <cstdio>
  6. namespace igl
  7. {
  8. /// Given a file pointer at the beginning of a "mesh" file, try to guess the
  9. /// extension of the file format it comes from. The file pointer is rewound on
  10. /// return.
  11. ///
  12. /// @param[in,out] fp file pointer, rewound after
  13. /// @param[out] guess extension as string. One of "mesh",{"obj"},"off","ply","stl", or
  14. /// "wrl"
  15. ///
  16. IGL_INLINE void guess_extension(FILE * fp, std::string & guess);
  17. /// \overload
  18. IGL_INLINE std::string guess_extension(FILE * fp);
  19. }
  20. #ifndef IGL_STATIC_LIBRARY
  21. # include "guess_extension.cpp"
  22. #endif
  23. #endif