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

Function parseBinaryJsonFile

launcher/minecraft/ProfileUtils.cpp:144–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144VersionFilePtr parseBinaryJsonFile(const QFileInfo &fileInfo)
145{
146 QFile file(fileInfo.absoluteFilePath());
147 if (!file.open(QFile::ReadOnly))
148 {
149 auto errorStr = QObject::tr("Unable to open the version file %1: %2.").arg(fileInfo.fileName(), file.errorString());
150 return createErrorVersionFile(fileInfo.completeBaseName(), fileInfo.absoluteFilePath(), errorStr);
151 }
152 QJsonDocument doc = QJsonDocument::fromBinaryData(file.readAll());
153 file.close();
154 if (doc.isNull())
155 {
156 file.remove();
157 throw JSONValidationError(QObject::tr("Unable to process the version file %1.").arg(fileInfo.fileName()));
158 }
159 return guardedParseJson(doc, fileInfo.completeBaseName(), fileInfo.absoluteFilePath(), false);
160}
161
162void removeLwjglFromPatch(VersionFilePtr patch)
163{

Callers

nothing calls this directly

Calls 4

createErrorVersionFileFunction · 0.85
guardedParseJsonFunction · 0.85
openMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected