-class MyEvent : public mp::HTMLParserEvent {
- public:
- std::string out;
- void openTagStart(const char *name)
- {
- out += "<";
- out += name;
- }
-
- void attribute(const char *tagName,
- const char *name, const char *value)
- {
- out += " ";
- out += name;
- out += "=\"";
- out += value;
- out += "\"";
- }
-
- void anyTagEnd(const char *name)
- {
- out += ">";
- }
-
- void closeTag(const char *name)
- {
- out += "</";
- out += name;
- }
-
- void text(const char *value, int len)
- {
- out.append(value, len);
- }
+class MyEvent : public mp::HTMLParserEvent
+{
+public:
+ std::string out;
+ void openTagStart(const char *tag, int tag_len) {
+ out += "<";
+ out.append(tag, tag_len);
+ }
+
+ void attribute(const char *tag, int tag_len,
+ const char *attr, int attr_len,
+ const char *value, int val_len) {
+ out += " ";
+ out.append(attr, attr_len);
+ out += "=\"";
+ out.append(value, val_len);
+ out += "\"";
+ }
+ void anyTagEnd(const char *tag, int tag_len, int close_it) {
+ if (close_it)
+ out += "/";
+ out += ">";
+ }
+ void closeTag(const char *tag, int tag_len) {
+ out += "</";
+ out.append(tag, tag_len);
+ }
+ void text(const char *value, int len) {
+ out.append(value, len);
+ }