CmFileSystem.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "CmPrerequisitesUtil.h"
  3. #include "CmPath.h"
  4. namespace CamelotFramework
  5. {
  6. class CM_UTILITY_EXPORT FileSystem
  7. {
  8. public:
  9. static DataStreamPtr openFile(const WString& fullPath, bool readOnly = true);
  10. static DataStreamPtr createAndOpenFile(const WString& fullPath);
  11. static UINT64 getFileSize(const WString& fullPath);
  12. static void remove(const WString& fullPath, bool recursively = true);
  13. static void remove(const WPath& fullPath, bool recursively = true);
  14. static void move(const WPath& oldPath, const WPath& newPath, bool overwriteExisting = true);
  15. static void createDir(const WString& fullPath);
  16. static void createDir(const WPath& fullPath);
  17. static bool exists(const WString& fullPath);
  18. static bool exists(const WPath& fullPath);
  19. static bool isFile(const WString& fullPath);
  20. static bool isFile(const WPath& fullPath);
  21. static bool isDirectory(const WString& fullPath);
  22. static bool isDirectory(const WPath& fullPath);
  23. static void getChildren(const WPath& dirPath, Vector<WPath>::type& files, Vector<WPath>::type& directories);
  24. static std::time_t getLastModifiedTime(const WString& fullPath);
  25. static std::time_t getLastModifiedTime(const WPath& fullPath);
  26. static WString getWorkingDirectoryPath();
  27. static WString getParentDirectory(const WString& path);
  28. };
  29. }