next_filename.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <[email protected]>
  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. /// @param[in] prefix path to containing dir and filename prefix
  18. /// @param[in] zeros number of leading zeros as if digit printed with printf
  19. /// @param[in] suffix suffix of filename and extension (should include dot)
  20. /// @param[out] next path to next file
  21. /// @return true if found, false if exceeding range in zeros
  22. IGL_INLINE bool next_filename(
  23. const std::string & prefix,
  24. const int zeros,
  25. const std::string & suffix,
  26. std::string & next);
  27. }
  28. #ifndef IGL_STATIC_LIBRARY
  29. # include "next_filename.cpp"
  30. #endif
  31. #endif