MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / create

Method create

source/MaaAdbControlUnit/Base/ProcessArgvGenerator.cpp:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "MaaUtils/Platform.h"
6
7MAA_CTRL_UNIT_NS_BEGIN
8
9std::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
25std::optional<ProcessArgvGenerator::ProcessArgv> ProcessArgvGenerator::gen(const Replacement& replacement) const
26{

Callers

nothing calls this directly

Calls 3

ProcessArgvGeneratorFunction · 0.85
moveFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected