MCPcopy Create free account
hub / github.com/comaps/comaps / MkDirChecked

Method MkDirChecked

libs/platform/platform.cpp:289–308  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

287
288// static
289bool Platform::MkDirChecked(std::string const & dirName)
290{
291 switch (EError const ret = MkDir(dirName))
292 {
293 case ERR_OK: return true;
294 case ERR_FILE_ALREADY_EXISTS:
295 {
296 EFileType type;
297 if (!GetFileTypeChecked(dirName, type))
298 return false;
299 if (type != Directory)
300 {
301 LOG(LERROR, (dirName, "exists, but not a dirName:", type));
302 return false;
303 }
304 return true;
305 }
306 default: LOG(LERROR, (dirName, "can't be created:", ret)); return false;
307 }
308}
309
310// static
311bool Platform::MkDirRecursively(std::string const & dirName)

Callers 2

Calls 1

GetFileTypeCheckedFunction · 0.85

Tested by

no test coverage detected