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

Function NFD_PathSet_GetPathN

extern/nfd/nfd_win.cpp:615–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615nfdresult_t NFD_PathSet_GetPathN(const nfdpathset_t* pathSet,
616 nfdpathsetsize_t index,
617 nfdnchar_t** outPath) {
618 assert(pathSet);
619 // const_cast because methods on IShellItemArray aren't const, but it should act like const to
620 // the caller
621 ::IShellItemArray* psiaPathSet =
622 const_cast<::IShellItemArray*>(static_cast<const ::IShellItemArray*>(pathSet));
623
624 ::IShellItem* psiPath;
625 if (!SUCCEEDED(psiaPathSet->GetItemAt(index, &psiPath))) {
626 NFDi_SetError("Could not get shell item.");
627 return NFD_ERROR;
628 }
629
630 Release_Guard<::IShellItem> psiPathGuard(psiPath);
631
632 nfdnchar_t* name;
633 if (!SUCCEEDED(psiPath->GetDisplayName(::SIGDN_FILESYSPATH, &name))) {
634 NFDi_SetError("Could not get file path from shell item.");
635 return NFD_ERROR;
636 }
637
638 *outPath = name;
639 return NFD_OKAY;
640}
641
642nfdresult_t NFD_PathSet_GetEnum(const nfdpathset_t* pathSet, nfdpathsetenum_t* outEnumerator) {
643 assert(pathSet);

Callers 2

NFD_PathSet_GetPathU8Function · 0.70
GetPathFunction · 0.50

Calls 1

NFDi_SetErrorFunction · 0.70

Tested by

no test coverage detected