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

Function parseCommonVersion

launcher/meta/JsonFormat.cpp:51–66  ·  view source on GitHub ↗

Version

Source from the content-addressed store, hash-verified

49
50// Version
51static Version::Ptr parseCommonVersion(const QString& uid, const QJsonObject& obj)
52{
53 Version::Ptr version = std::make_shared<Version>(uid, requireString(obj, "version"));
54 version->setTime(QDateTime::fromString(requireString(obj, "releaseTime"), Qt::ISODate).toMSecsSinceEpoch() / 1000);
55 version->setType(obj["type"].toString());
56 version->setRecommended(obj["recommended"].toBool());
57 version->setVolatile(obj["volatile"].toBool());
58 RequireSet reqs, conflicts;
59 parseRequires(obj, &reqs, "requires");
60 parseRequires(obj, &conflicts, "conflicts");
61 version->setRequires(reqs, conflicts);
62 if (auto sha256 = obj["sha256"].toString(); !sha256.isEmpty()) {
63 version->setSha256(sha256);
64 }
65 return version;
66}
67
68static Version::Ptr parseVersionInternal(const QJsonObject& obj)
69{

Callers 2

parseVersionInternalFunction · 0.85
parseVersionListInternalFunction · 0.85

Calls 9

parseRequiresFunction · 0.85
setTimeMethod · 0.80
setTypeMethod · 0.80
setRecommendedMethod · 0.80
setVolatileMethod · 0.80
setRequiresMethod · 0.80
setSha256Method · 0.80
toStringMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected