Added 3 helper methods.

This commit is contained in:
Relintai 2021-11-19 08:10:00 +01:00
parent f5afa7eb8e
commit f1965f4bd5
2 changed files with 19 additions and 0 deletions

View File

@ -1,6 +1,20 @@
#include "html_parser.h"
#include "core/error_macros.h"
bool HTMLParserAttribute::match_attrib(const String &attrib) {
return attribute == attrib;
}
bool HTMLParserAttribute::match_data(const String &d) {
return data == d;
}
bool HTMLParserAttribute::match_data(const Vector<String> &d) {
//todo
return false;
}
bool HTMLParserAttribute::contains_data(const String &d) {
return attribute.find(d) != -1;
}
String HTMLParserAttribute::to_string() {
if (single) {
return attribute;

View File

@ -10,6 +10,11 @@ public:
String data;
bool single;
bool match_attrib(const String &attrib);
bool match_data(const String &d);
bool match_data(const Vector<String> &d);
bool contains_data(const String &d);
String to_string();
void print();