[UI] Redesigned "Install Content" window

- Added ID for each ImGui window
- Added filesystem::CreateFolder function
This commit is contained in:
Gliniak
2025-03-26 20:52:11 +01:00
committed by Radosław Gliński
parent 5d5eb03127
commit 56703e52e2
18 changed files with 346 additions and 151 deletions

View File

@@ -24,6 +24,19 @@ bool CreateParentFolder(const std::filesystem::path& path) {
return true;
}
std::error_code CreateFolder(const std::filesystem::path& path) {
if (std::filesystem::exists(path)) {
return {};
}
std::error_code ec;
if (std::filesystem::create_directories(path, ec)) {
return {};
}
return ec;
}
std::vector<FileInfo> ListDirectories(const std::filesystem::path& path) {
std::vector<FileInfo> files = ListFiles(path);
std::vector<FileInfo> directories = {};

View File

@@ -45,6 +45,10 @@ std::filesystem::path GetUserFolder();
// attempting to create it.
bool CreateParentFolder(const std::filesystem::path& path);
// Creates folder on specified path.
// If folder already exists it returns success (no error).
std::error_code CreateFolder(const std::filesystem::path& path);
// Creates an empty file at the given path, overwriting if it exists.
bool CreateEmptyFile(const std::filesystem::path& path);