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

Function NFD_PathSet_GetPathN

extern/nfd/nfd_portal.cpp:1423–1444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1421}
1422
1423nfdresult_t NFD_PathSet_GetPathN(const nfdpathset_t* pathSet,
1424 nfdpathsetsize_t index,
1425 nfdnchar_t** outPath) {
1426 assert(pathSet);
1427 DBusMessage* msg = const_cast<DBusMessage*>(static_cast<const DBusMessage*>(pathSet));
1428 DBusMessageIter uri_iter;
1429 ReadResponseUrisUnchecked(msg, uri_iter);
1430 while (index > 0) {
1431 --index;
1432 if (!dbus_message_iter_next(&uri_iter)) {
1433 NFDi_SetError("Index out of bounds.");
1434 return NFD_ERROR;
1435 }
1436 }
1437 if (dbus_message_iter_get_arg_type(&uri_iter) != DBUS_TYPE_STRING) {
1438 NFDi_SetError("D-Bus response signal URI sub iter is not a string.");
1439 return NFD_ERROR;
1440 }
1441 const char* uri;
1442 dbus_message_iter_get_basic(&uri_iter, &uri);
1443 return AllocAndCopyFilePath(uri, *outPath);
1444}
1445
1446void NFD_PathSet_FreePathN(const nfdnchar_t* filePath) {
1447 assert(filePath);

Callers

nothing calls this directly

Calls 3

AllocAndCopyFilePathFunction · 0.85
NFDi_SetErrorFunction · 0.70

Tested by

no test coverage detected