Search for metadata associated with the provided recordId and userId. \param node - Top-level node to use for metadata search. \param recordId - Record ID to match. \param userId - User ID to match.
| 394 | /// \param recordId - Record ID to match. |
| 395 | /// \param userId - User ID to match. |
| 396 | MetadataNode LasWriter::findVlrMetadata(MetadataNode node, |
| 397 | uint16_t recordId, const std::string& userId) |
| 398 | { |
| 399 | std::string sRecordId = std::to_string(recordId); |
| 400 | |
| 401 | // Find a node whose name starts with vlr and that has child nodes |
| 402 | // with the name and recordId we're looking for. |
| 403 | auto pred = [sRecordId,userId](MetadataNode n) |
| 404 | { |
| 405 | auto recPred = [sRecordId](MetadataNode n) |
| 406 | { |
| 407 | return n.name() == "record_id" && |
| 408 | n.value() == sRecordId; |
| 409 | }; |
| 410 | auto userPred = [userId](MetadataNode n) |
| 411 | { |
| 412 | return n.name() == "user_id" && |
| 413 | n.value() == userId; |
| 414 | }; |
| 415 | return (Utils::startsWith(n.name(), "vlr") && |
| 416 | !n.findChild(recPred).empty() && |
| 417 | !n.findChild(userPred).empty()); |
| 418 | }; |
| 419 | return node.find(pred); |
| 420 | } |
| 421 | |
| 422 | |
| 423 | void LasWriter::addMetadataVlr(MetadataNode& forward) |
nothing calls this directly
no test coverage detected