MCPcopy Create free account
hub / github.com/aiekick/ImGuiFileDialog / CreateDirectoryIfNotExist

Method CreateDirectoryIfNotExist

ImGuiFileDialog.cpp:490–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488 return fs::is_regular_file(stringToPath(vName));
489 }
490 bool CreateDirectoryIfNotExist(const std::string& vName) override {
491 if (vName.empty()) return false;
492 if (IsDirectoryExist(vName)) return true;
493
494#if defined(__EMSCRIPTEN__)
495 std::string str = std::string("FS.mkdir('") + vName + "');";
496 emscripten_run_script(str.c_str());
497 bool res = true;
498#else
499 namespace fs = std::filesystem;
500 bool res = fs::create_directory(stringToPath(vName));
501#endif // _IGFD_WIN_
502 if (!res) {
503 std::cout << "Error creating directory " << vName << std::endl;
504 }
505 return res;
506 }
507
508 std::vector<IGFD::PathDisplayedName> GetDevicesList() override {
509 std::vector<IGFD::PathDisplayedName> res;

Callers 1

CreateDirMethod · 0.45

Calls 2

stringToPathFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected