|
|
constexpr | URI (URI const &) noexcept=default |
| |
|
constexpr | URI (URI &&) noexcept=default |
| |
|
constexpr URI & | operator= (URI const &) noexcept=default |
| |
|
constexpr URI & | operator= (URI &&) noexcept=default |
| |
| constexpr | URI (std::string_view str) |
| | Construct a URL from a string.
|
| |
|
constexpr | URI (std::string const &str) |
| |
|
constexpr | URI (const char *str) |
| |
|
constexpr bool | empty () const noexcept |
| |
|
constexpr | operator bool () const noexcept |
| |
| constexpr std::optional< std::string > const & | scheme () const noexcept |
| | Get the scheme-component of the URI.
|
| |
| constexpr URI & | set_scheme (std::optional< std::string > const &rhs) |
| | Get the scheme-component of the URI.
|
| |
| constexpr std::optional< authority_type > const & | authority () const noexcept |
| | Get the authority-component of the URI.
|
| |
|
constexpr URI & | set_authority (std::optional< authority_type > const &rhs) noexcept |
| |
|
constexpr path_type const & | path () const noexcept |
| |
|
constexpr URI & | set_path (path_type const &rhs) |
| |
|
constexpr std::optional< std::string > | filename () const noexcept |
| |
| constexpr URI & | remove_filename () noexcept |
| | Remove the filename part of the path.
|
| |
| constexpr std::optional< std::string > const & | query () const noexcept |
| | Get the query-component of the URI.
|
| |
|
constexpr URI & | set_query (std::optional< std::string > const &rhs) noexcept |
| |
| constexpr std::optional< std::string > const & | fragment () const noexcept |
| | Get the fragment-component of the URI.
|
| |
|
constexpr URI & | set_fragment (std::optional< std::string > const &rhs) noexcept |
| |
|
| static constexpr std::string | decode (auto first, auto last) |
| | URI percent-encoding decode function.
|
| |
| static constexpr std::string | decode (auto &&range) |
| | URI percent-encoding decode function.
|
| |
| template<char... Extras, typename It , typename ItEnd > |
| static constexpr std::string | encode (It first, ItEnd last) noexcept |
| | URI encode a component.
|
| |
| template<char... Extras, typename Range > |
| static constexpr std::string | encode (Range &&range) noexcept |
| | URI encode a component.
|
| |
|
|
struct | std::hash< URI > |
| |
|
constexpr friend std::string | to_string (URI const &rhs) noexcept |
| |
|
std::ostream & | operator<< (std::ostream &lhs, URI const &rhs) noexcept |
| |
|
constexpr friend bool | operator== (URI const &lhs, URI const &rhs) noexcept=default |
| |
|
constexpr friend auto | operator<=> (URI const &lhs, URI const &rhs) noexcept=default |
| |
|
constexpr friend URI | operator/ (URI const &base, URI const &ref) noexcept |
| |
|
constexpr friend bool | operator== (URI const &lhs, std::string_view rhs) noexcept |
| |
|
constexpr friend auto | operator<=> (URI const &lhs, std::string_view rhs) noexcept |
| |
|
constexpr friend URI | operator/ (URI const &base, std::string_view ref) noexcept |
| |
|
constexpr friend size_t | to_string_size (URI const &rhs) noexcept |
| |
◆ URI()
| constexpr hi::v1::URI::URI |
( |
std::string_view | str | ) |
|
|
inlineexplicitconstexpr |
Construct a URL from a string.
- Note
- This constructor will normalize the URI
- Exceptions
-
| uri_error | When the URI can not be normalized due to a parse error. |
◆ authority()
| constexpr std::optional< authority_type > const & hi::v1::URI::authority |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the authority-component of the URI.
- Returns
- The optional and decoded userinfo, host and port..
◆ decode() [1/2]
| static constexpr std::string hi::v1::URI::decode |
( |
auto && | range | ) |
|
|
inlinestaticconstexpr |
URI percent-encoding decode function.
- Parameters
-
| str | A percent-encoded string. |
- Returns
- A UTF-8 encoded string.
◆ decode() [2/2]
| static constexpr std::string hi::v1::URI::decode |
( |
auto | first, |
|
|
auto | last ) |
|
inlinestaticconstexpr |
URI percent-encoding decode function.
- Parameters
-
| str | A percent-encoded string. |
- Returns
- A UTF-8 encoded string.
◆ encode() [1/2]
template<char... Extras, typename It , typename ItEnd >
| static constexpr std::string hi::v1::URI::encode |
( |
It | first, |
|
|
ItEnd | last ) |
|
inlinestaticconstexprnoexcept |
URI encode a component.
- Template Parameters
-
| extras | The extra characters beyond the unreserved characters to pct-encode. |
- Parameters
-
| rhs | An UTF-8 encoded string, a component or sub-component of a URI. |
- Returns
- A percent-encoded string.
◆ encode() [2/2]
template<char... Extras, typename Range >
| static constexpr std::string hi::v1::URI::encode |
( |
Range && | range | ) |
|
|
inlinestaticconstexprnoexcept |
URI encode a component.
- Template Parameters
-
| extras | The extra characters beyond the unreserved characters to pct-encode. |
- Parameters
-
| rhs | An UTF-8 encoded string, a component or sub-component of a URI. |
- Returns
- A percent-encoded string.
◆ fragment()
| constexpr std::optional< std::string > const & hi::v1::URI::fragment |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the fragment-component of the URI.
- Returns
- The optional and decoded fragment-component.
◆ query()
| constexpr std::optional< std::string > const & hi::v1::URI::query |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the query-component of the URI.
- Returns
- The optional and decoded query-component.
◆ remove_filename()
| constexpr URI & hi::v1::URI::remove_filename |
( |
| ) |
|
|
inlineconstexprnoexcept |
Remove the filename part of the path.
- Note
- No change when the path does not contain a filename.
- Returns
- A reference to this.
◆ scheme()
| constexpr std::optional< std::string > const & hi::v1::URI::scheme |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the scheme-component of the URI.
- Returns
- The optional and lower-cased scheme-component.
◆ set_scheme()
| constexpr URI & hi::v1::URI::set_scheme |
( |
std::optional< std::string > const & | rhs | ) |
|
|
inlineconstexpr |
Get the scheme-component of the URI.
The documentation for this class was generated from the following file: