mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Request get_path now has 2 optional parameters for beginning and end slash placements.
This commit is contained in:
parent
1476a89304
commit
28d53b16f4
@ -188,12 +188,20 @@ void Request::setup_url_stack() {
|
||||
}
|
||||
}
|
||||
|
||||
String Request::get_path() const {
|
||||
String path = "";
|
||||
String Request::get_path(const bool beginning_slash, const bool end_slash) const {
|
||||
String path;
|
||||
|
||||
if (beginning_slash) {
|
||||
path += '/';
|
||||
}
|
||||
|
||||
for (uint32_t i = _path_stack_pointer; i < _path_stack.size(); ++i) {
|
||||
path += _path_stack[i];
|
||||
path += "/";
|
||||
path += '/';
|
||||
}
|
||||
|
||||
if (!end_slash && path.size() > 1) {
|
||||
path.pop_back();
|
||||
}
|
||||
|
||||
return path;
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
virtual String get_host() const;
|
||||
|
||||
void setup_url_stack();
|
||||
String get_path() const;
|
||||
String get_path(const bool beginning_slash = false, const bool end_slash = true) const;
|
||||
virtual const String &get_path_full() const;
|
||||
const String &get_path_segment(const uint32_t i) const;
|
||||
const String &get_current_path_segment() const;
|
||||
|
Loading…
Reference in New Issue
Block a user