| 55 | } |
| 56 | |
| 57 | std::string FhComment::ToXml() const { |
| 58 | try { |
| 59 | auto xml_file = CreateXmlFile("FileWriter"); |
| 60 | constexpr bool ho_active = false; |
| 61 | auto& root_node = CreateRootNode(*xml_file, ho_active); |
| 62 | ToTx(root_node); |
| 63 | if (tool_id_.IsActive()) { |
| 64 | tool_id_.ToXml(root_node, "tool_id"); |
| 65 | } |
| 66 | if (tool_vendor_.IsActive()) { |
| 67 | tool_vendor_.ToXml(root_node, "tool_vendor"); |
| 68 | } |
| 69 | if (tool_version_.IsActive()) { |
| 70 | tool_version_.ToXml(root_node, "tool_version"); |
| 71 | } |
| 72 | if (user_name_.IsActive()) { |
| 73 | user_name_.ToXml(root_node, "user_name"); |
| 74 | } |
| 75 | ToCommonProp(root_node); |
| 76 | return xml_file->WriteString(true); |
| 77 | } catch (const std::exception& err) { |
| 78 | MDF_ERROR() << "Failed to create the EV comment. Error: " << err.what(); |
| 79 | } |
| 80 | return {}; |
| 81 | } |
| 82 | |
| 83 | void FhComment::FromXml(const std::string& xml_snippet) { |
| 84 | if (xml_snippet.empty()) { |
nothing calls this directly
no test coverage detected