26 static bool Exists(
const std::filesystem::path& Filepath);
27 static bool DeleteFile(
const std::filesystem::path& Filepath);
29 static bool Move(
const std::filesystem::path& OldFilepath,
const std::filesystem::path& NewFilepath);
30 static bool Copy(
const std::filesystem::path& OldFilepath,
const std::filesystem::path& NewFilepath);
31 static bool Rename(
const std::filesystem::path& OldFilepath,
const std::filesystem::path& NewFilepath);
32 static bool RenameFilename(
const std::filesystem::path& OldFilepath,
const std::string& NewName);
34 static bool CreateDirectory(
const std::filesystem::path& Directory);
35 static bool IsDirectory(
const std::filesystem::path& Path);
36 static bool IsNewer(
const std::filesystem::path& EntryA,
const std::filesystem::path& EntryB);
38 static bool ShowFileInExplorer(
const std::filesystem::path& Path);
39 static bool OpenDirectoryInExplorer(
const std::filesystem::path& DirectoryPath);
41 static bool FindSimilarFiles(
const std::string& FilePattern,
42 const std::filesystem::path& Directory,
43 std::vector<std::filesystem::path>& Found);
45 static bool MoveFile(
const std::filesystem::path& Filepath,
const std::filesystem::path& Destination)
47 return Move(Filepath, Destination / Filepath.filename());
56 static void ConvertToUnixPath(std::string& WindowsPath);
57 static void ConvertToWindowsPath(std::string& UnixPath);
65 [[nodiscard]]
static std::string ConvertToUnixPath(
const std::filesystem::path& WindowsPath);
66 [[nodiscard]]
static std::string ConvertToWindowsPath(
const std::filesystem::path& UnixPath);
68 static std::string RemoveFileExtension(
const std::string& File)
70 const std::size_t DotPosition = File.find_last_of(
'.');
71 if (DotPosition == std::string::npos)
76 return File.substr(0, DotPosition);
79 static std::string RemoveFileExtension(
const std::filesystem::path& File)
81 std::string FileName = File.string();
82 const std::size_t DotPosition = FileName.find_last_of(
'.');
83 if (DotPosition == std::string::npos)
88 return FileName.substr(0, DotPosition);
91 static void RemoveFileExtension(std::string& File)
93 const std::size_t DotPosition = File.find_last_of(
'.');
94 if (DotPosition == std::string::npos)
99 File = File.substr(0, DotPosition);
108 static std::filesystem::path OpenFileDialog(
const std::initializer_list<FFileDialogFilterItem> InFilters = {});
109 static std::filesystem::path SaveFileDialog(
const std::initializer_list<FFileDialogFilterItem> InFilters = {});
110 static std::filesystem::path OpenFolderDialog(
const char* InitialFolder =
"");
112 FORCEINLINE
static std::filesystem::path GetWorkingDir() {
return WorkingDir; }
113 FORCEINLINE
static std::filesystem::path GetBinaryDir() {
return BinaryDir; }
114 FORCEINLINE
static std::filesystem::path GetEngineDir() {
return EngineDir; }
115 FORCEINLINE
static std::filesystem::path GetEditorDir() {
return EditorDir; }
116 FORCEINLINE
static std::filesystem::path GetRuntimeDir() {
return RuntimeDir; }
117 FORCEINLINE
static std::filesystem::path GetConfigDir() {
return ConfigDir; }
118 FORCEINLINE
static std::filesystem::path GetResourcesDir() {
return ResourcesDir; }
119 FORCEINLINE
static std::filesystem::path GetAssetsDir() {
return AssetsDir; }
121 FORCEINLINE
static std::filesystem::path GetEngineConfig() {
return EngineConfig; }
122 FORCEINLINE
static std::filesystem::path GetEditorConfig() {
return EditorConfig; }
125 static std::filesystem::path WorkingDir;
126 static std::filesystem::path BinaryDir;
127 static std::filesystem::path EngineDir;
128 static std::filesystem::path EditorDir;
129 static std::filesystem::path RuntimeDir;
130 static std::filesystem::path ConfigDir;
131 static std::filesystem::path ResourcesDir;
132 static std::filesystem::path AssetsDir;
133 static std::filesystem::path ProjectsDir;
135 static std::filesystem::path EngineConfig;
136 static std::filesystem::path EditorConfig;
138 friend struct Global;