for (xmlAttr* attr = node->properties; attr != NULL; attr = attr->next) {
if (!xmlStrcmp(attr->name, name) && attr->children &&
attr->children->content) {
- return std::string(reinterpret_cast<const char*>(
- attr->children->content));
+ return std::string(
+ reinterpret_cast<const char*>(attr->children->content));
}
}
return std::string();
// This is used for the xml parser to report errors. This assumes the context
// is a pointer to a std::string where the error message should be appended.
-static void XmlErrorFunc(void *context, const char *message, ...) {
+static void XmlErrorFunc(void* context, const char* message, ...) {
va_list args;
va_start(args, message);
std::string* error = static_cast<std::string*>(context);
xmlFreeDoc(document_);
}
- xmlDocPtr get() {
- return document_;
- }
+ xmlDocPtr get() { return document_; }
private:
xmlDocPtr document_;
ScopedXmlErrorFunc error_func(&xml_errors, &XmlErrorFunc);
// Start up the xml parser with the manifest_xml contents.
- ScopedXmlDocument document(xmlParseDoc(
- reinterpret_cast<const xmlChar*>(response_xml.c_str())));
+ ScopedXmlDocument document(
+ xmlParseDoc(reinterpret_cast<const xmlChar*>(response_xml.c_str())));
if (!document.get()) {
ParseError("%s", xml_errors.c_str());
return false;
// Check for the response "protocol" attribute.
if (GetAttribute(root, "protocol") != kExpectedResponseProtocol) {
- ParseError("Missing/incorrect protocol on response tag "
- "(expected '%s')", kExpectedResponseProtocol);
+ ParseError(
+ "Missing/incorrect protocol on response tag "
+ "(expected '%s')",
+ kExpectedResponseProtocol);
return false;
}
}
} // namespace component_updater
-