filesystem: use std for CreateFolder

Remove custom platform implementation of `CreateFolder` and replace uses
with `std::filesystem::create_directories` which creates paths
recursively.
This commit is contained in:
Sandy Carter
2020-04-09 10:17:13 -04:00
committed by Rick Gibbed
parent c8e64da4eb
commit 69bcf59c79
13 changed files with 11 additions and 28 deletions

View File

@@ -153,7 +153,7 @@ X_RESULT ContentManager::CreateContent(const std::string_view root_name,
return X_ERROR_ALREADY_EXISTS;
}
if (!xe::filesystem::CreateFolder(package_path)) {
if (!std::filesystem::create_directories(package_path)) {
return X_ERROR_ACCESS_DENIED;
}
@@ -227,7 +227,7 @@ X_RESULT ContentManager::SetContentThumbnail(const XCONTENT_DATA& data,
std::vector<uint8_t> buffer) {
auto global_lock = global_critical_region_.Acquire();
auto package_path = ResolvePackagePath(data);
xe::filesystem::CreateFolder(package_path);
std::filesystem::create_directories(package_path);
if (std::filesystem::exists(package_path)) {
auto thumb_path = package_path / kThumbnailFileName;
auto file = xe::filesystem::OpenFile(thumb_path, "wb");

View File

@@ -158,7 +158,7 @@ void UserProfile::SaveSetting(UserProfile::Setting* setting) {
auto serialized_setting = setting->Serialize();
auto content_dir =
kernel_state()->content_manager()->ResolveGameUserContentPath();
xe::filesystem::CreateFolder(content_dir);
std::filesystem::create_directories(content_dir);
auto setting_id = fmt::format("{:08X}", setting->setting_id);
auto file_path = content_dir / setting_id;
auto file = xe::filesystem::OpenFile(file_path, "wb");