From 0ce0c6776aafdf85ec5f0d6116354fc3adcc34f4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 16 Aug 2024 09:02:50 +0300 Subject: [PATCH] implement request getters --- src/app/browser/main/tab/page/navbar.cpp | 29 ++++++++++++++++++++++-- src/app/browser/main/tab/page/navbar.hpp | 9 +++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/app/browser/main/tab/page/navbar.cpp b/src/app/browser/main/tab/page/navbar.cpp index 1321d88e..7c181635 100644 --- a/src/app/browser/main/tab/page/navbar.cpp +++ b/src/app/browser/main/tab/page/navbar.cpp @@ -99,8 +99,33 @@ void Navbar::refresh() ); } -// Getters -Glib::ustring Navbar::get_request_value() +// Public getters +Glib::ustring Navbar::get_request() { return request->get_text(); +} + +std::string Navbar::get_request_scheme() +{ + return request->get_scheme(); +} + +std::string Navbar::get_request_host() +{ + return request->get_host(); +} + +std::string Navbar::get_request_path() +{ + return request->get_path(); +} + +std::string Navbar::get_request_query() +{ + return request->get_query(); +} + +std::string Navbar::get_request_port() +{ + return request->get_port(); } \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar.hpp b/src/app/browser/main/tab/page/navbar.hpp index c3b2fb88..ea8f320c 100644 --- a/src/app/browser/main/tab/page/navbar.hpp +++ b/src/app/browser/main/tab/page/navbar.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace app::browser::main::tab::page { @@ -45,7 +46,13 @@ namespace app::browser::main::tab::page void refresh(); // Getters - Glib::ustring get_request_value(); + Glib::ustring get_request(); + + std::string get_request_scheme(); + std::string get_request_host(); + std::string get_request_port(); + std::string get_request_path(); + std::string get_request_query(); }; }