Index
| 34 | |
| 35 | // Index |
| 36 | static std::shared_ptr<Index> parseIndexInternal(const QJsonObject& obj) |
| 37 | { |
| 38 | const QVector<QJsonObject> objects = requireIsArrayOf<QJsonObject>(obj, "packages"); |
| 39 | QVector<VersionList::Ptr> lists; |
| 40 | lists.reserve(objects.size()); |
| 41 | std::transform(objects.begin(), objects.end(), std::back_inserter(lists), [](const QJsonObject& obj) { |
| 42 | VersionList::Ptr list = std::make_shared<VersionList>(requireString(obj, "uid")); |
| 43 | list->setName(ensureString(obj, "name", QString())); |
| 44 | list->setSha256(ensureString(obj, "sha256", QString())); |
| 45 | return list; |
| 46 | }); |
| 47 | return std::make_shared<Index>(lists); |
| 48 | } |
| 49 | |
| 50 | // Version |
| 51 | static Version::Ptr parseCommonVersion(const QString& uid, const QJsonObject& obj) |
no test coverage detected