| 183 | } |
| 184 | |
| 185 | void Element::recursiveToXML(tinyxml2::XMLElement *xml, const Element *elm) const { |
| 186 | BDLOG("add a xml %p %p", xml, elm); |
| 187 | xml->SetAttribute("bounds", elm->getBounds()->toString().c_str()); |
| 188 | BDLOG("add a xml 111"); |
| 189 | xml->SetAttribute("index", elm->getIndex()); |
| 190 | xml->SetAttribute("class", elm->getClassname().c_str()); |
| 191 | xml->SetAttribute("resource-id", elm->getResourceID().c_str()); |
| 192 | xml->SetAttribute("package", elm->getPackageName().c_str()); |
| 193 | xml->SetAttribute("content-desc", elm->getContentDesc().c_str()); |
| 194 | xml->SetAttribute("checkable", elm->getCheckable() ? "true" : "false"); |
| 195 | xml->SetAttribute("checked", elm->_checked ? "true" : "false"); |
| 196 | xml->SetAttribute("clickable", elm->getClickable() ? "true" : "false"); |
| 197 | xml->SetAttribute("enabled", elm->getEnable() ? "true" : "false"); |
| 198 | xml->SetAttribute("focusable", elm->_focusable ? "true" : "false"); |
| 199 | xml->SetAttribute("focused", elm->_focused ? "true" : "false"); |
| 200 | xml->SetAttribute("scrollable", elm->_scrollable ? "true" : "false"); |
| 201 | xml->SetAttribute("long-clickable", elm->_longClickable ? "true" : "false"); |
| 202 | xml->SetAttribute("password", elm->_password ? "true" : "false"); |
| 203 | xml->SetAttribute("scroll-type", "none"); |
| 204 | |
| 205 | BDLOG("add a xml 1111"); |
| 206 | for (const auto &child: elm->getChildren()) { |
| 207 | tinyxml2::XMLElement *xmlChild = xml->InsertNewChildElement("node"); |
| 208 | xml->LinkEndChild(xmlChild); |
| 209 | recursiveToXML(xmlChild, child.get()); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | std::string Element::toXML() const { |
| 214 | tinyxml2::XMLDocument doc; |
nothing calls this directly
no test coverage detected