pathcreator.h 550 B

1234567891011121314151617181920212223242526272829
  1. #ifndef PATHCREATOR_H
  2. #define PATHCREATOR_H
  3. #include <string>
  4. #include <sys/stat.h>
  5. #include <unistd.h>
  6. #include <fstream>
  7. class PathCreator
  8. {
  9. public:
  10. PathCreator();
  11. ~PathCreator();
  12. std::string GetCurPath();
  13. bool Mkdir(std::string dir);
  14. bool CreateDatePath(std::string root, bool add_time = true);
  15. static bool IsPathExist(const std::string& path);
  16. static bool IsFile(const std::string& path);
  17. static bool IsFolder(const std::string& path);
  18. protected:
  19. std::string m_current_path;
  20. };
  21. #endif // PATHCREATOR_H