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

Method validate

launcher/meta/BaseEntity.cpp:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 return true;
49 }
50 bool validate(QNetworkReply &) override
51 {
52 auto fname = m_entity->localFilename();
53 try
54 {
55 auto doc = Json::requireDocument(data, fname);
56 auto obj = Json::requireObject(doc, fname);
57 m_entity->parse(obj);
58 return true;
59 }
60 catch (const Exception &e)
61 {
62 qWarning() << "Unable to parse response:" << e.cause();
63 return false;
64 }
65 }
66
67private: /* data */
68 QByteArray data;

Callers

nothing calls this directly

Calls 5

requireDocumentFunction · 0.85
requireObjectFunction · 0.85
causeMethod · 0.80
localFilenameMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected