pathinfo.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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_PATHINFO_H
  9. #define IGL_PATHINFO_H
  10. #include "igl_inline.h"
  11. #include <string>
  12. namespace igl
  13. {
  14. //// Decided not to use these
  15. //const int PATHINFO_DIRNAME 01
  16. //const int PATHINFO_BASENAME 02
  17. //const int PATHINFO_EXTENSION 04
  18. //const int PATHINFO_FILENAME 08
  19. // Function like PHP's pathinfo
  20. // returns information about path
  21. // Input:
  22. // path string containing input path
  23. // Outputs:
  24. // dirname string containing dirname (see dirname.h)
  25. // basename string containing basename (see basename.h)
  26. // extension string containing extension (characters after last '.')
  27. // filename string containing filename (characters of basename before last
  28. // '.')
  29. //
  30. // See also: basename, dirname
  31. IGL_INLINE void pathinfo(
  32. const std::string & path,
  33. std::string & dirname,
  34. std::string & basename,
  35. std::string & extension,
  36. std::string & filename);
  37. }
  38. #ifdef IGL_HEADER_ONLY
  39. # include "pathinfo.cpp"
  40. #endif
  41. #endif