mirror of
https://github.com/matrix-construct/construct
synced 2024-05-15 17:33:46 +02:00
ircd::rfc3986::uri: Add path+query extractor convenience.
This commit is contained in:
parent
d4d8063dee
commit
b260bd85a7
|
@ -70,6 +70,7 @@ struct ircd::rfc3986::uri
|
|||
string_view path;
|
||||
string_view query;
|
||||
string_view fragment;
|
||||
string_view resource() const; // path and query string as one
|
||||
|
||||
uri(const string_view &);
|
||||
uri() = default;
|
||||
|
@ -179,3 +180,12 @@ namespace ircd::rfc3986
|
|||
void valid_remote(const string_view &);
|
||||
bool valid_remote(std::nothrow_t, const string_view &);
|
||||
}
|
||||
|
||||
inline ircd::string_view
|
||||
ircd::rfc3986::uri::resource()
|
||||
const
|
||||
{
|
||||
return query?
|
||||
string_view(begin(path), end(query)):
|
||||
path;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue