...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A non-owning reference to a valid URL.
Defined in header <boost/url/url_view.hpp>
class url_view : public url_view_base
Name |
Description |
---|---|
Return the authority. |
|
Return the url string. |
|
Return the result of comparing this with another url. |
|
Return a pointer to the url's character buffer. |
|
Return true if the url is empty. |
|
Return the authority. |
|
Return the fragment. |
|
Return the host. |
|
Return the host. |
|
Return the host and port. |
|
Return the host name. |
|
Return the origin. |
|
Return the query as a container of parameters. |
|
Return the password. |
|
Return the path. |
|
Return the query. |
|
Return the resource. |
|
Return the path as a container of segments. |
|
Return the target. |
|
Return the user. |
|
Return the userinfo. |
|
Return the IPv6 Zone ID. |
|
Return the fragment. |
|
Return true if an authority is present. |
|
Return true if a fragment is present. |
|
Return true if a password is present. |
|
Return true if a port is present. |
|
Return true if a query is present. |
|
Return true a scheme is present. |
|
Return true if a userinfo is present. |
|
Return the host. |
|
Return the host. |
|
Return the host IPv4 address. |
|
Return the host IPv6 address. |
|
Return the host IPvFuture address. |
|
Return the host name. |
|
Return the host type. |
|
Return true if the path is absolute. |
|
Assignment. |
|
Return the URL as a core::string_view. |
|
Return the query as a container of parameters. |
|
Return the password. |
|
Return the path. |
|
Return a shared, persistent copy of the url. |
|
Return the port. |
|
Return the port. |
|
Return the query. |
|
Return the scheme. |
|
Return the scheme. |
|
Return the path as a container of segments. |
|
Return the number of characters in the url. |
|
url_view [constructor] |
Constructor. |
Return the user. |
|
Return the userinfo. |
|
Return the IPv6 Zone ID. |
|
~url_view [destructor] |
Destructor. |
Name |
Description |
---|---|
Return the maximum number of characters possible. |
Objects of this type represent valid URL strings constructed from a parsed,
external character buffer whose storage is managed by the caller. That is,
it acts like a core::string_view
in terms of ownership. The
caller is responsible for ensuring that the lifetime of the underlying character
buffer extends until it is no longer referenced.
Construction from a string parses the input as a URI-reference and throws an exception on error. Upon success, the constructed object points to the passed character buffer; ownership is not transferred.
url_view u( "https://www.example.com/index.htm?text=none#a1" );
Parsing functions like parse_uri_reference
return a result
containing either a valid url_view
upon succcess, otherwise
they contain an error. The error can be converted to an exception by the
caller if desired:
system::result< url_view > rv = parse_uri_reference( "https://www.example.com/index.htm?text=none#a1" );
URI-reference = URI / relative-ref URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ]
parse_absolute_uri
,
parse_origin_form
,
parse_relative_ref
,
parse_uri
,
parse_uri_reference
.
Convenience header <boost/url.hpp>