MCPcopy Create free account
hub / github.com/MultiMC/Launcher / parseFormatVersion

Function parseFormatVersion

launcher/meta/JsonFormat.cpp:98–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97
98MetadataVersion parseFormatVersion(const QJsonObject &obj, bool required)
99{
100 if (!obj.contains("formatVersion"))
101 {
102 if(required)
103 {
104 return MetadataVersion::Invalid;
105 }
106 return MetadataVersion::InitialRelease;
107 }
108 if (!obj.value("formatVersion").isDouble())
109 {
110 return MetadataVersion::Invalid;
111 }
112 switch(obj.value("formatVersion").toInt())
113 {
114 case 0:
115 case 1:
116 return MetadataVersion::InitialRelease;
117 default:
118 return MetadataVersion::Invalid;
119 }
120}
121
122void serializeFormatVersion(QJsonObject& obj, Meta::MetadataVersion version)
123{

Callers 4

parseIndexFunction · 0.85
parseVersionListFunction · 0.85
parseVersionFunction · 0.85
versionFileFromJsonMethod · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected