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

Method fromJson

lib/type/GlobalDef.cpp:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool Enum::fromJson(Json::Value Json) {
37 try {
38 if (Json.isNull() || Json.empty() || !Json["Name"].isString() ||
39 !Json["Enumerators"].isArray())
40 throw Json::LogicError("Abnormal Json Value");
41 Name = Json["Name"].asString();
42 for (auto EnumeratorJson : Json["Enumerators"])
43 Enumerators.emplace_back(EnumeratorJson);
44 } catch (Json::LogicError &E) {
45 llvm::outs() << "[E] " << E.what() << "\n";
46 return false;
47 }
48 return true;
49}
50
51std::string Enum::getName() const { return Name; }
52

Callers

nothing calls this directly

Calls 8

isNullMethod · 0.80
emptyMethod · 0.80
isStringMethod · 0.80
asStringMethod · 0.80
isInt64Method · 0.80
asInt64Method · 0.80
isArrayMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected