mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-02-20 15:14:26 +01:00
Added 2 url helpers to Request.
This commit is contained in:
parent
ad4e3bec3c
commit
ef7b39bfb1
@ -200,6 +200,32 @@ void Request::push_path() {
|
|||||||
_path_stack_pointer += 1;
|
_path_stack_pointer += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Request::get_url_root() const {
|
||||||
|
std::string path = "/";
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < _path_stack_pointer; ++i) {
|
||||||
|
path += _path_stack[i];
|
||||||
|
path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Request::get_url_site() const {
|
||||||
|
std::string path = get_host();
|
||||||
|
|
||||||
|
for (uint32_t i = _path_stack_pointer; i < _path_stack.size(); ++i) {
|
||||||
|
path += _path_stack[i];
|
||||||
|
path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Request::get_host() const {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
void Request::update() {
|
void Request::update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ public:
|
|||||||
virtual void send_error(int error_code);
|
virtual void send_error(int error_code);
|
||||||
virtual void reset();
|
virtual void reset();
|
||||||
virtual std::string parser_get_path();
|
virtual std::string parser_get_path();
|
||||||
|
virtual std::string get_host() const;
|
||||||
|
|
||||||
void setup_url_stack();
|
void setup_url_stack();
|
||||||
std::string get_path() const;
|
std::string get_path() const;
|
||||||
@ -72,6 +73,10 @@ public:
|
|||||||
void pop_path();
|
void pop_path();
|
||||||
void push_path();
|
void push_path();
|
||||||
|
|
||||||
|
std::string get_url_root() const;
|
||||||
|
std::string get_url_site() const;
|
||||||
|
|
||||||
|
|
||||||
virtual void update();
|
virtual void update();
|
||||||
virtual void pool();
|
virtual void pool();
|
||||||
|
|
||||||
|
@ -80,6 +80,11 @@ std::string DRequest::parser_get_path() {
|
|||||||
return request->getPath();
|
return request->getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string DRequest::get_host() const {
|
||||||
|
//todo
|
||||||
|
return "/";
|
||||||
|
}
|
||||||
|
|
||||||
void DRequest::update() {
|
void DRequest::update() {
|
||||||
if (file_next) {
|
if (file_next) {
|
||||||
file_next = false;
|
file_next = false;
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
void send_file(const std::string &p_file_path);
|
void send_file(const std::string &p_file_path);
|
||||||
void reset();
|
void reset();
|
||||||
std::string parser_get_path();
|
std::string parser_get_path();
|
||||||
|
std::string get_host() const;
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user