hpath.h 809 B

12345678910111213141516171819202122232425262728
  1. #ifndef HV_PATH_H_
  2. #define HV_PATH_H_
  3. #include <string> // for std::string
  4. #include "hexport.h"
  5. class HV_EXPORT HPath {
  6. public:
  7. static bool exists(const char* path);
  8. static bool isdir(const char* path);
  9. static bool isfile(const char* path);
  10. static bool islink(const char* path);
  11. // filepath = /mnt/share/image/test.jpg
  12. // basename = test.jpg
  13. // dirname = /mnt/share/image
  14. // filename = test
  15. // suffixname = jpg
  16. static std::string basename(const std::string& filepath);
  17. static std::string dirname(const std::string& filepath);
  18. static std::string filename(const std::string& filepath);
  19. static std::string suffixname(const std::string& filepath);
  20. static std::string join(const std::string& dir, const std::string& filename);
  21. };
  22. #endif // HV_PATH_H_