| 51 | } |
| 52 | |
| 53 | bool InputAnalysisReport::deserialize(Json::Value &Root, |
| 54 | const TypeAnalysisReport &Report) { |
| 55 | try { |
| 56 | const auto &ReportJson = Root[getReportType()]; |
| 57 | for (const auto &DefJson : ReportJson["Definitions"]) { |
| 58 | Definition D; |
| 59 | if (!D.fromJson(DefJson, Report)) |
| 60 | return false; |
| 61 | if (!DefMap.emplace(D.ID, std::make_shared<Definition>(D)).second) |
| 62 | return false; |
| 63 | } |
| 64 | for (const auto &UTJson : ReportJson["unittests"]) |
| 65 | Unittests.emplace_back(UTJson); |
| 66 | } catch (Json::Exception &E) { |
| 67 | return false; |
| 68 | } |
| 69 | return true; |
| 70 | } |
| 71 | |
| 72 | Json::Value InputAnalysisReport::toJson( |
| 73 | const std::map<unsigned, std::shared_ptr<Definition>> &DefMap) const { |