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

Method GetDevicesList

ImGuiFileDialog.cpp:702–728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700 }
701
702 std::vector<IGFD::PathDisplayedName> GetDevicesList() override {
703 std::vector<IGFD::PathDisplayedName> res;
704#ifdef _IGFD_WIN_
705 const DWORD mydevices = 2048;
706 char lpBuffer[2048];
707#define mini(a, b) (((a) < (b)) ? (a) : (b))
708 const DWORD countChars = mini(GetLogicalDriveStringsA(mydevices, lpBuffer), 2047);
709#undef mini
710 if (countChars > 0U && countChars < 2049U) {
711 std::string var = std::string(lpBuffer, (size_t)countChars);
712 IGFD::Utils::ReplaceString(var, "\\", "");
713 auto arr = IGFD::Utils::SplitStringToVector(var, '\0', false);
714 wchar_t szVolumeName[2048];
715 IGFD::PathDisplayedName path_name;
716 for (auto& a : arr) {
717 path_name.first = a;
718 path_name.second.clear();
719 std::wstring wpath = IGFD::Utils::UTF8Decode(a);
720 if (GetVolumeInformationW(wpath.c_str(), szVolumeName, 2048, nullptr, nullptr, nullptr, nullptr, 0)) {
721 path_name.second = IGFD::Utils::UTF8Encode(szVolumeName);
722 res.push_back(path_name);
723 }
724 }
725 }
726#endif // _IGFD_WIN_
727 return res;
728 }
729
730 IGFD::Utils::PathStruct ParsePathFileName(const std::string& vPathFileName) override {
731 IGFD::Utils::PathStruct res;

Callers

nothing calls this directly

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected