parent
ff1114e3c7
commit
4bb06eceeb
|
@ -961,19 +961,19 @@ std::string CppCheck::executeAddon(const std::string &addon, const std::string &
|
||||||
picojson::value json;
|
picojson::value json;
|
||||||
fin >> json;
|
fin >> json;
|
||||||
if (!json.is<picojson::object>()) {
|
if (!json.is<picojson::object>()) {
|
||||||
reportOut("Loading " + addon + " failed. Bad json.");
|
reportOut("Loading " + addon + " failed. Bad json.");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
picojson::object obj = json.get<picojson::object>();
|
picojson::object obj = json.get<picojson::object>();
|
||||||
std::string args;
|
std::string args;
|
||||||
if (obj.count("args")) {
|
if (obj.count("args")) {
|
||||||
if (!obj["args"].is<picojson::array>()) {
|
if (!obj["args"].is<picojson::array>()) {
|
||||||
reportOut("Loading " + addon + " failed. args must be array.");
|
reportOut("Loading " + addon + " failed. args must be array.");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
for (const picojson::value &v : obj["args"].get<picojson::array>())
|
for (const picojson::value &v : obj["args"].get<picojson::array>())
|
||||||
args += " " + v.get<std::string>();
|
args += " " + v.get<std::string>();
|
||||||
}
|
}
|
||||||
return executeAddon(obj["addon"].get<std::string>(), args, dumpFile);
|
return executeAddon(obj["addon"].get<std::string>(), args, dumpFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue