| 67 | } |
| 68 | } |
| 69 | return nullptr; |
| 70 | } |
| 71 | |
| 72 | const NamedAsset & require_named_asset( |
| 73 | const std::vector<NamedAsset> & assets, |
| 74 | const std::string & id, |
| 75 | const std::string & role) { |
| 76 | const auto * asset = find_named_asset(assets, id); |
| 77 | if (asset == nullptr) { |
| 78 | throw std::runtime_error("unknown " + role + " id: " + id); |
| 79 | } |
| 80 | return *asset; |
| 81 | } |
| 82 | |
| 83 | const NamedAsset * select_named_asset( |
| 84 | const std::vector<NamedAsset> & assets, |
| 85 | const std::optional<std::string> & id, |
| 86 | const std::string & role) { |
no test coverage detected