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

Method parse_command

source/MaaAdbControlUnit/Base/UnitBase.cpp:30–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30bool UnitBase::parse_command(
31 const std::string& key,
32 const json::value& config,
33 const json::array& default_argv,
34 /*out*/ ProcessArgvGenerator& argv)
35{
36 auto jargv = config.get("command", key, default_argv);
37
38 auto opt = ProcessArgvGenerator::create(jargv);
39 if (!opt) {
40 LogError << "Parse config failed:" << VAR(key);
41 return false;
42 }
43 argv = std::move(*opt);
44
45 return true;
46}
47
48std::optional<std::string> UnitBase::startup_and_read_pipe(const ProcessArgv& argv, std::chrono::milliseconds timeout)
49{

Callers

nothing calls this directly

Calls 3

createFunction · 0.85
moveFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected