MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / parseIndexInternal

Function parseIndexInternal

launcher/meta/JsonFormat.cpp:37–49  ·  view source on GitHub ↗

Index

Source from the content-addressed store, hash-verified

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

Callers 1

parseIndexFunction · 0.85

Calls 5

QStringClass · 0.85
beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected