| 1421 | } |
| 1422 | |
| 1423 | nfdresult_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 | |
| 1446 | void NFD_PathSet_FreePathN(const nfdnchar_t* filePath) { |
| 1447 | assert(filePath); |
nothing calls this directly
no test coverage detected