next_filename.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_NEXT_FILENAME_H
  9. #define IGL_NEXT_FILENAME_H
  10. #include "igl_inline.h"
  11. #include <string>
  12. namespace igl
  13. {
  14. // Find the file with the first filename of the form
  15. // "prefix-%0[zeros]dsuffix"
  16. //
  17. // Inputs:
  18. // prefix path to containing dir and filename prefix
  19. // zeros number of leading zeros as if digit printed with printf
  20. // suffix suffix of filename and extension
  21. // Outputs:
  22. // next path to next file
  23. // Returns true if found, false if exceeding range in zeros
  24. IGL_INLINE bool next_filename(
  25. const std::string & prefix,
  26. const int zeros,
  27. const std::string & suffix,
  28. std::string & next);
  29. }
  30. #ifndef IGL_STATIC_LIBRARY
  31. # include "next_filename.cpp"
  32. #endif
  33. #endif