MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / parseIndexInternal

Function parseIndexInternal

launcher/meta/JsonFormat.cpp:36–48  ·  view source on GitHub ↗

Index

Source from the content-addressed store, hash-verified

34
35// Index
36static std::shared_ptr<Index> parseIndexInternal(const QJsonObject& obj)
37{
38 const QList<QJsonObject> objects = requireIsArrayOf<QJsonObject>(obj, "packages");
39 QList<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(obj["name"].toString());
44 list->setSha256(obj["sha256"].toString());
45 return list;
46 });
47 return std::make_shared<Index>(lists);
48}
49
50// Version
51static Version::Ptr parseCommonVersion(const QString& uid, const QJsonObject& obj)

Callers 1

parseIndexFunction · 0.85

Calls 4

setSha256Method · 0.80
sizeMethod · 0.45
setNameMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected