[UI] Redesigned "Install Content" window
- Added ID for each ImGui window - Added filesystem::CreateFolder function
This commit is contained in:
committed by
Radosław Gliński
parent
5d5eb03127
commit
56703e52e2
@@ -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 = {};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user