| 506 | } |
| 507 | |
| 508 | std::vector<IGFD::PathDisplayedName> GetDevicesList() override { |
| 509 | std::vector<IGFD::PathDisplayedName> res; |
| 510 | #ifdef _IGFD_WIN_ |
| 511 | const DWORD mydevices = 2048; |
| 512 | char lpBuffer[2048]; |
| 513 | #define mini(a, b) (((a) < (b)) ? (a) : (b)) |
| 514 | const DWORD countChars = mini(GetLogicalDriveStringsA(mydevices, lpBuffer), 2047); |
| 515 | #undef mini |
| 516 | if (countChars > 0U && countChars < 2049U) { |
| 517 | std::string var = std::string(lpBuffer, (size_t)countChars); |
| 518 | IGFD::Utils::ReplaceString(var, "\\", ""); |
| 519 | auto arr = IGFD::Utils::SplitStringToVector(var, '\0', false); |
| 520 | wchar_t szVolumeName[2048]; |
| 521 | IGFD::PathDisplayedName path_name; |
| 522 | for (auto& a : arr) { |
| 523 | path_name.first = a; |
| 524 | path_name.second.clear(); |
| 525 | std::wstring wpath = IGFD::Utils::UTF8Decode(a); |
| 526 | if (GetVolumeInformationW(wpath.c_str(), szVolumeName, 2048, nullptr, nullptr, nullptr, nullptr, 0)) { |
| 527 | path_name.second = IGFD::Utils::UTF8Encode(szVolumeName); |
| 528 | res.push_back(path_name); |
| 529 | } |
| 530 | } |
| 531 | } |
| 532 | #endif // _IGFD_WIN_ |
| 533 | return res; |
| 534 | } |
| 535 | |
| 536 | IGFD::Utils::PathStruct ParsePathFileName(const std::string& vPathFileName) override { |
| 537 | // https://github.com/aiekick/ImGuiFileDialog/issues/54 |
no test coverage detected