| 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; |
no test coverage detected