* Get a string parameter the list of parameters. * @param parm The parameters. * @param name The parameter name we're looking for. * @return The parameter value. */
| 45 | * @return The parameter value. |
| 46 | */ |
| 47 | std::optional<std::string_view> GetDriverParam(const StringList &parm, std::string_view name) |
| 48 | { |
| 49 | if (parm.empty()) return std::nullopt; |
| 50 | |
| 51 | for (auto &p : parm) { |
| 52 | StringConsumer consumer{p}; |
| 53 | if (consumer.ReadIf(name)) { |
| 54 | if (!consumer.AnyBytesLeft()) return ""; |
| 55 | if (consumer.ReadIf("=")) return consumer.GetLeftData(); |
| 56 | } |
| 57 | } |
| 58 | return std::nullopt; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Get a boolean parameter the list of parameters. |
no test coverage detected