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

Method ParsePathFileName

ImGuiFileDialog.cpp:536–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534 }
535
536 IGFD::Utils::PathStruct ParsePathFileName(const std::string& vPathFileName) override {
537 // https://github.com/aiekick/ImGuiFileDialog/issues/54
538 namespace fs = std::filesystem;
539 IGFD::Utils::PathStruct res;
540 if (vPathFileName.empty()) return res;
541 auto fsPath = stringToPath(vPathFileName);
542 if (fs::is_directory(fsPath)) {
543 res.name = "";
544 res.path = pathToString(fsPath);
545 res.isOk = true;
546 } else if (fs::is_regular_file(fsPath)) {
547 res.name = pathToString(fsPath.filename());
548 res.path = pathToString(fsPath.parent_path());
549 res.isOk = true;
550 }
551 return res;
552 }
553
554 std::vector<IGFD::FileInfos> ScanDirectory(const std::string& vPath) override {
555 std::vector<IGFD::FileInfos> res;

Callers 1

configureDialogMethod · 0.45

Calls 3

stringToPathFunction · 0.85
pathToStringFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected