-------------------------------------------------------------------------
| 76 | |
| 77 | //------------------------------------------------------------------------- |
| 78 | bool TryAddExportPlugin(const std::vector<ExportPluginDescription>& |
| 79 | exportPluginDescriptions, |
| 80 | const ExportData& exportData, |
| 81 | Options& options) |
| 82 | { |
| 83 | auto it = std::find_if( |
| 84 | exportPluginDescriptions.begin(), exportPluginDescriptions.end(), [&](const auto& plugin) { |
| 85 | return plugin.GetPluginName() == exportData.exportType; |
| 86 | }); |
| 87 | if (it == exportPluginDescriptions.end()) |
| 88 | return false; |
| 89 | |
| 90 | auto argument = exportData.argument; |
| 91 | auto optionalArgument = (argument.empty()) |
| 92 | ? std::nullopt |
| 93 | : std::make_optional(argument); |
| 94 | it->CheckArgument(optionalArgument); |
| 95 | |
| 96 | options.AddExport(OptionsExport{OptionsExportType::Plugin, |
| 97 | std::wstring{exportData.exportType}, |
| 98 | std::move(optionalArgument)}); |
| 99 | return true; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | const char ExportOptionParser::ExportSeparator = ':'; |
no test coverage detected