Register both classes to the ClassDB, and added missing methods.

This commit is contained in:
Relintai 2022-07-19 20:36:54 +02:00
parent 147568b18d
commit e96b28c76b
4 changed files with 61 additions and 1 deletions

View File

@ -50,6 +50,14 @@ def get_doc_classes():
"FormField",
"FormValidator",
"HTMLParserAttribute",
"HTMLParserTag",
"HTMLParser",
"BBCodeParserAttribute",
"BBCodeParserTag",
"BBCodeParser",
"WebServerSimple",
"StaticPage",

View File

@ -87,6 +87,27 @@ void BBCodeParserAttribute::_bind_methods() {
ClassDB::bind_method(D_METHOD("print"), &BBCodeParserAttribute::print);
};
int BBCodeParserTag::get_type() {
return _type;
}
void BBCodeParserTag::set_type(const int &val) {
_type = val;
}
String BBCodeParserTag::get_tag() {
return _tag;
}
void BBCodeParserTag::set_tag(const String &val) {
_tag = val;
}
String BBCodeParserTag::get_data() {
return _data;
}
void BBCodeParserTag::set_data(const String &val) {
_data = val;
}
void BBCodeParserTag::add_child_tag(const Ref<BBCodeParserTag> &tag) {
_tags.push_back(tag);
}

View File

@ -35,7 +35,7 @@ bool HTMLParserAttribute::match_all_data(const Vector<String> &d) {
// todo
return false;
}
bool match_all_data_bind(const PoolStringArray &d) {
bool HTMLParserAttribute::match_all_data_bind(const PoolStringArray &d) {
// todo
return false;
}
@ -88,6 +88,27 @@ void HTMLParserAttribute::_bind_methods() {
ClassDB::bind_method(D_METHOD("print"), &HTMLParserAttribute::print);
};
int HTMLParserTag::get_type() {
return _type;
}
void HTMLParserTag::set_type(const int &val) {
_type = val;
}
String HTMLParserTag::get_tag() {
return _tag;
}
void HTMLParserTag::set_tag(const String &val) {
_tag = val;
}
String HTMLParserTag::get_data() {
return _data;
}
void HTMLParserTag::set_data(const String &val) {
_data = val;
}
void HTMLParserTag::add_child_tag(const Ref<HTMLParserTag> &tag) {
_tags.push_back(tag);
}

View File

@ -26,8 +26,10 @@ SOFTWARE.
#include "file_cache.h"
#include "html/bbcode_parser.h"
#include "html/form_validator.h"
#include "html/html_builder_bind.h"
#include "html/html_parser.h"
#include "html/paginator.h"
#include "http/csrf_token.h"
@ -79,6 +81,14 @@ void register_web_types() {
ClassDB::register_class<FormField>();
ClassDB::register_class<FormValidator>();
ClassDB::register_class<HTMLParserAttribute>();
ClassDB::register_class<HTMLParserTag>();
ClassDB::register_class<HTMLParser>();
ClassDB::register_class<BBCodeParserAttribute>();
ClassDB::register_class<BBCodeParserTag>();
ClassDB::register_class<BBCodeParser>();
ClassDB::register_class<FileCache>();
ClassDB::register_class<HTTPServerEnums>();