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

Method parse

launcher/ApplicationMessage.cpp:42–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40#include "Json.h"
41
42void ApplicationMessage::parse(const QByteArray & input) {
43 auto doc = Json::requireDocument(input, "ApplicationMessage");
44 auto root = Json::requireObject(doc, "ApplicationMessage");
45
46 command = root.value("command").toString();
47 args.clear();
48
49 auto parsedArgs = root.value("args").toObject();
50 for(auto iter = parsedArgs.begin(); iter != parsedArgs.end(); iter++) {
51 args[iter.key()] = iter.value().toString();
52 }
53}
54
55QByteArray ApplicationMessage::serialize() {
56 QJsonObject root;

Callers

nothing calls this directly

Calls 6

requireDocumentFunction · 0.85
requireObjectFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
toStringMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected