MCPcopy Create free account
hub / github.com/Samsung/UTopia / fromJson

Method fromJson

lib/inputanalysis/Definition.cpp:13–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 EndOffset(0) {}
12
13bool Definition::fromJson(const Json::Value &Root,
14 const TypeAnalysisReport &Report) {
15 try {
16 Array = Root["Array"].asBool();
17 for (auto &ArrayID : Root["ArrayIDs"])
18 ArrayIDs.emplace(ArrayID.asUInt());
19 ArrayLen = Root["ArrayLen"].asBool();
20 for (auto &ArrayLenID : Root["ArrayLenIDs"])
21 ArrayLenIDs.emplace(ArrayLenID.asUInt());
22 AssignOperatorRequired = Root["AssignOperatorRequired"].asBool();
23 BufferAllocSize = Root["BufferAllocSize"].asBool();
24 DataType = Root["DataType"].isNull()
25 ? nullptr
26 : std::make_shared<Type>(Root["DataType"], &Report);
27 Declaration = (Definition::DeclType)Root["Declaration"].asUInt();
28 EndOffset = Root["EndOffset"].asUInt();
29 FilePath = Root["FilePath"].asBool();
30 for (auto &FilterJson : Root["Filters"])
31 Filters.emplace(FilterJson.asString());
32 ID = Root["ID"].asUInt();
33 Namespace = Root["Namespace"].asString();
34 Path = util::getNormalizedPath(Root["Path"].asString());
35 Offset = Root["Offset"].asUInt();
36 Length = Root["Length"].asUInt();
37 LoopExit = Root["LoopExit"].asBool();
38 TypeOffset = Root["TypeOffset"].asUInt();
39 TypeString = Root["TypeString"].asString();
40 Value = ASTValue(Root["Value"]);
41 VarName = Root["VarName"].asString();
42 } catch (Json::Exception &E) {
43 return false;
44 }
45 return true;
46}
47
48Json::Value Definition::toJson() const {
49 Json::Value Result;

Callers

nothing calls this directly

Calls 6

getNormalizedPathFunction · 0.85
ASTValueClass · 0.85
asBoolMethod · 0.80
asUIntMethod · 0.80
isNullMethod · 0.80
asStringMethod · 0.80

Tested by

no test coverage detected