Files
Xenia-Canary/src/xenia/base/filesystem.cc
Sandy Carter 69bcf59c79 filesystem: use std for CreateFolder
Remove custom platform implementation of `CreateFolder` and replace uses
with `std::filesystem::create_directories` which creates paths
recursively.
2020-04-09 09:44:48 -05:00

29 lines
908 B
C++

/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2020 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/base/filesystem.h"
#include <algorithm>
namespace xe {
namespace filesystem {
bool CreateParentFolder(const std::filesystem::path& path) {
if (path.has_parent_path()) {
auto parent_path = path.parent_path();
if (!std::filesystem::exists(parent_path)) {
return std::filesystem::create_directories(parent_path);
}
}
return true;
}
} // namespace filesystem
} // namespace xe