guess_extension.h 704 B

12345678910111213141516171819202122232425
  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. // Inputs:
  13. // fp file pointer (see output)
  14. // Outputs:
  15. // fp file pointer rewound
  16. // guess extension as string. One of "mesh",{"obj"},"off","ply","stl", or
  17. // "wrl"
  18. //
  19. IGL_INLINE void guess_extension(FILE * fp, std::string & guess);
  20. IGL_INLINE std::string guess_extension(FILE * fp);
  21. }
  22. #ifndef IGL_STATIC_LIBRARY
  23. # include "guess_extension.cpp"
  24. #endif
  25. #endif