|
Botan 3.13.0
Crypto and TLS for C&
|
#include <uri.h>
Classes | |
| class | Authority |
Public Types | |
| using | Host = Authority::Host |
| A validated DNS name, or a literal IPv4 or IPv6 address. | |
| using | HostKind = Authority::HostKind |
| Tag for the alternative held by Host. | |
Public Member Functions | |
| const std::optional< Authority > & | authority () const |
| const std::optional< std::string > & | fragment () const |
| std::optional< std::reference_wrapper< const Host > > | host () const |
| std::strong_ordering | operator<=> (const URI &other) const |
| bool | operator== (const URI &other) const |
| const std::string & | original_input () const |
| const std::string & | path () const |
| const std::optional< std::string > & | query () const |
| std::optional< std::string_view > | raw_authority () const |
| const std::string & | scheme () const |
Static Public Member Functions | |
| static std::vector< URI > | filter_scheme (std::string_view scheme, std::span< const URI > uris) |
| static std::optional< URI > | from_string (std::string_view raw) |
| using Botan::URI::Host = Authority::Host |
|
inline |
Return the parsed URI authority, if this URI has one.
Definition at line 132 of file uri.h.
Referenced by from_string(), and Botan::HTTP::http_sync().
|
static |
Return a list of URIs (possibly empty) which match the specified scheme and which contain a non-empty authority
Definition at line 367 of file uri.cpp.
References scheme(), and Botan::tolower_string().
|
inline |
The fragment component, without the leading "#". Nullopt if no "#" was present; present-but-empty distinguishes "http://h/p#" from "http://h/p".
Definition at line 168 of file uri.h.
Referenced by from_string().
|
static |
Parse a URI, return nullopt on failure
Definition at line 164 of file uri.cpp.
References Botan::CharacterValidityTable::alpha_numeric_plus(), authority(), fragment(), Botan::URI::Authority::from_string(), path(), query(), scheme(), and Botan::tolower_string().
Referenced by Botan::AlternativeName::add_uri().
|
inline |
| std::strong_ordering Botan::URI::operator<=> | ( | const URI & | other | ) | const |
Order two URIs
| other | the URI to compare against |
Definition at line 115 of file uri.cpp.
References raw_authority().
| bool Botan::URI::operator== | ( | const URI & | other | ) | const |
Compare two URIs
| other | the URI to compare against |
Definition at line 124 of file uri.cpp.
References raw_authority().
|
inline |
The original input that was parsed.
Definition at line 173 of file uri.h.
Referenced by Botan::URI::Authority::from_string().
|
inline |
The path component, preserved verbatim. Begins with "/" when present; empty if the parsed URI had no path (e.g. "http://example.com" or "http://example.com?q").
Definition at line 154 of file uri.h.
Referenced by from_string(), and Botan::HTTP::http_sync().
|
inline |
The query component, without the leading "?". Nullopt if no "?" was present; present-but-empty distinguishes "http://h/p?" from "http://h/p".
Definition at line 161 of file uri.h.
Referenced by from_string(), and Botan::HTTP::http_sync().
| std::optional< std::string_view > Botan::URI::raw_authority | ( | ) | const |
Return the raw authority component if this URI included one, including the empty string for URIs such as "ldap:///CN=...".
Definition at line 130 of file uri.cpp.
References BOTAN_ASSERT_NOMSG.
Referenced by operator<=>(), and operator==().
|
inline |
Return the scheme, lowercase normalized
Definition at line 127 of file uri.h.
Referenced by filter_scheme(), from_string(), and Botan::HTTP::http_sync().