MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / VerifyPath

Function VerifyPath

ogsr_engine/xrCore/FS.cpp:56–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55#include <filesystem>
56void 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

Callers 4

script_register_stdfsFunction · 0.85
CreateMethod · 0.85
CFileWriterMethod · 0.85
CreateLogFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected