:relfileprefix: ../../ [#boost-urls-url] = xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::url A modifiable container for a URL. == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class url : public xref:boost/urls/url_base.adoc[url_base]; ---- == Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost/urls/url_view_base/authority.adoc[`authority`] ¦ Return the authority ¦xref:boost/urls/url_view_base/buffer.adoc[`buffer`] ¦ Return the url string ¦xref:boost/urls/url_base/c_str.adoc[`c_str`] ¦ Return the url as a null-terminated string ¦xref:boost/urls/url_base/capacity.adoc[`capacity`] ¦ Return the number of characters that can be stored without reallocating ¦xref:boost/urls/url_base/clear.adoc[`clear`] ¦ Clear the contents while preserving the capacity ¦xref:boost/urls/url_view_base/compare.adoc[`compare`] ¦ Return the result of comparing this with another url ¦xref:boost/urls/url_view_base/data.adoc[`data`] ¦ Return a pointer to the url's character buffer ¦xref:boost/urls/url_view_base/digest.adoc[`digest`] ¦ ¦xref:boost/urls/url_view_base/empty.adoc[`empty`] ¦ Return true if the url is empty ¦xref:boost/urls/url_view_base/encoded_authority.adoc[`encoded_authority`] ¦ Return the authority. ¦xref:boost/urls/url_view_base/encoded_fragment.adoc[`encoded_fragment`] ¦ Return the fragment ¦xref:boost/urls/url_view_base/encoded_host.adoc[`encoded_host`] ¦ Return the host ¦xref:boost/urls/url_view_base/encoded_host_address.adoc[`encoded_host_address`] ¦ Return the host ¦xref:boost/urls/url_view_base/encoded_host_and_port.adoc[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost/urls/url_view_base/encoded_host_name.adoc[`encoded_host_name`] ¦ Return the host name ¦xref:boost/urls/url_view_base/encoded_origin.adoc[`encoded_origin`] ¦ Return the origin ¦xref:boost/urls/url_view_base/encoded_params.adoc[`encoded_params`] ¦ Return the query as a container of parameters ¦xref:boost/urls/url_view_base/encoded_password.adoc[`encoded_password`] ¦ Return the password ¦xref:boost/urls/url_view_base/encoded_path.adoc[`encoded_path`] ¦ Return the path ¦xref:boost/urls/url_view_base/encoded_query.adoc[`encoded_query`] ¦ Return the query ¦xref:boost/urls/url_view_base/encoded_resource.adoc[`encoded_resource`] ¦ Return the resource ¦xref:boost/urls/url_view_base/encoded_segments.adoc[`encoded_segments`] ¦ Return the path as a container of segments ¦xref:boost/urls/url_view_base/encoded_target.adoc[`encoded_target`] ¦ Return the target ¦xref:boost/urls/url_view_base/encoded_user.adoc[`encoded_user`] ¦ Return the user ¦xref:boost/urls/url_view_base/encoded_userinfo.adoc[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost/urls/url_view_base/encoded_zone_id.adoc[`encoded_zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost/urls/url_view_base/fragment.adoc[`fragment`] ¦ Return the fragment ¦xref:boost/urls/url_view_base/has_authority.adoc[`has_authority`] ¦ Return true if an authority is present ¦xref:boost/urls/url_view_base/has_fragment.adoc[`has_fragment`] ¦ Return true if a fragment is present ¦xref:boost/urls/url_view_base/has_password.adoc[`has_password`] ¦ Return true if a password is present ¦xref:boost/urls/url_view_base/has_port.adoc[`has_port`] ¦ Return true if a port is present ¦xref:boost/urls/url_view_base/has_query.adoc[`has_query`] ¦ Return true if a query is present ¦xref:boost/urls/url_view_base/has_scheme.adoc[`has_scheme`] ¦ Return true a scheme is present ¦xref:boost/urls/url_view_base/has_userinfo.adoc[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost/urls/url_view_base/host.adoc[`host`] ¦ Return the host ¦xref:boost/urls/url_view_base/host_address.adoc[`host_address`] ¦ Return the host ¦xref:boost/urls/url_view_base/host_ipv4_address.adoc[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost/urls/url_view_base/host_ipv6_address.adoc[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost/urls/url_view_base/host_ipvfuture.adoc[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost/urls/url_view_base/host_name.adoc[`host_name`] ¦ Return the host name ¦xref:boost/urls/url_view_base/host_type.adoc[`host_type`] ¦ Return the host type ¦xref:boost/urls/url_view_base/is_path_absolute.adoc[`is_path_absolute`] ¦ Return true if the path is absolute ¦xref:boost/urls/url_base/normalize.adoc[`normalize`] ¦ Normalize the URL components ¦xref:boost/urls/url_base/normalize_authority.adoc[`normalize_authority`] ¦ Normalize the URL authority ¦xref:boost/urls/url_base/normalize_fragment.adoc[`normalize_fragment`] ¦ Normalize the URL fragment ¦xref:boost/urls/url_base/normalize_path.adoc[`normalize_path`] ¦ Normalize the URL path ¦xref:boost/urls/url_base/normalize_query.adoc[`normalize_query`] ¦ Normalize the URL query ¦xref:boost/urls/url_base/normalize_scheme.adoc[`normalize_scheme`] ¦ Normalize the URL scheme ¦xref:boost/urls/url_view_base/2conversion.adoc[`operator core::string_view`] ¦ Return the URL as a core::string_view ¦xref:boost/urls/url/operator_assign.adoc[`operator=`] ¦ Assignment ¦xref:boost/urls/url_view_base/params.adoc[`params`] ¦ Return the query as a container of parameters xref:boost/urls/url_view_base/params-05.adoc[url_view_base::params] ¦xref:boost/urls/url_view_base/password.adoc[`password`] ¦ Return the password ¦xref:boost/urls/url_view_base/path.adoc[`path`] ¦ Return the path ¦xref:boost/urls/url_view_base/persist.adoc[`persist`] ¦ Return a shared, persistent copy of the url ¦xref:boost/urls/url_view_base/port.adoc[`port`] ¦ Return the port ¦xref:boost/urls/url_view_base/port_number.adoc[`port_number`] ¦ Return the port ¦xref:boost/urls/url_view_base/query.adoc[`query`] ¦ Return the query ¦xref:boost/urls/url_base/remove_authority.adoc[`remove_authority`] ¦ Remove the authority ¦xref:boost/urls/url_base/remove_fragment.adoc[`remove_fragment`] ¦ Remove the fragment ¦xref:boost/urls/url_base/remove_origin.adoc[`remove_origin`] ¦ Remove the origin component ¦xref:boost/urls/url_base/remove_password.adoc[`remove_password`] ¦ Remove the password ¦xref:boost/urls/url_base/remove_port.adoc[`remove_port`] ¦ Remove the port ¦xref:boost/urls/url_base/remove_query.adoc[`remove_query`] ¦ Remove the query ¦xref:boost/urls/url_base/remove_scheme.adoc[`remove_scheme`] ¦ Remove the scheme ¦xref:boost/urls/url_base/remove_userinfo.adoc[`remove_userinfo`] ¦ Remove the userinfo ¦xref:boost/urls/url_base/reserve.adoc[`reserve`] ¦ Adjust the capacity without changing the size ¦xref:boost/urls/url_base/resolve.adoc[`resolve`] ¦ Resolve a URL reference against this base URL ¦xref:boost/urls/url_view_base/scheme.adoc[`scheme`] ¦ Return the scheme ¦xref:boost/urls/url_view_base/scheme_id.adoc[`scheme_id`] ¦ Return the scheme ¦xref:boost/urls/url_view_base/segments.adoc[`segments`] ¦ Return the path as a container of segments ¦xref:boost/urls/url_base/set_encoded_authority.adoc[`set_encoded_authority`] ¦ Set the authority ¦xref:boost/urls/url_base/set_encoded_fragment.adoc[`set_encoded_fragment`] ¦ Set the fragment. ¦xref:boost/urls/url_base/set_encoded_host.adoc[`set_encoded_host`] ¦ Set the host ¦xref:boost/urls/url_base/set_encoded_host_address.adoc[`set_encoded_host_address`] ¦ Set the host to an address ¦xref:boost/urls/url_base/set_encoded_host_name.adoc[`set_encoded_host_name`] ¦ Set the host to a name ¦xref:boost/urls/url_base/set_encoded_params.adoc[`set_encoded_params`] ¦ Set the query params ¦xref:boost/urls/url_base/set_encoded_password.adoc[`set_encoded_password`] ¦ Set the password. ¦xref:boost/urls/url_base/set_encoded_path.adoc[`set_encoded_path`] ¦ Set the path. ¦xref:boost/urls/url_base/set_encoded_query.adoc[`set_encoded_query`] ¦ Set the query ¦xref:boost/urls/url_base/set_encoded_user.adoc[`set_encoded_user`] ¦ Set the user ¦xref:boost/urls/url_base/set_encoded_userinfo.adoc[`set_encoded_userinfo`] ¦ Set the userinfo. ¦xref:boost/urls/url_base/set_fragment.adoc[`set_fragment`] ¦ Set the fragment. ¦xref:boost/urls/url_base/set_host.adoc[`set_host`] ¦ Set the host ¦xref:boost/urls/url_base/set_host_address.adoc[`set_host_address`] ¦ Set the host to an address ¦xref:boost/urls/url_base/set_host_ipv4.adoc[`set_host_ipv4`] ¦ Set the host to an address ¦xref:boost/urls/url_base/set_host_ipv6.adoc[`set_host_ipv6`] ¦ Set the host to an address ¦xref:boost/urls/url_base/set_host_ipvfuture.adoc[`set_host_ipvfuture`] ¦ Set the host to an address ¦xref:boost/urls/url_base/set_host_name.adoc[`set_host_name`] ¦ Set the host to a name ¦xref:boost/urls/url_base/set_params.adoc[`set_params`] ¦ Set the query params ¦xref:boost/urls/url_base/set_password.adoc[`set_password`] ¦ Set the password. ¦xref:boost/urls/url_base/set_path.adoc[`set_path`] ¦ Set the path. ¦xref:boost/urls/url_base/set_path_absolute.adoc[`set_path_absolute`] ¦ Set if the path is absolute ¦xref:boost/urls/url_base/set_port.adoc[`set_port`] ¦ Set the port ¦xref:boost/urls/url_base/set_port_number.adoc[`set_port_number`] ¦ Set the port ¦xref:boost/urls/url_base/set_query.adoc[`set_query`] ¦ Set the query ¦xref:boost/urls/url_base/set_scheme.adoc[`set_scheme`] ¦ Set the scheme ¦xref:boost/urls/url_base/set_scheme_id.adoc[`set_scheme_id`] ¦ xref:boost/urls/url_base/set_scheme_id.adoc[url_base::set_scheme_id] ¦xref:boost/urls/url_base/set_user.adoc[`set_user`] ¦ Set the user ¦xref:boost/urls/url_base/set_userinfo.adoc[`set_userinfo`] ¦ Set the userinfo ¦xref:boost/urls/url_view_base/size.adoc[`size`] ¦ Return the number of characters in the url ¦xref:boost/urls/url/swap.adoc[`swap`] ¦ Swap the contents. ¦xref:boost/urls/url/2constructor.adoc[`url`] [.small]#[constructor]# ¦ Constructor ¦xref:boost/urls/url_view_base/user.adoc[`user`] ¦ Return the user ¦xref:boost/urls/url_view_base/userinfo.adoc[`userinfo`] ¦ Return the userinfo ¦xref:boost/urls/url_view_base/zone_id.adoc[`zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost/urls/url/2destructor.adoc[`~url`] [.small]#[destructor]# ¦ Destructor |=== == Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost/urls/url_view_base/max_size.adoc[`max_size`] ¦ Return the maximum number of characters possible |=== == Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost/urls/url_view_base/08friend-02.adoc[`operator!=`] ¦ Return the result of comparing two URLs ¦xref:boost/urls/url_view_base/08friend-05.adoc[`operator<`] ¦ Return the result of comparing two URLs ¦xref:boost/urls/url_view_base/08friend-03.adoc[`operator<<`] ¦ ¦xref:boost/urls/url_view_base/08friend-04.adoc[`operator<=`] ¦ Return the result of comparing two URLs ¦xref:boost/urls/url_view_base/08friend-07c.adoc[`operator==`] ¦ Return the result of comparing two URLs ¦xref:boost/urls/url_view_base/08friend-073.adoc[`operator>`] ¦ Return the result of comparing two URLs ¦xref:boost/urls/url_view_base/08friend-06.adoc[`operator>=`] ¦ Return the result of comparing two URLs ¦xref:boost/urls/url_base/08friend.adoc[`resolve`] ¦ ¦xref:boost/urls/url/08friend.adoc[`swap`] ¦ Swap |=== == Description This container owns a url, represented by a null-terminated character buffer which is managed by performing dymamic memory allocations as needed. The contents may be inspected and modified, and the implementation maintains a useful invariant: changes to the url always leave it in a valid state. === Exception Safety * Functions marked `noexcept` provide the no-throw guarantee, otherwise: * Functions which throw offer the strong exception safety guarantee. === BNF [,cpp] ---- URI-reference = URI / relative-ref URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] absolute-URI = scheme ":" hier-part [ "?" query ] ---- === Specification * link:https://tools.ietf.org/html/rfc3986[Uniform Resource Identifier (URI): Generic Syntax (rfc3986)] == See Also xref:boost/urls/parse_absolute_uri.adoc[parse_absolute_uri] , xref:boost/urls/parse_relative_ref.adoc[parse_relative_ref] , xref:boost/urls/parse_uri.adoc[parse_uri] , xref:boost/urls/parse_uri_reference.adoc[parse_uri_reference] , xref:boost/urls/url_base/resolve.adoc[resolve] .