MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / NFD_PathSet_EnumNextN

Function NFD_PathSet_EnumNextN

extern/nfd/nfd_win.cpp:668–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

666}
667
668nfdresult_t NFD_PathSet_EnumNextN(nfdpathsetenum_t* enumerator, nfdnchar_t** outPath) {
669 assert(enumerator->ptr);
670
671 ::IEnumShellItems* pesiPaths = static_cast<::IEnumShellItems*>(enumerator->ptr);
672
673 ::IShellItem* psiPath;
674 HRESULT res = pesiPaths->Next(1, &psiPath, NULL);
675 if (!SUCCEEDED(res)) {
676 NFDi_SetError("Could not get next item of enumerator.");
677 return NFD_ERROR;
678 }
679 if (res != S_OK) {
680 *outPath = nullptr;
681 return NFD_OKAY;
682 }
683
684 Release_Guard<::IShellItem> psiPathGuard(psiPath);
685
686 nfdnchar_t* name;
687 if (!SUCCEEDED(psiPath->GetDisplayName(::SIGDN_FILESYSPATH, &name))) {
688 NFDi_SetError("Could not get file path from shell item.");
689 return NFD_ERROR;
690 }
691
692 *outPath = name;
693 return NFD_OKAY;
694}
695
696void NFD_PathSet_Free(const nfdpathset_t* pathSet) {
697 assert(pathSet);

Callers 1

NFD_PathSet_EnumNextU8Function · 0.70

Calls 1

NFDi_SetErrorFunction · 0.70

Tested by

no test coverage detected