hpath.h 767 B

123456789101112131415161718192021222324252627
  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. // filepath = /mnt/share/image/test.jpg
  11. // basename = test.jpg
  12. // dirname = /mnt/share/image
  13. // filename = test
  14. // suffixname = jpg
  15. static std::string basename(const std::string& filepath);
  16. static std::string dirname(const std::string& filepath);
  17. static std::string filename(const std::string& filepath);
  18. static std::string suffixname(const std::string& filepath);
  19. static std::string join(const std::string& dir, const std::string& filename);
  20. };
  21. #endif // HV_PATH_H_