0
0
Fork 0
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:
Jason Volk 2023-04-04 00:31:14 -07:00
parent d4d8063dee
commit b260bd85a7

View file

@ -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;
}