#ifndef THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_
#define THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_
#include <libxml/xmlreader.h>
#include <string>
class ScopedXmlErrorFunc {
public:
ScopedXmlErrorFunc(void* context, xmlGenericErrorFunc func) {
old_error_func_ = xmlGenericError;
old_error_context_ = xmlGenericErrorContext;
xmlSetGenericErrorFunc(context, func);
}
~ScopedXmlErrorFunc() {
xmlSetGenericErrorFunc(old_error_context_, old_error_func_);
}
private:
xmlGenericErrorFunc old_error_func_;
void* old_error_context_;
};
namespace internal {
std::string XmlStringToStdString(const xmlChar* xmlstring);
}
#endif