| 613 | } |
| 614 | |
| 615 | nfdresult_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 | |
| 642 | nfdresult_t NFD_PathSet_GetEnum(const nfdpathset_t* pathSet, nfdpathsetenum_t* outEnumerator) { |
| 643 | assert(pathSet); |
no test coverage detected