| 71 | } |
| 72 | |
| 73 | bool EnsurePathForFile(const std::string_view& filePath, std::error_code* errorCode) |
| 74 | { |
| 75 | std::filesystem::path dirPath((char8_t const*)filePath.data()); |
| 76 | dirPath.remove_filename(); |
| 77 | |
| 78 | std::error_code retCode; |
| 79 | |
| 80 | if(std::filesystem::create_directories(dirPath, retCode) || retCode.value() == 0) |
| 81 | { |
| 82 | return true; |
| 83 | } |
| 84 | |
| 85 | if (errorCode != nullptr) |
| 86 | { |
| 87 | *errorCode = retCode; |
| 88 | } |
| 89 | |
| 90 | return false; |
| 91 | } |