| 17 | } |
| 18 | |
| 19 | bool TypeAnalysisReport::fromJson(Json::Value Report) { |
| 20 | if (!Report.isMember(getReportType())) |
| 21 | return false; |
| 22 | |
| 23 | const auto &Root = Report[getReportType()]; |
| 24 | if (Root.isMember("enums")) { |
| 25 | const auto &EnumsValue = Root["enums"]; |
| 26 | if (!EnumsValue.isObject()) |
| 27 | return false; |
| 28 | |
| 29 | try { |
| 30 | for (const auto &Name : EnumsValue.getMemberNames()) { |
| 31 | Enums.emplace(Name, std::make_shared<Enum>(EnumsValue[Name])); |
| 32 | } |
| 33 | } catch (Json::LogicError &E) { |
| 34 | return false; |
| 35 | } |
| 36 | } |
| 37 | return true; |
| 38 | } |
| 39 | |
| 40 | const std::map<std::string, std::shared_ptr<Enum>> & |
| 41 | TypeAnalysisReport::getEnums() const { |
nothing calls this directly
no test coverage detected