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

Method versionFileToJson

launcher/minecraft/MojangVersionFormat.cpp:311–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311QJsonDocument MojangVersionFormat::versionFileToJson(const VersionFilePtr &patch)
312{
313 QJsonObject root;
314 writeVersionProperties(patch.get(), root);
315 if (!patch->libraries.isEmpty())
316 {
317 QJsonArray array;
318 for (auto value: patch->libraries)
319 {
320 array.append(MojangVersionFormat::libraryToJson(value.get()));
321 }
322 root.insert("libraries", array);
323 }
324
325 // write the contents to a json document.
326 {
327 QJsonDocument out;
328 out.setObject(root);
329 return out;
330 }
331}
332
333LibraryPtr MojangVersionFormat::libraryFromJson(ProblemContainer & problems, const QJsonObject &libObj, const QString &filename)
334{

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.80
appendMethod · 0.80
insertMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected