file_contents_as_string.h 563 B

1234567891011121314151617181920212223
  1. #ifndef IGL_FILE_CONTENTS_AS_STRING_H
  2. #define IGL_FILE_CONTENTS_AS_STRING_H
  3. #include "igl_inline.h"
  4. #include <string>
  5. namespace igl
  6. {
  7. // Read a files contents as plain text into a given string
  8. // Inputs:
  9. // file_name path to file to be read
  10. // Outputs:
  11. // content output string containing contents of the given file
  12. // Returns true on succes, false on error
  13. IGL_INLINE bool file_contents_as_string(
  14. const std::string file_name,
  15. std::string & content);
  16. }
  17. #ifdef IGL_HEADER_ONLY
  18. # include "file_contents_as_string.cpp"
  19. #endif
  20. #endif