Mercurial > hg > piper-cpp
comparison utilities/json-cli.cpp @ 56:815e94fedc1c
Introduce ListResponse type as well
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 19 Sep 2016 14:10:19 +0100 |
parents | 38780f15ac8d |
children | 85ec33975434 |
comparison
equal
deleted
inserted
replaced
55:38780f15ac8d | 56:815e94fedc1c |
---|---|
56 if (content != Json()) { | 56 if (content != Json()) { |
57 throw VampJson::Failure("no content expected for list request"); | 57 throw VampJson::Failure("no content expected for list request"); |
58 } | 58 } |
59 | 59 |
60 auto loader = PluginLoader::getInstance(); | 60 auto loader = PluginLoader::getInstance(); |
61 auto pluginData = loader->listPluginData(); | 61 auto resp = loader->listPluginData(); |
62 | 62 |
63 Json::array j; | 63 Json::array j; |
64 for (const auto &pd: pluginData) { | 64 for (const auto &pd: resp.pluginData) { |
65 j.push_back(VampJson::fromPluginStaticData(pd)); | 65 j.push_back(VampJson::fromPluginStaticData(pd)); |
66 } | 66 } |
67 return Json(j); | 67 return Json(j); |
68 } | 68 } |
69 | 69 |