| 5 | #include "MaaUtils/Platform.h" |
| 6 | |
| 7 | MAA_CTRL_UNIT_NS_BEGIN |
| 8 | |
| 9 | std::optional<ProcessArgvGenerator> ProcessArgvGenerator::create(const json::array& arr) |
| 10 | { |
| 11 | if (!arr.all<std::string>()) { |
| 12 | LogError << "array not all string" << VAR(arr); |
| 13 | return std::nullopt; |
| 14 | } |
| 15 | |
| 16 | auto raw = arr.as<std::vector<std::string>>(); |
| 17 | if (raw.empty()) { |
| 18 | LogError << "array is empty"; |
| 19 | return std::nullopt; |
| 20 | } |
| 21 | |
| 22 | return ProcessArgvGenerator(std::move(raw)); |
| 23 | } |
| 24 | |
| 25 | std::optional<ProcessArgvGenerator::ProcessArgv> ProcessArgvGenerator::gen(const Replacement& replacement) const |
| 26 | { |
nothing calls this directly
no test coverage detected