| 54 | |
| 55 | #include <filesystem> |
| 56 | void VerifyPath(const std::string_view path) //Проверяет путь до файла. Если папки в пути отсутствуют - создаёт их. |
| 57 | { |
| 58 | const auto lastSepPos = path.find_last_of('\\'); |
| 59 | const auto foldersPath = (lastSepPos != std::string_view::npos) ? path.substr(0, lastSepPos) : path; |
| 60 | std::error_code e; |
| 61 | namespace stdfs = std::filesystem; |
| 62 | stdfs::create_directories(stdfs::path(foldersPath.begin(), foldersPath.end()), e); |
| 63 | (void)e; |
| 64 | } |
| 65 | |
| 66 | ////////////////////////////////////////////////////////////////////// |
| 67 | // Construction/Destruction |
no test coverage detected