From 228cfca0eb5bac6c231bb731311346ec3bca40f0 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 30 Jun 2022 21:22:42 +0200 Subject: [PATCH] Added a new HTTPParser class. --- modules/web/SCsub | 3 +++ modules/web/config.py | 1 + modules/web/http/http_parser.cpp | 10 ++++++++++ modules/web/http/http_parser.h | 15 +++++++++++++++ modules/web/register_types.cpp | 3 ++- 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 modules/web/http/http_parser.cpp create mode 100644 modules/web/http/http_parser.h diff --git a/modules/web/SCsub b/modules/web/SCsub index d32ed5761..a5478379d 100644 --- a/modules/web/SCsub +++ b/modules/web/SCsub @@ -22,11 +22,14 @@ sources = [ "http/web_server_middleware.cpp", "http/web_server_request.cpp", + "http/http_parser.cpp", + "html/html_builder_bind.cpp", "http_server_simple/http_server_simple.cpp", "http_server_simple/web_server_simple.cpp", "http_server_simple/simple_web_server_request.cpp", + ] if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': diff --git a/modules/web/config.py b/modules/web/config.py index 7950c0a21..b2431af29 100644 --- a/modules/web/config.py +++ b/modules/web/config.py @@ -26,6 +26,7 @@ def get_doc_classes(): "WebServerCookie", "WebServerMiddleware", "WebServerRequest", + "HTTPParser", "HTMLBuilder", "HTMLTag", diff --git a/modules/web/http/http_parser.cpp b/modules/web/http/http_parser.cpp new file mode 100644 index 000000000..a5c4cb71b --- /dev/null +++ b/modules/web/http/http_parser.cpp @@ -0,0 +1,10 @@ +#include "http_parser.h" + +HTTPParser::HTTPParser() { +} + +HTTPParser::~HTTPParser() { +} + +void HTTPParser::_bind_methods() { +} diff --git a/modules/web/http/http_parser.h b/modules/web/http/http_parser.h new file mode 100644 index 000000000..07c0b6840 --- /dev/null +++ b/modules/web/http/http_parser.h @@ -0,0 +1,15 @@ +#ifndef HTTP_PARSER_H +#define HTTP_PARSER_H + +#include "core/reference.h" + +class HTTPParser : public Reference { +public: + HTTPParser(); + ~HTTPParser(); + +protected: + static void _bind_methods(); +}; + +#endif diff --git a/modules/web/register_types.cpp b/modules/web/register_types.cpp index e08511a41..09ed73224 100644 --- a/modules/web/register_types.cpp +++ b/modules/web/register_types.cpp @@ -29,6 +29,7 @@ SOFTWARE. #include "html/html_builder_bind.h" #include "http/csrf_token.h" +#include "http/http_parser.h" #include "http/http_server_enums.h" #include "http/http_session.h" #include "http/http_session_manager.h" @@ -62,7 +63,7 @@ void register_web_types() { ClassDB::register_class(); ClassDB::register_class(); - ClassDB::register_class(); + ClassDB::register_class(); } void unregister_web_types() {