= Reference
:mrdocs:


== Namespaces

[cols=1]
|===
| Name 

| <<boost,`boost`>> 
|===


== Namespaces

[cols=1]
|===
| Name 

| <<boost-urls,`urls`>> 
|===


== Namespaces

[cols=1]
|===
| Name 

| <<boost-urls-error_types,`error&lowbar;types`>> 
| <<boost-urls-grammar,`grammar`>> 
| <<boost-urls-string_token,`string&lowbar;token`>> 
|===
== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-authority_view,`authority&lowbar;view`>> 
| A non&hyphen;owning reference to a valid authority

| <<boost-urls-decode_view,`decode&lowbar;view`>> 
| A reference to a valid, percent&hyphen;encoded string

| <<boost-urls-encoding_opts,`encoding&lowbar;opts`>> 
| Percent&hyphen;encoding options

| <<boost-urls-format_arg,`format&lowbar;arg`>> 
| A temporary reference to a formatting argument

| <<boost-urls-ignore_case_param,`ignore&lowbar;case&lowbar;param`>> 
| An optional parameter to determine case&hyphen;sensitivity

| <<boost-urls-ipv4_address,`ipv4&lowbar;address`>> 
| An IP version 4 style address&period;

| <<boost-urls-ipv6_address,`ipv6&lowbar;address`>> 
| An IP version 6 style address&period;

| <<boost-urls-named_arg,`named&lowbar;arg`>> 
| A temporary reference to a named formatting argument

| <<boost-urls-no_value_t,`no&lowbar;value&lowbar;t`>> 
| The type of xref:#boost-urls-no_value[no&lowbar;value]

| <<boost-urls-optional,`optional`>> 
| The type of optional used by the library

| <<boost-urls-param,`param`>> 
| A query parameter

| <<boost-urls-param_pct_view,`param&lowbar;pct&lowbar;view`>> 
| A view of a percent&hyphen;encoded query parameter

| <<boost-urls-param_view,`param&lowbar;view`>> 
| A view of a query parameter

| <<boost-urls-params_base,`params&lowbar;base`>> 
| Common functionality for containers

| <<boost-urls-params_encoded_base,`params&lowbar;encoded&lowbar;base`>> 
| Common functionality for containers

| <<boost-urls-params_encoded_ref,`params&lowbar;encoded&lowbar;ref`>> 
| A view representing query parameters in a URL

| <<boost-urls-params_encoded_view,`params&lowbar;encoded&lowbar;view`>> 
| A view representing query parameters in a URL

| <<boost-urls-params_ref,`params&lowbar;ref`>> 
| A view representing query parameters in a URL

| <<boost-urls-params_view,`params&lowbar;view`>> 
| A view representing query parameters in a URL

| <<boost-urls-pct_string_view,`pct&lowbar;string&lowbar;view`>> 
| A reference to a valid percent&hyphen;encoded string

| <<boost-urls-segments_base,`segments&lowbar;base`>> 
| Common functionality for containers

| <<boost-urls-segments_encoded_base,`segments&lowbar;encoded&lowbar;base`>> 
| Common functionality for containers

| <<boost-urls-segments_encoded_ref,`segments&lowbar;encoded&lowbar;ref`>> 
| A view representing path segments in a URL

| <<boost-urls-segments_encoded_view,`segments&lowbar;encoded&lowbar;view`>> 
| A view representing path segments in a URL

| <<boost-urls-segments_ref,`segments&lowbar;ref`>> 
| A view representing path segments in a URL

| <<boost-urls-segments_view,`segments&lowbar;view`>> 
| A view representing path segments in a URL

| <<boost-urls-static_url,`static&lowbar;url`>> 
| A modifiable container for a URL&period;

| <<boost-urls-static_url_base,`static&lowbar;url&lowbar;base`>> 
| Common implementation for all static URLs

| <<boost-urls-string_view,`string&lowbar;view`>> 
| The type of string&lowbar;view used by the library

| <<boost-urls-url,`url`>> 
| A modifiable container for a URL&period;

| <<boost-urls-url_base,`url&lowbar;base`>> 
| Common functionality for containers

| <<boost-urls-url_view,`url&lowbar;view`>> 
| A non&hyphen;owning reference to a valid URL

| <<boost-urls-url_view_base,`url&lowbar;view&lowbar;base`>> 
| Common functionality for containers

| <<boost-urls-variant,`variant`>> 
| The type of variant used by the library

|===
== Enums

[cols=2]
|===
| Name | Description 

| <<boost-urls-error,`error`>> 
| Error codes returned the library

| <<boost-urls-host_type,`host&lowbar;type`>> 
| Identifies the type of host in a URL&period;

| <<boost-urls-scheme,`scheme`>> 
| Identifies a known URL scheme

|===
== Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-arg,`arg`>> 
| Designate a named argument for a replacement field

| <<boost-urls-default_port,`default&lowbar;port`>> 
| Return the default port for a known scheme

| <<boost-urls-encode,`encode`>> 
| Apply percent&hyphen;encoding to a string

Return a percent&hyphen;encoded string


| <<boost-urls-encoded_size,`encoded&lowbar;size`>> 
| Return the buffer size needed for percent&hyphen;encoding

| <<boost-urls-format,`format`>> 
| Format arguments into a URL


| <<boost-urls-format_to,`format&lowbar;to`>> 
| Format arguments into a URL


| <<boost-urls-make_pct_string_view,`make&lowbar;pct&lowbar;string&lowbar;view`>> 
| Return a valid percent&hyphen;encoded string

| <<boost-urls-operator_not_eq,`operator!&equals;`>> 
| Compare two decode views for inequality

Return the result of comparing two URLs

Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

Return true if two addresses are not equal


| <<boost-urls-operator_lt,`operator&lt;`>> 
| Compare two decode views for less than

Return the result of comparing two URLs

Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;


| <<boost-urls-operator_lshift,`operator&lt;&lt;`>> 
| Format the address to an output stream

Format the address to an output stream&period;

Format the encoded authority to the output stream

Format the string with percent&hyphen;decoding applied to the output stream

Format the url to the output stream

Format to an output stream


| <<boost-urls-operator_le,`operator&lt;&equals;`>> 
| Compare two decode views for less than or equal

Return the result of comparing two URLs

Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;


| <<boost-urls-operator_eq,`operator&equals;&equals;`>> 
| Compare two decode views for equality

Return the result of comparing two URLs

Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

Return true if two addresses are equal


| <<boost-urls-operator_gt,`operator&gt;`>> 
| Compare two decode views for greater than

Return the result of comparing two URLs

Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;


| <<boost-urls-operator_ge,`operator&gt;&equals;`>> 
| Compare two decode views for greater than or equal

Return the result of comparing two URLs

Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;


| <<boost-urls-parse_absolute_uri,`parse&lowbar;absolute&lowbar;uri`>> 
| Return a reference to a parsed URL string

| <<boost-urls-parse_authority,`parse&lowbar;authority`>> 
| Parse an authority

| <<boost-urls-parse_ipv4_address,`parse&lowbar;ipv4&lowbar;address`>> 
| Return an IPv4 address from an IP address string in dotted decimal form

| <<boost-urls-parse_ipv6_address,`parse&lowbar;ipv6&lowbar;address`>> 
| Parse a string containing an IPv6 address&period;

| <<boost-urls-parse_origin_form,`parse&lowbar;origin&lowbar;form`>> 
| Return a reference to a parsed URL string

| <<boost-urls-parse_path,`parse&lowbar;path`>> 
| Parse a string and return an encoded segment view

| <<boost-urls-parse_query,`parse&lowbar;query`>> 
| Parse a string and return an encoded params view

| <<boost-urls-parse_relative_ref,`parse&lowbar;relative&lowbar;ref`>> 
| Return a reference to a parsed URL string

| <<boost-urls-parse_uri,`parse&lowbar;uri`>> 
| Return a reference to a parsed URL string

| <<boost-urls-parse_uri_reference,`parse&lowbar;uri&lowbar;reference`>> 
| Return a reference to a parsed URL string

| <<boost-urls-pct_encoded_rule,`pct&lowbar;encoded&lowbar;rule`>> 
| Rule for a string with percent&hyphen;encoded escapes

| <<boost-urls-resolve,`resolve`>> 
| Resolve a URL reference against a base URL

| <<boost-urls-string_to_scheme,`string&lowbar;to&lowbar;scheme`>> 
| Return the known scheme for a non&hyphen;normalized string, if known

| <<boost-urls-swap,`swap`>> 
| Swap

| <<boost-urls-to_string,`to&lowbar;string`>> 
| Return the normalized string for a known scheme

|===
== Variables

[cols=2]
|===
| Name | Description 

| <<boost-urls-absolute_uri_rule,`absolute&lowbar;uri&lowbar;rule`>> 
| Rule for absolute&hyphen;URI

| <<boost-urls-authority_rule,`authority&lowbar;rule`>> 
| Rule for authority

| <<boost-urls-gen_delim_chars,`gen&lowbar;delim&lowbar;chars`>> 
| The gen&hyphen;delims character set

| <<boost-urls-ignore_case,`ignore&lowbar;case`>> 
| Ignore case when comparing

| <<boost-urls-ipv4_address_rule,`ipv4&lowbar;address&lowbar;rule`>> 
| Rule for an IP version 4 style address

| <<boost-urls-ipv6_address_rule,`ipv6&lowbar;address&lowbar;rule`>> 
| Rule for An IP version 6 style address

| <<boost-urls-no_value,`no&lowbar;value`>> 
| Constant indicating no value in a param

| <<boost-urls-origin_form_rule,`origin&lowbar;form&lowbar;rule`>> 
| Rule for origin&hyphen;form

| <<boost-urls-pchars,`pchars`>> 
| The path character set

| <<boost-urls-query_rule,`query&lowbar;rule`>> 
| Rule for query

| <<boost-urls-relative_ref_rule,`relative&lowbar;ref&lowbar;rule`>> 
| Rule for relative&hyphen;ref

| <<boost-urls-reserved_chars,`reserved&lowbar;chars`>> 
| The reserved character set

| <<boost-urls-sub_delim_chars,`sub&lowbar;delim&lowbar;chars`>> 
| The sub&hyphen;delims character set

| <<boost-urls-unreserved_chars,`unreserved&lowbar;chars`>> 
| The unreserved character set

| <<boost-urls-uri_reference_rule,`uri&lowbar;reference&lowbar;rule`>> 
| Rule for URI&hyphen;reference

| <<boost-urls-uri_rule,`uri&lowbar;rule`>> 
| Rule for URI

|===

== Using Directives

[cols=1]
|===
| Name 

| <<boost-urls-error_types,`error&lowbar;types`>> 
|===


== Namespace Aliases

[cols=2]
|===
| Name | Description 

| <<boost-urls-error_types-errc,`errc`>> 
| The set of constants used for cross&hyphen;platform error codes

|===
== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-error_types-error_category,`error&lowbar;category`>> 
| The type of error category used by the library

| <<boost-urls-error_types-error_code,`error&lowbar;code`>> 
| The type of error code used by the library

| <<boost-urls-error_types-error_condition,`error&lowbar;condition`>> 
| The type of error condition used by the library

| <<boost-urls-error_types-result,`result`>> 
| The type of result returned by library functions

| <<boost-urls-error_types-system_error,`system&lowbar;error`>> 
| The type of system error thrown by the library

|===


The type of error category used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L43[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using error&lowbar;category = <<boost,boost>>::system::error&lowbar;category;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `system&colon;&colon;error&lowbar;category` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




The type of error code used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L65[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using error&lowbar;code = <<boost,boost>>::system::error&lowbar;code;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `system&colon;&colon;error&lowbar;code` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




The type of error condition used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L87[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using error&lowbar;condition = <<boost,boost>>::system::error&lowbar;condition;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `system&colon;&colon;error&lowbar;condition` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




The type of result returned by library functions

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L310[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
using result = <<boost,boost>>::system::result&lt;T, system::error&lowbar;code&gt;;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `system&colon;&colon;result` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;

This is an alias template used as the return type    for functions that can either return a container,    or fail with an error code&period; This is a brief    synopsis of the type&colon;


=== Declaration

[,cpp]
----
template< class T >
class result
{
public:
    //
    // Return true if the result contains an error
    //
    constexpr bool has_error() const noexcept;

    //
    // Return the error
    //
    constexpr system::error_code error() const noexcept;

    //
    // Return true if the result contains a value
    //
    constexpr bool has_value() const noexcept;
    constexpr explicit operator bool() const noexcept;

    //
    // Return the value, or throw an exception
    //
    constexpr T& value();
    constexpr T const& value() const;

    // Return the value.
    // Precondition: has_value()==true
    //
    constexpr T& operator*() noexcept;
    constexpr T* operator->() noexcept;
    constexpr T const& operator*() const noexcept;
    constexpr T const* operator->() const noexcept;

    ...more
----

=== Usage

Given the function xref:#boost-urls-parse_uri[parse&lowbar;uri] with this signature&colon;

[,cpp]
----
system::result< url_view > parse_uri( core::string_view s ) noexcept;
----
The following statement captures the value in a    variable upon success, otherwise throws&colon; 

[,cpp]
----
url_view u = parse_uri( "http://example.com/path/to/file.txt" ).value();
----
This statement captures the result in a local    variable and inspects the error condition&colon; 

[,cpp]
----
system::result< url_view > rv = parse_uri( "http://example.com/path/to/file.txt" );

if(! rv )
    std::cout << rv.error();
else
    std::cout << *rv;
----
* link:https://boost.org/libs/system/doc/html/system.html#ref_resultt_e[&grave;boost&colon;&colon;system&colon;&colon;result&grave;]



== Template Parameters


|===
| Name | Description

| *T*
| The type of value held by the result&period;


|===

== See Also






The type of system error thrown by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L109[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using system&lowbar;error = <<boost,boost>>::system::system&lowbar;error;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `system&colon;&colon;system&lowbar;error` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




The set of constants used for cross&hyphen;platform error codes

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L217[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
namespace errc = <<boost,boost>>::system::errc;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `core&colon;&colon;string&lowbar;view` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




A function to return the generic error category used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L153[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using <<boost,boost>>::system::generic&lowbar;category;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `core&colon;&colon;string&lowbar;view` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;



== Introduced Symbols


|===
| Name
| generic&lowbar;category
|===


A function to return the system error category used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error_types.hpp#L196[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using <<boost,boost>>::system::system&lowbar;category;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `core&colon;&colon;string&lowbar;view` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;



== Introduced Symbols


|===
| Name
| system&lowbar;category
|===


== Namespace Aliases

[cols=1]
|===
| Name 

| <<boost-urls-grammar-string_token,`string&lowbar;token`>> 
|===
== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-aligned_storage,`aligned&lowbar;storage`>> 
| Provides an aligned storage buffer aligned for T

| <<boost-urls-grammar-ci_equal,`ci&lowbar;equal`>> 
| A case&hyphen;insensitive equals predicate for strings

| <<boost-urls-grammar-ci_hash,`ci&lowbar;hash`>> 
| A case&hyphen;insensitive hash function object for strings

| <<boost-urls-grammar-ci_less,`ci&lowbar;less`>> 
| A case&hyphen;insensitive less predicate for strings

| <<boost-urls-grammar-is_charset,`is&lowbar;charset`>> 
| Alias for `std&colon;&colon;true&lowbar;type` if T satisfies xref:#boost-urls-grammar-CharSet[CharSet]&period;

| <<boost-urls-grammar-is_rule,`is&lowbar;rule`>> 
| Determine if T meets the requirements of xref:#boost-urls-grammar-Rule[Rule]

| <<boost-urls-grammar-literal_rule,`literal&lowbar;rule`>> 
| Match a string literal exactly

| <<boost-urls-grammar-lut_chars,`lut&lowbar;chars`>> 
| A set of characters

| <<boost-urls-grammar-range,`range`>> 
| A forward range of parsed elements

| <<boost-urls-grammar-recycled,`recycled`>> 
| A thread&hyphen;safe collection of instances of T

| <<boost-urls-grammar-recycled_ptr,`recycled&lowbar;ptr`>> 
| A pointer to a shared instance of T

| <<boost-urls-grammar-string_view_base,`string&lowbar;view&lowbar;base`>> 
| Common functionality for string views

| <<boost-urls-grammar-unsigned_rule,`unsigned&lowbar;rule`>> 
| Match an unsigned decimal

|===
== Enums

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-condition,`condition`>> 
| Error conditions for errors received from rules

| <<boost-urls-grammar-error,`error`>> 
| Error codes returned when using rules

|===
== Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-ci_compare,`ci&lowbar;compare`>> 
| Return the case&hyphen;insensitive comparison of s0 and s1

| <<boost-urls-grammar-ci_digest,`ci&lowbar;digest`>> 
| Return the case&hyphen;insensitive digest of a string

| <<boost-urls-grammar-ci_is_equal,`ci&lowbar;is&lowbar;equal`>> 
| Return true if s0 equals s1 using case&hyphen;insensitive comparison


| <<boost-urls-grammar-ci_is_less,`ci&lowbar;is&lowbar;less`>> 
| Return true if s0 is less than s1 using case&hyphen;insensitive comparison

| <<boost-urls-grammar-delim_rule,`delim&lowbar;rule`>> 
| Match a character literal

Match a single character from a character set


| <<boost-urls-grammar-find_if,`find&lowbar;if`>> 
| Find the first character in the string that is in the set&period;

| <<boost-urls-grammar-find_if_not,`find&lowbar;if&lowbar;not`>> 
| Find the first character in the string that is not in CharSet

| <<boost-urls-grammar-hexdig_value,`hexdig&lowbar;value`>> 
| Return the decimal value of a hex character

| <<boost-urls-grammar-not_empty_rule,`not&lowbar;empty&lowbar;rule`>> 
| Match another rule, if the result is not empty

| <<boost-urls-grammar-operator_not_eq,`operator!&equals;`>> 
| Compare two string views for inequality

| <<boost-urls-grammar-operator_plus,`operator&plus;`>> 
| Return the union of two character sets&period;

| <<boost-urls-grammar-operator_minus,`operator&hyphen;`>> 
| Return a new character set by subtracting

| <<boost-urls-grammar-operator_lt,`operator&lt;`>> 
| Compare two string views for less than

| <<boost-urls-grammar-operator_lshift,`operator&lt;&lt;`>> 
| Format a string to an output stream

| <<boost-urls-grammar-operator_le,`operator&lt;&equals;`>> 
| Compare two string views for less than or equal

| <<boost-urls-grammar-operator_eq,`operator&equals;&equals;`>> 
| Compare two string views for equality

| <<boost-urls-grammar-operator_gt,`operator&gt;`>> 
| Compare two string views for greater than

| <<boost-urls-grammar-operator_ge,`operator&gt;&equals;`>> 
| Compare two string views for greater than or equal

| <<boost-urls-grammar-optional_rule,`optional&lowbar;rule`>> 
| Match a rule, or the empty string

| <<boost-urls-grammar-parse,`parse`>> 
| Parse a character buffer using a rule


| <<boost-urls-grammar-range_rule,`range&lowbar;rule`>> 
| Match a repeating number of elements


| <<boost-urls-grammar-ref,`ref`>> 
| Return a reference to a character set

Return a reference to a rule


| <<boost-urls-grammar-squelch,`squelch`>> 
| Squelch the value of a rule

| <<boost-urls-grammar-to_lower,`to&lowbar;lower`>> 
| Return c converted to lowercase

| <<boost-urls-grammar-to_upper,`to&lowbar;upper`>> 
| Return c converted to uppercase

| <<boost-urls-grammar-token_rule,`token&lowbar;rule`>> 
| Match a non&hyphen;empty string of characters from a set

| <<boost-urls-grammar-tuple_rule,`tuple&lowbar;rule`>> 
| Match a series of rules in order

| <<boost-urls-grammar-variant_rule,`variant&lowbar;rule`>> 
| Match one of a set of rules

|===
== Variables

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-all_chars,`all&lowbar;chars`>> 
| The set of all characters

| <<boost-urls-grammar-alnum_chars,`alnum&lowbar;chars`>> 
| The set of letters and digits

| <<boost-urls-grammar-alpha_chars,`alpha&lowbar;chars`>> 
| The set of all letters

| <<boost-urls-grammar-dec_octet_rule,`dec&lowbar;octet&lowbar;rule`>> 
| Match a decimal octet

| <<boost-urls-grammar-digit_chars,`digit&lowbar;chars`>> 
| The set of decimal digits

| <<boost-urls-grammar-hexdig_chars,`hexdig&lowbar;chars`>> 
| The set of hexadecimal digits

| <<boost-urls-grammar-vchars,`vchars`>> 
| The set of visible characters

|===
== Concepts

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-CharSet,`CharSet`>> 
| Concept for a CharSet

| <<boost-urls-grammar-Rule,`Rule`>> 
| Concept for a grammar Rule

|===


Match a string literal exactly

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/literal_rule.hpp#L44[boost&sol;url&sol;grammar&sol;literal&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class literal&lowbar;rule;
----

== Types

[cols=1]
|===
| Name 

| <<boost-urls-grammar-literal_rule-value_type,`value&lowbar;type`>> 
|===
== Member Functions

[cols=1]
|===
| Name 

| <<boost-urls-grammar-literal_rule-2constructor,`literal&lowbar;rule`>>         [.small]#[constructor]#
| <<boost-urls-grammar-literal_rule-parse,`parse`>> 
|===



== Description


If there is no more input, or if the    end of the input is reached, and a prefix    of the literal matches exactly, the error    returned is xref:#boost-urls-grammar-error[error&colon;&colon;need&lowbar;more]&period;


=== Value Type

[,cpp]
----
using value_type = core::string_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-literal_rule-parse[parse]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "HTTP", literal_rule( "HTTP" ) );
----


== See Also


xref:#boost-urls-grammar-delim_rule-01[delim&lowbar;rule],        xref:#boost-urls-grammar-literal_rule-parse[parse]&period;





== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/literal_rule.hpp#L62[boost&sol;url&sol;grammar&sol;literal&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
literal&lowbar;rule(char const* s) noexcept;
----


== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/literal_rule.hpp#L72[boost&sol;url&sol;grammar&sol;literal&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-grammar-literal_rule-value_type,value&lowbar;type>>&gt;
parse(
    char const*& it,
    char const* end) const noexcept;
----


== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/literal_rule.hpp#L60[boost&sol;url&sol;grammar&sol;literal&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = core::string&lowbar;view;
----


A set of characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L64[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class lut&lowbar;chars;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-lut_chars-2constructor,`lut&lowbar;chars`>>         [.small]#[constructor]#
| Constructor

Constructor&period;


| <<boost-urls-grammar-lut_chars-operator_call,`operator()`>> 
| Return true if ch is in the character set&period;


| <<boost-urls-grammar-lut_chars-operator_bitnot,`operator&#126;`>> 
| Return a new character set which is the complement of another character set&period;

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-lut_chars-08friend-02,`operator&plus;`>> 
| Return the union of two character sets&period;

| <<boost-urls-grammar-lut_chars-08friend-07,`operator&hyphen;`>> 
| Return a new character set by subtracting

|===



== Description


The characters defined by instances of    this set are provided upon construction&period;    The `constexpr` implementation allows    these to become compile&hyphen;time constants&period;


=== Example

Character sets are used with rules and the    functions xref:#boost-urls-grammar-find_if[find&lowbar;if] and xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;

[,cpp]
----
constexpr lut_chars vowel_chars = "AEIOU" "aeiou";

system::result< core::string_view > rv = parse( "Aiea", token_rule( vowel_chars ) );
----


== See Also


xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L157[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-lut_chars-2constructor-079,lut&lowbar;chars>>(char ch) noexcept;
----

[.small]#<<boost-urls-grammar-lut_chars-2constructor-079,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-lut_chars-2constructor-074,lut&lowbar;chars>>(char const* s) noexcept;
----

[.small]#<<boost-urls-grammar-lut_chars-2constructor-074,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Pred&gt;
requires detail&colon;&colon;is&lowbar;pred&lt;Pred&gt;&colon;&colon;value &amp;&amp;
        ! std&colon;&colon;is&lowbar;base&lowbar;of&lt;
            lut&lowbar;chars, Pred&gt;&colon;&colon;value
constexpr
<<boost-urls-grammar-lut_chars-2constructor-02,lut&lowbar;chars>>(Pred const& pred) noexcept;
----

[.small]#<<boost-urls-grammar-lut_chars-2constructor-02,_» more..._>>#

== Description


This function constructs a character        set which has as a single member,        the character `ch`&period;


=== Example

[,cpp]
----
constexpr lut_chars asterisk( '*' );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *ch*
| A character&period;


| *s*
| A null&hyphen;terminated string&period;


| *pred*
| The function object to        use for determining membership in        the character set&period;


|===


Constructor&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L227[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Pred&gt;
requires detail&colon;&colon;is&lowbar;pred&lt;Pred&gt;&colon;&colon;value &amp;&amp;
        ! std&colon;&colon;is&lowbar;base&lowbar;of&lt;
            lut&lowbar;chars, Pred&gt;&colon;&colon;value
constexpr
lut&lowbar;chars(Pred const& pred) noexcept;
----

== Description


This function constructs a character        set which has as members, every value        of `char ch` for which the expression        `pred(ch)` returns `true`&period;


=== Example

[,cpp]
----
struct is_digit
{
    constexpr bool
    operator()(char c ) const noexcept
    {
        return c >= '0' && c <= '9';
    }
};

constexpr lut_chars digits( is_digit{} );
----

=== Complexity

Linear in `pred`, or constant if        `pred(ch)` is a constant expression&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *pred*
| The function object to        use for determining membership in        the character set&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L157[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
lut&lowbar;chars(char ch) noexcept;
----

== Description


This function constructs a character        set which has as a single member,        the character `ch`&period;


=== Example

[,cpp]
----
constexpr lut_chars asterisk( '*' );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *ch*
| A character&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L188[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
lut&lowbar;chars(char const* s) noexcept;
----

== Description


This function constructs a character        set which has as members, all of the        characters present in the null&hyphen;terminated        string `s`&period;


=== Example

[,cpp]
----
constexpr lut_chars digits = "0123456789";
----

=== Complexity

Linear in `&colon;&colon;strlen(s)`, or constant        if `s` is a constant expression&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *s*
| A null&hyphen;terminated string&period;


|===


Return true if ch is in the character set&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L256[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-lut_chars-operator_call-0fe,operator()>>(unsigned char ch) const noexcept;
----

[.small]#<<boost-urls-grammar-lut_chars-operator_call-0fe,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-lut_chars-operator_call-0f6,operator()>>(char ch) const noexcept;
----

[.small]#<<boost-urls-grammar-lut_chars-operator_call-0f6,_» more..._>>#

== Description


This function returns true if the        character `ch` is in the set, otherwise        it returns false&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *ch*
| The character to test&period;


|===


Return true if ch is in the character set&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L256[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator()(unsigned char ch) const noexcept;
----

== Description


This function returns true if the        character `ch` is in the set, otherwise        it returns false&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *ch*
| The character to test&period;


|===


Return true if ch is in the character set&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L265[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator()(char ch) const noexcept;
----

== Description


This function returns true if the        character `ch` is in the set, otherwise        it returns false&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *ch*
| The character to test&period;


|===


Return a new character set which is the complement of another character set&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L371[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-lut_chars,lut&lowbar;chars>>
operator&#126;() const noexcept;
----

== Description


This function returns a new character        set which contains all of the characters        that are not in `&ast;this`&period;


=== Example

This statement declares a character set        containing everything but vowels&colon; 

[,cpp]
----
constexpr lut_chars not_vowels = ~lut_chars( "AEIOU" "aeiou" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Return Value


The new character set&period;




Return the union of two character sets&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L299[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
<<boost-urls-grammar-lut_chars,lut&lowbar;chars>>
operator&plus;(
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs0,
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs1) noexcept;
----

== Description


This function returns a new character        set which contains all of the characters        in `cs0` as well as all of the characters        in `cs`&period;


=== Example

This creates a character set which        includes all letters and numbers 

[,cpp]
----
constexpr lut_chars alpha_chars(
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    "abcdefghijklmnopqrstuvwxyz");

constexpr lut_chars alnum_chars = alpha_chars + "0123456789";
----

=== Complexity

Constant&period;



== Return Value


The new character set&period;



== Parameters


|===
| Name | Description

| *cs0*
| A character to join


| *cs1*
| A character to join


|===


Return a new character set by subtracting

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L336[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
<<boost-urls-grammar-lut_chars,lut&lowbar;chars>>
operator&hyphen;(
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs0,
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs1) noexcept;
----

== Description


This function returns a new character        set which is formed from all of the        characters in `cs0` which are not in `cs`&period;


=== Example

This statement declares a character set        containing all the lowercase letters        which are not vowels&colon;

[,cpp]
----
constexpr lut_chars consonants = lut_chars("abcdefghijklmnopqrstuvwxyz") - "aeiou";
----

=== Complexity

Constant&period;



== Return Value


The new character set&period;



== Parameters


|===
| Name | Description

| *cs0*
| A character set to join&period;


| *cs1*
| A character set to join&period;


|===


A forward range of parsed elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L62[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
class range;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-range-const_iterator,`const&lowbar;iterator`>> 
| A constant, forward iterator to elements of the range

| <<boost-urls-grammar-range-const_reference,`const&lowbar;reference`>> 
| The type of each element of the range

| <<boost-urls-grammar-range-difference_type,`difference&lowbar;type`>> 
| The type used to represent signed integers

| <<boost-urls-grammar-range-iterator,`iterator`>> 
| A constant, forward iterator to elements of the range

| <<boost-urls-grammar-range-pointer,`pointer`>> 
| Provided for compatibility, unused

| <<boost-urls-grammar-range-reference,`reference`>> 
| The type of each element of the range

| <<boost-urls-grammar-range-size_type,`size&lowbar;type`>> 
| The type used to represent unsigned integers

| <<boost-urls-grammar-range-value_type,`value&lowbar;type`>> 
| The type of each element of the range

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-range-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-grammar-range-empty,`empty`>> 
| Return true if the range is empty

| <<boost-urls-grammar-range-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-grammar-range-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-grammar-range-2constructor,`range`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-grammar-range-size,`size`>> 
| Return the number of elements in the range

| <<boost-urls-grammar-range-string,`string`>> 
| Return the matching part of the string

| <<boost-urls-grammar-range-2destructor,`&#126;range`>> [.small]#[destructor]#
| Destructor

|===



== Description


Objects of this type are forward ranges    returned when parsing using the    xref:#boost-urls-grammar-range_rule-06[range&lowbar;rule]&period;    Iteration is performed by re&hyphen;parsing the    underlying character buffer&period; Ownership    of the buffer is not transferred&semi; the    caller is responsible for ensuring that    the lifetime of the buffer extends until    it is no longer referenced by the range&period;

[NOTE]
The implementation may use temporary,    recycled storage for type&hyphen;erasure&period; Objects    of type `range` are intended to be used    ephemerally&period; That is, for short durations    such as within a function scope&period; If it is    necessary to store the range for a long    period of time or with static storage    duration, it is necessary to copy the    contents to an object of a different type&period;



== Template Parameters


|===
| Name | Description

| *T*
| The value type of the range


|===

== See Also


xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-range_rule-06[range&lowbar;rule]&period;





A constant, forward iterator to elements of the range

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L160[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator;
----





Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L245[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range-iterator,iterator>>
begin() const noexcept;
----


Return true if the range is empty

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L253[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----


Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L249[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range-iterator,iterator>>
end() const noexcept;
----


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L224[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range,range>>&
<<boost-urls-grammar-range-operator_assign-08,operator&equals;>>(<<boost-urls-grammar-range,range>>&&) noexcept;
----

[.small]#<<boost-urls-grammar-range-operator_assign-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range,range>>&
<<boost-urls-grammar-range-operator_assign-0e,operator&equals;>>(<<boost-urls-grammar-range,range>> const&) noexcept;
----

[.small]#<<boost-urls-grammar-range-operator_assign-0e,_» more..._>>#

== Description


After the move, this references the        same underlying character buffer&period; Ownership        is not transferred&semi; the caller is responsible        for ensuring that the lifetime of the buffer        extends until it is no longer referenced&period;        The moved&hyphen;from object becomes as if        default&hyphen;constructed&period;


=== Exception Safety

Throws nothing&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L224[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range,range>>&
operator&equals;(<<boost-urls-grammar-range,range>>&&) noexcept;
----

== Description


After the move, this references the        same underlying character buffer&period; Ownership        is not transferred&semi; the caller is responsible        for ensuring that the lifetime of the buffer        extends until it is no longer referenced&period;        The moved&hyphen;from object becomes as if        default&hyphen;constructed&period;


=== Exception Safety

Throws nothing&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L240[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range,range>>&
operator&equals;(<<boost-urls-grammar-range,range>> const&) noexcept;
----

== Description


The copy references the same        underlying character buffer&period;        Ownership is not transferred&semi; the        caller is responsible for ensuring        that the lifetime of the buffer        extends until it is no longer        referenced&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L178[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range-2constructor-01e,range>>() noexcept;
----

[.small]#<<boost-urls-grammar-range-2constructor-01e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range-2constructor-08,range>>(<<boost-urls-grammar-range,range>>&&) noexcept;
----

[.small]#<<boost-urls-grammar-range-2constructor-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-range-2constructor-01b,range>>(<<boost-urls-grammar-range,range>> const&) noexcept;
----

[.small]#<<boost-urls-grammar-range-2constructor-01b,_» more..._>>#

== Description


Default&hyphen;constructed ranges have        zero elements&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L178[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
range() noexcept;
----

== Description


Default&hyphen;constructed ranges have        zero elements&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L194[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
range(<<boost-urls-grammar-range,range>>&&) noexcept;
----

== Description


The new range references the        same underlying character buffer&period;        Ownership is not transferred&semi; the        caller is responsible for ensuring        that the lifetime of the buffer        extends until it is no longer        referenced&period; The moved&hyphen;from object        becomes as if default&hyphen;constructed&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L209[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
range(<<boost-urls-grammar-range,range>> const&) noexcept;
----

== Description


The copy references the same        underlying character buffer&period;        Ownership is not transferred&semi; the        caller is responsible for ensuring        that the lifetime of the buffer        extends until it is no longer        referenced&period;


=== Exception Safety

Throws nothing&period;




Return the number of elements in the range

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L261[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
size() const noexcept;
----


Return the matching part of the string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L269[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
string() const noexcept;
----


Destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L168[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&#126;range();
----


A constant, forward iterator to elements of the range

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L164[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = <<boost-urls-grammar-range-iterator,iterator>>;
----


The type of each element of the range

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L144[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = T const&;
----


The type used to represent signed integers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L156[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using difference&lowbar;type = std::ptrdiff&lowbar;t;
----


Provided for compatibility, unused

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L148[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using pointer = void const*;
----


The type of each element of the range

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L140[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = T const&;
----


The type used to represent unsigned integers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L152[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using size&lowbar;type = std::size&lowbar;t;
----


The type of each element of the range

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L136[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = T;
----


A thread&hyphen;safe collection of instances of T

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L71[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
class recycled;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-recycled-2constructor,`recycled`>>         [.small]#[constructor]#
| Constructor

| <<boost-urls-grammar-recycled-2destructor,`&#126;recycled`>> [.small]#[destructor]#
| Destructor

|===



== Description


Instances of this type may be used to control    where recycled instances of T come from when    used with xref:#boost-urls-grammar-recycled_ptr[recycled&lowbar;ptr]&period;


=== Example

[,cpp]
----
static recycled< std::string > bin;

recycled_ptr< std::string > ps( bin );

// Put the string into a known state
ps->clear();
----


== See Also


xref:#boost-urls-grammar-recycled_ptr[recycled&lowbar;ptr]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L86[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
recycled() = default;
----


Destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L82[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&#126;recycled();
----

== Description


All recycled instances of T are destroyed&period;        Undefined behavior results if there are        any xref:#boost-urls-grammar-recycled_ptr[recycled&lowbar;ptr] which reference        this recycle bin&period;




A pointer to a shared instance of T

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L148[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
class recycled&lowbar;ptr;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-recycled_ptr-acquire,`acquire`>> 
| Return the referenced object

| <<boost-urls-grammar-recycled_ptr-bin,`bin`>> 
| Return the referenced recycle bin

| <<boost-urls-grammar-recycled_ptr-empty,`empty`>> 
| Return true if this does not reference an object

| <<boost-urls-grammar-recycled_ptr-get,`get`>> 
| Return the referenced object

| <<boost-urls-grammar-recycled_ptr-2conversion,`operator bool`>> 
| Return true if this references an object

| <<boost-urls-grammar-recycled_ptr-operator_star,`operator&ast;`>> 
| Return the referenced object

| <<boost-urls-grammar-recycled_ptr-operator_ptr,`operator&hyphen;&gt;`>> 
| Return the referenced object

| <<boost-urls-grammar-recycled_ptr-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-grammar-recycled_ptr-2constructor,`recycled&lowbar;ptr`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-grammar-recycled_ptr-release,`release`>> 
| Release the referenced object

| <<boost-urls-grammar-recycled_ptr-2destructor,`&#126;recycled&lowbar;ptr`>> [.small]#[destructor]#
| Destructor

|===



== Description


This is a smart pointer container which can    acquire shared ownership of an instance of    `T` upon or after construction&period; The instance    is guaranteed to be in a valid, but unknown    state&period; Every recycled pointer references    a valid recycle bin&period;


=== Example

[,cpp]
----
static recycled< std::string > bin;

recycled_ptr< std::string > ps( bin );

// Put the string into a known state
ps->clear();
----


== Template Parameters


|===
| Name | Description

| *T*
| the type of object to        acquire, which must be        _DefaultConstructible_&period;


|===


Return the referenced object

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L483[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
T&
acquire();
----

== Description


If this references an object, it is        returned&period; Otherwise, exclusive ownership        of a new object of type `T` is acquired        and returned&period;


=== Postconditions

[,cpp]
----
not this->empty()
----



Return the referenced recycle bin

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L429[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled,recycled>>&lt;T&gt;&
bin() const noexcept;
----

== Description



=== Exception Safety

Throws nothing&period;




Return true if this does not reference an object

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L402[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description



=== Exception Safety

Throws nothing&period;




Return the referenced object

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L442[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
T*
get() const noexcept;
----

== Description


If this is empty, `nullptr` is returned&period;


=== Exception Safety

Throws nothing&period;




Return true if this references an object

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L418[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
operator bool() const noexcept;
----

== Description



=== Effects

[,cpp]
----
return ! this->empty();
----

=== Exception Safety

Throws nothing&period;




Return the referenced object

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L466[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
T&
operator&ast;() const noexcept;
----

== Description



=== Preconditions

[,cpp]
----
not this->empty()
----



Return the referenced object

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L454[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
T*
operator&hyphen;&gt;() const noexcept;
----

== Description


If this is empty, `nullptr` is returned&period;


=== Exception Safety

Throws nothing&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L366[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&
<<boost-urls-grammar-recycled_ptr-operator_assign-0b,operator&equals;>>(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&& other) noexcept;
----

[.small]#<<boost-urls-grammar-recycled_ptr-operator_assign-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&
<<boost-urls-grammar-recycled_ptr-operator_assign-09,operator&equals;>>(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>> const& other) noexcept;
----

[.small]#<<boost-urls-grammar-recycled_ptr-operator_assign-09,_» more..._>>#

== Description


If `other` references an object,        ownership is transferred including        a reference to the recycle bin&period; After        the move, the moved&hyphen;from object is empty&period;


=== Effects

[,cpp]
----
this->release()
----

=== Postconditions

[,cpp]
----
&this->bin() == &other->bin()
----

=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The pointer to move from


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L366[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&
operator&equals;(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&& other) noexcept;
----

== Description


If `other` references an object,        ownership is transferred including        a reference to the recycle bin&period; After        the move, the moved&hyphen;from object is empty&period;


=== Effects

[,cpp]
----
this->release()
----

=== Postconditions

[,cpp]
----
&this->bin() == &other->bin()
----

=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The pointer to move from


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L393[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&
operator&equals;(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>> const& other) noexcept;
----

== Description


If `other` references an object,        this acquires shared ownership and        references the same recycle bin as        `other`&period; The previous object if any        is released&period;


=== Effects

[,cpp]
----
this->release()
----

=== Postconditions

[,cpp]
----
&this->bin() == &other->bin() && this->get() == other.get()
----

=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The pointer to copy from


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L208[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-grammar-recycled_ptr-2constructor-08,recycled&lowbar;ptr>>(<<boost-urls-grammar-recycled,recycled>>&lt;T&gt;& bin);
----

[.small]#<<boost-urls-grammar-recycled_ptr-2constructor-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr-2constructor-0ac,recycled&lowbar;ptr>>(
    <<boost-urls-grammar-recycled,recycled>>&lt;T&gt;& bin,
    std::nullptr&lowbar;t) noexcept;
----

[.small]#<<boost-urls-grammar-recycled_ptr-2constructor-0ac,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr-2constructor-056,recycled&lowbar;ptr>>();
----

[.small]#<<boost-urls-grammar-recycled_ptr-2constructor-056,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr-2constructor-05e,recycled&lowbar;ptr>>(std::nullptr&lowbar;t) noexcept;
----

[.small]#<<boost-urls-grammar-recycled_ptr-2constructor-05e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr-2constructor-0ab,recycled&lowbar;ptr>>(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>> const& other) noexcept;
----

[.small]#<<boost-urls-grammar-recycled_ptr-2constructor-0ab,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-grammar-recycled_ptr-2constructor-0f,recycled&lowbar;ptr>>(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&& other) noexcept;
----

[.small]#<<boost-urls-grammar-recycled_ptr-2constructor-0f,_» more..._>>#

== Description


Upon construction, this acquires        exclusive access to an object of type        `T` which is either recycled from the        specified bin, or newly allocated&period;        The object is in an unknown but        valid state&period;


=== Example

[,cpp]
----
static recycled< std::string > bin;

recycled_ptr< std::string > ps( bin );

// Put the string into a known state
ps->clear();
----

=== Postconditions

[,cpp]
----
&this->bin() == &bin && ! this->empty()
----


== Parameters


|===
| Name | Description

| *bin*
| The recycle bin to use


| *other*
| The pointer to copy


|===

== See Also


xref:#boost-urls-grammar-recycled[recycled]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L208[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
recycled&lowbar;ptr(<<boost-urls-grammar-recycled,recycled>>&lt;T&gt;& bin);
----

== Description


Upon construction, this acquires        exclusive access to an object of type        `T` which is either recycled from the        specified bin, or newly allocated&period;        The object is in an unknown but        valid state&period;


=== Example

[,cpp]
----
static recycled< std::string > bin;

recycled_ptr< std::string > ps( bin );

// Put the string into a known state
ps->clear();
----

=== Postconditions

[,cpp]
----
&this->bin() == &bin && ! this->empty()
----


== Parameters


|===
| Name | Description

| *bin*
| The recycle bin to use


|===

== See Also


xref:#boost-urls-grammar-recycled[recycled]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L242[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
recycled&lowbar;ptr(
    <<boost-urls-grammar-recycled,recycled>>&lt;T&gt;& bin,
    std::nullptr&lowbar;t) noexcept;
----

== Description


After construction, this is empty and        refers to the specified recycle bin&period;


=== Example

[,cpp]
----
static recycled< std::string > bin;

recycled_ptr< std::string > ps( bin, nullptr );

// Acquire a string and put it into a known state
ps->acquire();
ps->clear();
----

=== Postconditions

[,cpp]
----
&this->bin() == &bin && this->empty()
----

=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *bin*
| The recycle bin to use


|===

== See Also


xref:#boost-urls-grammar-recycled_ptr-acquire[acquire],            xref:#boost-urls-grammar-recycled[recycled],            xref:#boost-urls-grammar-recycled_ptr-release[release]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L271[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
recycled&lowbar;ptr();
----

== Description


Upon construction, this acquires        exclusive access to an object of type        `T` which is either recycled from a        global recycle bin, or newly allocated&period;        The object is in an unknown but        valid state&period;


=== Example

[,cpp]
----
recycled_ptr< std::string > ps;

// Put the string into a known state
ps->clear();
----

=== Postconditions

[,cpp]
----
&this->bin() != nullptr && ! this->empty()
----


== See Also


xref:#boost-urls-grammar-recycled[recycled]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L300[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
recycled&lowbar;ptr(std::nullptr&lowbar;t) noexcept;
----

== Description


After construction, this is empty        and refers to a global recycle bin&period;


=== Example

[,cpp]
----
recycled_ptr< std::string > ps( nullptr );

// Acquire a string and put it into a known state
ps->acquire();
ps->clear();
----

=== Postconditions

[,cpp]
----
&this->bin() != nullptr && this->empty()
----

=== Exception Safety

Throws nothing&period;



== See Also


xref:#boost-urls-grammar-recycled_ptr-acquire[acquire],            xref:#boost-urls-grammar-recycled[recycled],            xref:#boost-urls-grammar-recycled_ptr-release[release]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L321[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
recycled&lowbar;ptr(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>> const& other) noexcept;
----

== Description


If `other` references an object, the        newly constructed pointer acquires        shared ownership&period; Otherwise this is        empty&period; The new pointer references        the same recycle bin as `other`&period;


=== Postconditions

[,cpp]
----
&this->bin() == &other->bin() && this->get() == other.get()
----

=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The pointer to copy


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L341[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
recycled&lowbar;ptr(<<boost-urls-grammar-recycled_ptr,recycled&lowbar;ptr>>&& other) noexcept;
----

== Description


If `other` references an object,        ownership is transferred including        a reference to the recycle bin&period; After        the move, the moved&hyphen;from object is empty&period;


=== Postconditions

[,cpp]
----
&this->bin() == &other->bin() && ! this->empty() && other.empty()
----

=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The pointer to move from


|===


Release the referenced object

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L500[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
release() noexcept;
----

== Description


If this references an object, it is        released to the referenced recycle bin&period;        The pointer continues to reference        the same recycle bin&period;


=== Postconditions

[,cpp]
----
this->empty()
----

=== Exception Safety

Throws nothing&period;




Destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L177[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&#126;recycled&lowbar;ptr();
----

== Description


If this is not empty, shared ownership        of the pointee is released&period; If this was        the last reference, the object is        returned to the original recycle bin&period;


=== Effects

[,cpp]
----
this->release();
----



Common functionality for string views

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L36[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class string&lowbar;view&lowbar;base;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-const_iterator,`const&lowbar;iterator`>> 
| The const iterator type

| <<boost-urls-grammar-string_view_base-const_pointer,`const&lowbar;pointer`>> 
| The const pointer type

| <<boost-urls-grammar-string_view_base-const_reference,`const&lowbar;reference`>> 
| The const reference type

| <<boost-urls-grammar-string_view_base-const_reverse_iterator,`const&lowbar;reverse&lowbar;iterator`>> 
| The const reverse iterator type

| <<boost-urls-grammar-string_view_base-difference_type,`difference&lowbar;type`>> 
| The difference type

| <<boost-urls-grammar-string_view_base-iterator,`iterator`>> 
| The iterator type

| <<boost-urls-grammar-string_view_base-pointer,`pointer`>> 
| The pointer type

| <<boost-urls-grammar-string_view_base-reference,`reference`>> 
| The reference type

| <<boost-urls-grammar-string_view_base-reverse_iterator,`reverse&lowbar;iterator`>> 
| The reverse iterator type

| <<boost-urls-grammar-string_view_base-size_type,`size&lowbar;type`>> 
| The size type

| <<boost-urls-grammar-string_view_base-traits_type,`traits&lowbar;type`>> 
| The character traits

| <<boost-urls-grammar-string_view_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-at,`at`>> 
| Access a character

| <<boost-urls-grammar-string_view_base-back,`back`>> 
| Return the last character

| <<boost-urls-grammar-string_view_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-grammar-string_view_base-cbegin,`cbegin`>> 
| Return an iterator to the beginning

| <<boost-urls-grammar-string_view_base-cend,`cend`>> 
| Return an iterator to the end

| <<boost-urls-grammar-string_view_base-compare,`compare`>> 
| Return the result of comparing to another string


| <<boost-urls-grammar-string_view_base-contains,`contains`>> 
| Return true if matching characters are found


| <<boost-urls-grammar-string_view_base-copy,`copy`>> 
| Copy the characters to another buffer

| <<boost-urls-grammar-string_view_base-crbegin,`crbegin`>> 
| Return a reverse iterator to the end

| <<boost-urls-grammar-string_view_base-crend,`crend`>> 
| Return a reverse iterator to the beginning

| <<boost-urls-grammar-string_view_base-data,`data`>> 
| Return a pointer to the character buffer

| <<boost-urls-grammar-string_view_base-empty,`empty`>> 
| Return true if the string is empty

| <<boost-urls-grammar-string_view_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-grammar-string_view_base-ends_with,`ends&lowbar;with`>> 
| Return true if a matching suffix exists


| <<boost-urls-grammar-string_view_base-find,`find`>> 
| Return the position of matching characters


| <<boost-urls-grammar-string_view_base-find_first_not_of,`find&lowbar;first&lowbar;not&lowbar;of`>> 
| Return the position of the first non&hyphen;match


| <<boost-urls-grammar-string_view_base-find_first_of,`find&lowbar;first&lowbar;of`>> 
| Return the position of the first match


| <<boost-urls-grammar-string_view_base-find_last_not_of,`find&lowbar;last&lowbar;not&lowbar;of`>> 
| Return the position of the last non&hyphen;match


| <<boost-urls-grammar-string_view_base-find_last_of,`find&lowbar;last&lowbar;of`>> 
| Return the position of the last match


| <<boost-urls-grammar-string_view_base-front,`front`>> 
| Return the first character

| <<boost-urls-grammar-string_view_base-length,`length`>> 
| Return the size

| <<boost-urls-grammar-string_view_base-max_size,`max&lowbar;size`>> 
| Return the maximum allowed size

| <<boost-urls-grammar-string_view_base-2conversion-06,`operator std::string`>> 
| Conversion

| <<boost-urls-grammar-string_view_base-2conversion-0e,`operator std::string&lowbar;view`>> 
| Conversion

| <<boost-urls-grammar-string_view_base-operator_subs,`operator&lsqb;&rsqb;`>> 
| Access a character

| <<boost-urls-grammar-string_view_base-rbegin,`rbegin`>> 
| Return a reverse iterator to the end

| <<boost-urls-grammar-string_view_base-rend,`rend`>> 
| Return a reverse iterator to the beginning

| <<boost-urls-grammar-string_view_base-rfind,`rfind`>> 
| Return the position of matching characters


| <<boost-urls-grammar-string_view_base-size,`size`>> 
| Return the size

| <<boost-urls-grammar-string_view_base-starts_with,`starts&lowbar;with`>> 
| Return true if a matching prefix exists


| <<boost-urls-grammar-string_view_base-substr,`substr`>> 
| Return a view to part of the string

|===
== Static Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-npos,`npos`>> 
| A constant used to represent &quot;no position&quot;

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-08friend-017,`operator!&equals;`>> 
| Compare two string views for inequality

| <<boost-urls-grammar-string_view_base-08friend-010,`operator&lt;`>> 
| Compare two string views for less than

| <<boost-urls-grammar-string_view_base-08friend-0a,`operator&lt;&lt;`>> 
| Format a string to an output stream

| <<boost-urls-grammar-string_view_base-08friend-0c,`operator&lt;&equals;`>> 
| Compare two string views for less than or equal

| <<boost-urls-grammar-string_view_base-08friend-09,`operator&equals;&equals;`>> 
| Compare two string views for equality

| <<boost-urls-grammar-string_view_base-08friend-0d,`operator&gt;`>> 
| Compare two string views for greater than

| <<boost-urls-grammar-string_view_base-08friend-02,`operator&gt;&equals;`>> 
| Compare two string views for greater than or equal

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-grammar-string_view_base-2constructor,`string&lowbar;view&lowbar;base`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-grammar-string_view_base-swap,`swap`>> 
| Swap

|===
== Protected Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-s_,`s&lowbar;`>> 
| The referenced character buffer

|===


== Description


This base class is used to provide common    member functions for reference types that    behave like string views&period; This cannot be    instantiated directly&semi; Instead, derive    from the type and provide constructors    which offer any desired preconditions    and invariants&period;




Access a character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L283[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reference,const&lowbar;reference>>
at(<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos) const;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;at`




Return the last character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L303[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reference,const&lowbar;reference>>
back() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;back`




Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L157[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_iterator,const&lowbar;iterator>>
begin() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;begin`




Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L175[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_iterator,const&lowbar;iterator>>
cbegin() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;cbegin`




Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L184[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_iterator,const&lowbar;iterator>>
cend() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;cend`




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L347[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-grammar-string_view_base-compare-02,compare>>(core::string&lowbar;view str) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-compare-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-grammar-string_view_base-compare-0a,compare>>(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    core::string&lowbar;view str) const;
----

[.small]#<<boost-urls-grammar-string_view_base-compare-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-grammar-string_view_base-compare-0e,compare>>(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos2,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n2) const;
----

[.small]#<<boost-urls-grammar-string_view_base-compare-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-grammar-string_view_base-compare-07,compare>>(char const* s) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-compare-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-grammar-string_view_base-compare-0b,compare>>(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    char const* s) const;
----

[.small]#<<boost-urls-grammar-string_view_base-compare-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-grammar-string_view_base-compare-0c,compare>>(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n2) const;
----

[.small]#<<boost-urls-grammar-string_view_base-compare-0c,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;compare`




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L347[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(core::string&lowbar;view str) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;compare`




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L357[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    core::string&lowbar;view str) const;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;compare`




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L367[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos2,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n2) const;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;compare`




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L378[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(char const* s) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;compare`




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L388[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    char const* s) const;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;compare`




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L398[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos1,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n1,
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n2) const;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;compare`




Return true if matching characters are found

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L727[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-contains-08,contains>>(core::string&lowbar;view sv) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-contains-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-contains-04,contains>>(char c) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-contains-04,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-contains-03,contains>>(char const* s) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-contains-03,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;contains`




Return true if matching characters are found

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L727[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
contains(core::string&lowbar;view sv) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;contains`




Return true if matching characters are found

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L736[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
contains(char c) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;contains`




Return true if matching characters are found

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L745[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
contains(char const* s) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;contains`




Copy the characters to another buffer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L325[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
copy(
    char* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;copy`




Return a reverse iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L213[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reverse_iterator,const&lowbar;reverse&lowbar;iterator>>
crbegin() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;crbegin`




Return a reverse iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L223[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reverse_iterator,const&lowbar;reverse&lowbar;iterator>>
crend() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;crend`




Return a pointer to the character buffer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L313[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_pointer,const&lowbar;pointer>>
data() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;data`




Return true if the string is empty

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L262[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
empty() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;size`




Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L166[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_iterator,const&lowbar;iterator>>
end() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;end`




Return true if a matching suffix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L443[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-ends_with-0a,ends&lowbar;with>>(core::string&lowbar;view x) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-ends_with-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-ends_with-06,ends&lowbar;with>>(char x) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-ends_with-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-ends_with-0c,ends&lowbar;with>>(char const* x) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-ends_with-0c,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;ends&lowbar;with`




Return true if a matching suffix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L443[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
ends&lowbar;with(core::string&lowbar;view x) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;ends&lowbar;with`




Return true if a matching suffix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L453[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
ends&lowbar;with(char x) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;ends&lowbar;with`




Return true if a matching suffix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L463[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
ends&lowbar;with(char const* x) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;ends&lowbar;with`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L475[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find-0d,find>>(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find-00,find>>(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find-07,find>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find-0c,find>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find-0c,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L475[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L485[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L495[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L505[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find`




Return the position of the first non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L643[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_not_of-0e,find&lowbar;first&lowbar;not&lowbar;of>>(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_not_of-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_not_of-02,find&lowbar;first&lowbar;not&lowbar;of>>(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_not_of-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_not_of-0a,find&lowbar;first&lowbar;not&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_not_of-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_not_of-0c,find&lowbar;first&lowbar;not&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_not_of-0c,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;not&lowbar;of`




Return the position of the first non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L643[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;not&lowbar;of(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;not&lowbar;of`




Return the position of the first non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L653[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;not&lowbar;of(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;not&lowbar;of`




Return the position of the first non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L663[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;not&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;not&lowbar;of`




Return the position of the first non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L673[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;not&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;not&lowbar;of`




Return the position of the first match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L559[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_of-0ab,find&lowbar;first&lowbar;of>>(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_of-0ab,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_of-04,find&lowbar;first&lowbar;of>>(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_of-04,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_of-0af,find&lowbar;first&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_of-0af,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_first_of-08,find&lowbar;first&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_first_of-08,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;of`




Return the position of the first match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L559[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;of(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;of`




Return the position of the first match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L569[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;of(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;of`




Return the position of the first match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L579[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;of`




Return the position of the first match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L589[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;first&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;first&lowbar;of`




Return the position of the last non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L685[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_not_of-03,find&lowbar;last&lowbar;not&lowbar;of>>(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_not_of-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_not_of-0d,find&lowbar;last&lowbar;not&lowbar;of>>(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_not_of-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_not_of-01,find&lowbar;last&lowbar;not&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_not_of-01,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_not_of-06,find&lowbar;last&lowbar;not&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_not_of-06,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;not&lowbar;of`




Return the position of the last non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L685[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;not&lowbar;of(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;not&lowbar;of`




Return the position of the last non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L695[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;not&lowbar;of(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;not&lowbar;of`




Return the position of the last non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L705[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;not&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;not&lowbar;of`




Return the position of the last non&hyphen;match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L715[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;not&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;not&lowbar;of`




Return the position of the last match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L601[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_of-00,find&lowbar;last&lowbar;of>>(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_of-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_of-0c,find&lowbar;last&lowbar;of>>(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_of-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_of-02,find&lowbar;last&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_of-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-find_last_of-08,find&lowbar;last&lowbar;of>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-find_last_of-08,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;of`




Return the position of the last match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L601[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;of(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;of`




Return the position of the last match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L611[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;of(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;of`




Return the position of the last match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L621[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;of`




Return the position of the last match

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L631[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
find&lowbar;last&lowbar;of(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;find&lowbar;last&lowbar;of`




Return the first character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L293[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reference,const&lowbar;reference>>
front() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;front`




Return the size

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L244[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
length() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;length`




Return the maximum allowed size

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L253[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
max&lowbar;size() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;max&lowbar;size`




Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L142[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
operator std::string() const noexcept;
----

== Description


Conversion to std&colon;&colon;string is explicit        because assigning to string using an        implicit constructor does not preserve        capacity&period;




Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L119[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator std::string&lowbar;view() const noexcept;
----


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L82[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>>&
operator&equals;(<<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>> const&) = default;
----


Access a character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L273[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reference,const&lowbar;reference>>
operator&lsqb;&rsqb;(<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;operator&lsqb;&rsqb;`




Return a reverse iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L193[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reverse_iterator,const&lowbar;reverse&lowbar;iterator>>
rbegin() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;rbegin`




Return a reverse iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L203[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-const_reverse_iterator,const&lowbar;reverse&lowbar;iterator>>
rend() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;rend`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L517[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-rfind-0ed,rfind>>(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-rfind-0ed,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-rfind-0eb,rfind>>(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-rfind-0eb,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-rfind-0b,rfind>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-rfind-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
<<boost-urls-grammar-string_view_base-rfind-0d,rfind>>(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-rfind-0d,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;rfind`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L517[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
rfind(
    core::string&lowbar;view str,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;rfind`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L527[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
rfind(
    char c,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;rfind`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L537[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
rfind(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;rfind`




Return the position of matching characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L547[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
rfind(
    char const* s,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;rfind`




Return the size

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L235[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>>
size() const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;size`




Return true if a matching prefix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L411[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-starts_with-06,starts&lowbar;with>>(core::string&lowbar;view x) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-starts_with-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-starts_with-0b,starts&lowbar;with>>(char x) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-starts_with-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-grammar-string_view_base-starts_with-0d,starts&lowbar;with>>(char const* x) const noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-starts_with-0d,_» more..._>>#

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;starts&lowbar;with`




Return true if a matching prefix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L411[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
starts&lowbar;with(core::string&lowbar;view x) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;starts&lowbar;with`




Return true if a matching prefix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L421[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
starts&lowbar;with(char x) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;starts&lowbar;with`




Return true if a matching prefix exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L431[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
starts&lowbar;with(char const* x) const noexcept;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;starts&lowbar;with`




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L45[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-2constructor-09,string&lowbar;view&lowbar;base>>(core::string&lowbar;view s) noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-2constructor-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-2constructor-0a,string&lowbar;view&lowbar;base>>(
    char const* data,
    std::size&lowbar;t size) noexcept;
----

[.small]#<<boost-urls-grammar-string_view_base-2constructor-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-2constructor-02,string&lowbar;view&lowbar;base>>() = default;
----

[.small]#<<boost-urls-grammar-string_view_base-2constructor-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-string_view_base-2constructor-0e,string&lowbar;view&lowbar;base>>(<<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>> const&) = default;
----

[.small]#<<boost-urls-grammar-string_view_base-2constructor-0e,_» more..._>>#


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L45[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
string&lowbar;view&lowbar;base(core::string&lowbar;view s) noexcept;
----


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L54[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
string&lowbar;view&lowbar;base(
    char const* data,
    std::size&lowbar;t size) noexcept;
----


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L73[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
string&lowbar;view&lowbar;base() = default;
----


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L77[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
string&lowbar;view&lowbar;base(<<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>> const&) = default;
----


Return a view to part of the string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L335[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
core::string&lowbar;view
substr(
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> pos = 0,
    <<boost-urls-grammar-string_view_base-size_type,size&lowbar;type>> n = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const;
----

== Description


See `core&colon;&colon;string&lowbar;view&colon;&colon;substr`




Swap

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L65[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(<<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>>& s) noexcept;
----


The const iterator type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L99[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef char const* const&lowbar;iterator;
----


The const pointer type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L93[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef char const* const&lowbar;pointer;
----


The const reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L97[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef char const& const&lowbar;reference;
----


The const reverse iterator type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L103[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef std::reverse&lowbar;iterator&lt;<<boost-urls-grammar-string_view_base-const_iterator,const&lowbar;iterator>>&gt; const&lowbar;reverse&lowbar;iterator;
----


The difference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L110[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef std::ptrdiff&lowbar;t difference&lowbar;type;
----


The iterator type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L101[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef <<boost-urls-grammar-string_view_base-const_iterator,const&lowbar;iterator>> iterator;
----


The pointer type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L91[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef char* pointer;
----


The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L95[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef char& reference;
----


The reverse iterator type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L106[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef <<boost-urls-grammar-string_view_base-const_reverse_iterator,const&lowbar;reverse&lowbar;iterator>> reverse&lowbar;iterator;
----


The size type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L108[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef std::size&lowbar;t size&lowbar;type;
----


The character traits

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L87[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef std::char&lowbar;traits&lt;char&gt; traits&lowbar;type;
----


The value type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L89[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef char value&lowbar;type;
----


A constant used to represent &quot;no position&quot;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L113[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr static
std::size&lowbar;t npos = core&colon;&colon;string&lowbar;view&colon;&colon;npos;
----


The referenced character buffer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L41[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view s&lowbar;;
----


Compare two string views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L788[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
friend
constexpr
bool
operator!&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Compare two string views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L803[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
friend
constexpr
bool
operator&lt;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Format a string to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L863[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>> const& s);
----


Compare two string views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L818[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
friend
constexpr
bool
operator&lt;&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Compare two string views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L773[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
friend
constexpr
bool
operator&equals;&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Compare two string views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L833[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
friend
constexpr
bool
operator&gt;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Compare two string views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L848[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
friend
constexpr
bool
operator&gt;&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Match an unsigned decimal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/unsigned_rule.hpp#L82[boost&sol;url&sol;grammar&sol;unsigned&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Unsigned&gt;
struct unsigned&lowbar;rule;
----

== Types

[cols=1]
|===
| Name 

| <<boost-urls-grammar-unsigned_rule-value_type,`value&lowbar;type`>> 
|===
== Member Functions

[cols=1]
|===
| Name 

| <<boost-urls-grammar-unsigned_rule-parse,`parse`>> 
|===



== Description


Extra leading zeroes are disallowed&period;


=== Value Type

[,cpp]
----
using value_type = Unsigned;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-unsigned_rule-parse[parse]&period;

[,cpp]
----
system::result< unsigned short > rv = parse( "32767", unsigned_rule< unsigned short >{} );
----

=== BNF

[,cpp]
----
unsigned      = "0" / ( ["1"..."9"] *DIGIT )
----


== Template Parameters


|===
| Name | Description

| *Unsigned*
| The unsigned integer type used    to store the result&period;


|===

== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;





== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/unsigned_rule.hpp#L93[boost&sol;url&sol;grammar&sol;unsigned&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-grammar-unsigned_rule-value_type,value&lowbar;type>>&gt;
parse(
    char const*& it,
    char const* end) const noexcept;
----


== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/unsigned_rule.hpp#L91[boost&sol;url&sol;grammar&sol;unsigned&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = Unsigned;
----


Return the case&hyphen;insensitive comparison of s0 and s1

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L120[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
ci&lowbar;compare(
    core::string&lowbar;view s0,
    core::string&lowbar;view s1) noexcept;
----

== Description


This returns the lexicographical comparison    of two strings, ignoring case&period;    The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
assert( ci_compare( "boost", "Boost" ) == 0 );
----

=== Exception Safety

Throws nothing&period;



== Return Value


0 if the strings are equal, &hyphen;1 if    `s0` is less than `s1`, or 1 if `s0` is    greater than s1&period;



== Parameters


|===
| Name | Description

| *s0*
| The first string


| *s1*
| The second string


|===

== See Also


xref:#boost-urls-grammar-ci_is_equal-0a[ci&lowbar;is&lowbar;equal],        xref:#boost-urls-grammar-ci_is_less[ci&lowbar;is&lowbar;less]&period;





Return the case&hyphen;insensitive digest of a string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L140[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
ci&lowbar;digest(core::string&lowbar;view s) noexcept;
----

== Description


The hash function is non&hyphen;cryptographic and    not hardened against algorithmic complexity    attacks&period;    Returned digests are suitable for usage in    unordered containers&period;    The function is defined only for strings    containing low&hyphen;ASCII characters&period;



== Return Value


The digest



== Parameters


|===
| Name | Description

| *s*
| The string


|===


Return true if s0 equals s1 using case&hyphen;insensitive comparison

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L160[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class String0,
    class String1&gt;
bool
<<boost-urls-grammar-ci_is_equal-0a,ci&lowbar;is&lowbar;equal>>(
    String0 const& s0,
    String1 const& s1)
requires ! std&colon;&colon;is&lowbar;convertible&lt;
                String0, core&colon;&colon;string&lowbar;view&gt;&colon;&colon;value &verbar;&verbar;
            ! std&colon;&colon;is&lowbar;convertible&lt;
                String1, core&colon;&colon;string&lowbar;view&gt;&colon;&colon;value;
----

[.small]#<<boost-urls-grammar-ci_is_equal-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-grammar-ci_is_equal-0b,ci&lowbar;is&lowbar;equal>>(
    core::string&lowbar;view s0,
    core::string&lowbar;view s1) noexcept;
----

[.small]#<<boost-urls-grammar-ci_is_equal-0b,_» more..._>>#

== Description


The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
assert( ci_is_equal( "Boost", "boost" ) );
----


== See Also


xref:#boost-urls-grammar-ci_compare[ci&lowbar;compare],        xref:#boost-urls-grammar-ci_is_less[ci&lowbar;is&lowbar;less]&period;





Return true if s0 equals s1 using case&hyphen;insensitive comparison

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L160[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class String0,
    class String1&gt;
bool
ci&lowbar;is&lowbar;equal(
    String0 const& s0,
    String1 const& s1)
requires ! std&colon;&colon;is&lowbar;convertible&lt;
                String0, core&colon;&colon;string&lowbar;view&gt;&colon;&colon;value &verbar;&verbar;
            ! std&colon;&colon;is&lowbar;convertible&lt;
                String1, core&colon;&colon;string&lowbar;view&gt;&colon;&colon;value;
----

== Description


The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
assert( ci_is_equal( "Boost", "boost" ) );
----


== See Also


xref:#boost-urls-grammar-ci_compare[ci&lowbar;compare],        xref:#boost-urls-grammar-ci_is_less[ci&lowbar;is&lowbar;less]&period;





Return true if s0 equals s1 using case&hyphen;insensitive comparison

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L196[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
ci&lowbar;is&lowbar;equal(
    core::string&lowbar;view s0,
    core::string&lowbar;view s1) noexcept;
----

== Description


The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
assert( ci_is_equal( "Boost", "boost" ) );
----


== See Also


xref:#boost-urls-grammar-ci_compare[ci&lowbar;compare],        xref:#boost-urls-grammar-ci_is_less[ci&lowbar;is&lowbar;less]&period;





Return true if s0 is less than s1 using case&hyphen;insensitive comparison

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L227[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
ci&lowbar;is&lowbar;less(
    core::string&lowbar;view s0,
    core::string&lowbar;view s1) noexcept;
----

== Description


The comparison algorithm implements a    case&hyphen;insensitive total order on the set    of all strings&semi; however, it is not a    lexicographical comparison&period;    The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
assert( ! ci_is_less( "Boost", "boost" ) );
----


== See Also


xref:#boost-urls-grammar-ci_compare[ci&lowbar;compare],        xref:#boost-urls-grammar-ci_is_equal-0a[ci&lowbar;is&lowbar;equal]&period;





Match a character literal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/delim_rule.hpp#L78[boost&sol;url&sol;grammar&sol;delim&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-ch_delim_rule,ch&lowbar;delim&lowbar;rule>>
<<boost-urls-grammar-delim_rule-02,delim&lowbar;rule>>(char ch) noexcept;
----

[.small]#<<boost-urls-grammar-delim_rule-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-cs_delim_rule,cs&lowbar;delim&lowbar;rule>>&lt;CS&gt;
<<boost-urls-grammar-delim_rule-01,delim&lowbar;rule>>(CS const& cs) noexcept
requires ! std&colon;&colon;is&lowbar;convertible&lt;
        CS, char&gt;&colon;&colon;value;
----

[.small]#<<boost-urls-grammar-delim_rule-01,_» more..._>>#

== Description


This matches the specified character&period;    The value is a reference to the character    in the underlying buffer, expressed as a    `core&colon;&colon;string&lowbar;view`&period; The function xref:#boost-urls-grammar-squelch[squelch]    may be used to turn this into `void` instead&period;    If there is no more input, the error code    xref:#boost-urls-grammar-error[error&colon;&colon;need&lowbar;more] is returned&period;


=== Value Type

[,cpp]
----
using value_type = core::string_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( ".", delim_rule('.') );
----

=== BNF

[,cpp]
----
char        = %00-FF
----


== Parameters


|===
| Name | Description

| *ch*
| The character to match


| *cs*
| The character set to use&period;


|===

== See Also


xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-squelch[squelch]&period;





Match a single character from a character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/delim_rule.hpp#L155[boost&sol;url&sol;grammar&sol;delim&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-cs_delim_rule,cs&lowbar;delim&lowbar;rule>>&lt;CS&gt;
delim&lowbar;rule(CS const& cs) noexcept
requires ! std&colon;&colon;is&lowbar;convertible&lt;
        CS, char&gt;&colon;&colon;value;
----

== Description


This matches exactly one character which    belongs to the specified character set&period;    The value is a reference to the character    in the underlying buffer, expressed as a    `core&colon;&colon;string&lowbar;view`&period; The function xref:#boost-urls-grammar-squelch[squelch]    may be used to turn this into `void` instead&period;    If there is no more input, the error code    xref:#boost-urls-grammar-error[error&colon;&colon;need&lowbar;more] is returned&period;


=== Value Type

[,cpp]
----
using value_type = core::string_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "X", delim_rule( alpha_chars ) );
----


== Parameters


|===
| Name | Description

| *cs*
| The character set to use&period;


|===

== See Also


xref:#boost-urls-grammar-alpha_chars[alpha&lowbar;chars],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-squelch[squelch]&period;





Match a character literal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/delim_rule.hpp#L78[boost&sol;url&sol;grammar&sol;delim&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-ch_delim_rule,ch&lowbar;delim&lowbar;rule>>
delim&lowbar;rule(char ch) noexcept;
----

== Description


This matches the specified character&period;    The value is a reference to the character    in the underlying buffer, expressed as a    `core&colon;&colon;string&lowbar;view`&period; The function xref:#boost-urls-grammar-squelch[squelch]    may be used to turn this into `void` instead&period;    If there is no more input, the error code    xref:#boost-urls-grammar-error[error&colon;&colon;need&lowbar;more] is returned&period;


=== Value Type

[,cpp]
----
using value_type = core::string_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( ".", delim_rule('.') );
----

=== BNF

[,cpp]
----
char        = %00-FF
----


== Parameters


|===
| Name | Description

| *ch*
| The character to match


|===

== See Also


xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-squelch[squelch]&period;





Find the first character in the string that is in the set&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L144[boost&sol;url&sol;grammar&sol;charset&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
char const*
find&lowbar;if(
    char const const* first,
    char const const* last,
    CS const& cs) noexcept;
----

== Description



=== Exception Safety

Throws nothing&period;



== Return Value


A pointer to the found character,    otherwise the value `last`&period;



== Parameters


|===
| Name | Description

| *first*
| A pointer to the first character    in the string to search&period;


| *last*
| A pointer to one past the last    character in the string to search&period;


| *cs*
| The character set to use&period;


|===

== See Also


xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;





Find the first character in the string that is not in CharSet

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L182[boost&sol;url&sol;grammar&sol;charset&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
char const*
find&lowbar;if&lowbar;not(
    char const const* first,
    char const const* last,
    CS const& cs) noexcept;
----

== Description



=== Exception Safety

Throws nothing&period;



== Return Value


A pointer to the found character,    otherwise the value `last`&period;



== Parameters


|===
| Name | Description

| *first*
| A pointer to the first character    in the string to search&period;


| *last*
| A pointer to one past the last    character in the string to search&period;


| *cs*
| The character set to use&period;


|===

== See Also


xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;





Return the decimal value of a hex character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/hexdig_chars.hpp#L163[boost&sol;url&sol;grammar&sol;hexdig&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
signed char
hexdig&lowbar;value(char ch) noexcept;
----

== Description


This function returns the decimal    value of a hexadecimal character,    or &hyphen;1 if the argument is not a    valid hexadecimal digit&period;


=== BNF

[,cpp]
----
HEXDIG      = DIGIT
            / "A" / "B" / "C" / "D" / "E" / "F"
            / "a" / "b" / "c" / "d" / "e" / "f"
----


== Return Value


The decimal value or &hyphen;1



== Parameters


|===
| Name | Description

| *ch*
| The character to check


|===


Match another rule, if the result is not empty

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/not_empty_rule.hpp#L71[boost&sol;url&sol;grammar&sol;not&lowbar;empty&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-not_empty_rule_t,not&lowbar;empty&lowbar;rule&lowbar;t>>&lt;R&gt;
not&lowbar;empty&lowbar;rule(R const& r);
----

== Description


This adapts another rule such that    when an empty string is successfully    parsed, the result is an error&period;


=== Value Type

[,cpp]
----
using value_type = typename Rule::value_type;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
system::result< decode_view > rv = parse( "Program%20Files",
    not_empty_rule( pct_encoded_rule( unreserved_chars ) ) );
----


== Parameters


|===
| Name | Description

| *r*
| The rule to match


|===

== See Also


xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-pct_encoded_rule[pct&lowbar;encoded&lowbar;rule],        xref:#boost-urls-unreserved_chars[unreserved&lowbar;chars]&period;





Compare two string views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L788[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
constexpr
bool
operator!&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Return the union of two character sets&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L299[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-lut_chars,lut&lowbar;chars>>
operator&plus;(
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs0,
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs1) noexcept;
----

== Description


This function returns a new character        set which contains all of the characters        in `cs0` as well as all of the characters        in `cs`&period;


=== Example

This creates a character set which        includes all letters and numbers 

[,cpp]
----
constexpr lut_chars alpha_chars(
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    "abcdefghijklmnopqrstuvwxyz");

constexpr lut_chars alnum_chars = alpha_chars + "0123456789";
----

=== Complexity

Constant&period;



== Return Value


The new character set&period;



== Parameters


|===
| Name | Description

| *cs0*
| A character to join


| *cs1*
| A character to join


|===


Return a new character set by subtracting

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L336[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-grammar-lut_chars,lut&lowbar;chars>>
operator&hyphen;(
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs0,
    <<boost-urls-grammar-lut_chars,lut&lowbar;chars>> const& cs1) noexcept;
----

== Description


This function returns a new character        set which is formed from all of the        characters in `cs0` which are not in `cs`&period;


=== Example

This statement declares a character set        containing all the lowercase letters        which are not vowels&colon;

[,cpp]
----
constexpr lut_chars consonants = lut_chars("abcdefghijklmnopqrstuvwxyz") - "aeiou";
----

=== Complexity

Constant&period;



== Return Value


The new character set&period;



== Parameters


|===
| Name | Description

| *cs0*
| A character set to join&period;


| *cs1*
| A character set to join&period;


|===


Compare two string views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L803[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
constexpr
bool
operator&lt;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Format a string to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L863[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>> const& s);
----


Compare two string views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L818[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
constexpr
bool
operator&lt;&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Compare two string views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L773[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
constexpr
bool
operator&equals;&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Compare two string views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L833[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
constexpr
bool
operator&gt;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Compare two string views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L848[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class S0,
    class S1&gt;
constexpr
bool
operator&gt;&equals;(
    S0 const& s0,
    S1 const& s1) noexcept
requires is&lowbar;match&lt;S0, S1&gt;&colon;&colon;value;
----

== Description


This function is only enabled if both arguments are convertible to `core&colon;&colon;string&lowbar;view` and at least one of the arguments is derived from `string&lowbar;view&lowbar;base`&period;




Match a rule, or the empty string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/optional_rule.hpp#L83[boost&sol;url&sol;grammar&sol;optional&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-optional_rule_t,optional&lowbar;rule&lowbar;t>>&lt;R&gt;
optional&lowbar;rule(R const& r);
----

== Description


Optional BNF elements are denoted with    square brackets&period; If the specified rule    returns any error it is treated as if    the rule did not match&period;


=== Value Type

[,cpp]
----
using value_type = optional< typename Rule::value_type >;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< optional< core::string_view > > rv = parse( "", optional_rule( token_rule( alpha_chars ) ) );
----

=== BNF

[,cpp]
----
optional     = [ rule ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.8[3&period;8&period;  Optional Sequence (rfc5234)]



== Parameters


|===
| Name | Description

| *r*
| The rule to match


|===

== See Also


xref:#boost-urls-grammar-alpha_chars[alpha&lowbar;chars],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-optional[optional],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





Parse a character buffer using a rule

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/parse.hpp#L37[boost&sol;url&sol;grammar&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
system::result&lt;R::value&lowbar;type&gt;
<<boost-urls-grammar-parse-06,parse>>(
    char const*& it,
    char const* end,
    R const& r);
----

[.small]#<<boost-urls-grammar-parse-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
system::result&lt;R::value&lowbar;type&gt;
<<boost-urls-grammar-parse-02,parse>>(
    core::string&lowbar;view s,
    R const& r);
----

[.small]#<<boost-urls-grammar-parse-02,_» more..._>>#

== Return Value


The parsed value upon success,    otherwise an error&period;



== Parameters


|===
| Name | Description

| *it*
| A pointer to the start&period; The    caller&apos;s variable is changed to    reflect the amount of input consumed&period;


| *end*
| A pointer to the end&period;


| *r*
| The rule to use


| *s*
| The input string


|===


Parse a character buffer using a rule

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/parse.hpp#L37[boost&sol;url&sol;grammar&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
system::result&lt;R::value&lowbar;type&gt;
parse(
    char const*& it,
    char const* end,
    R const& r);
----

== Return Value


The parsed value upon success,    otherwise an error&period;



== Parameters


|===
| Name | Description

| *it*
| A pointer to the start&period; The    caller&apos;s variable is changed to    reflect the amount of input consumed&period;


| *end*
| A pointer to the end&period;


| *r*
| The rule to use


|===


Parse a character buffer using a rule

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/parse.hpp#L58[boost&sol;url&sol;grammar&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
system::result&lt;R::value&lowbar;type&gt;
parse(
    core::string&lowbar;view s,
    R const& r);
----

== Description


This function parses a complete string into    the specified sequence of rules&period; If the    string is not completely consumed, an    error is returned instead&period;



== Return Value


The parsed value upon success,    otherwise an error&period;



== Parameters


|===
| Name | Description

| *s*
| The input string


| *r*
| The rule to use


|===


Match a repeating number of elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L381[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-range_rule_t,range&lowbar;rule&lowbar;t>>&lt;R&gt;
<<boost-urls-grammar-range_rule-00,range&lowbar;rule>>(
    R const& next,
    std::size&lowbar;t N = 0,
    std::size&lowbar;t M = std&colon;&colon;size&lowbar;t(&hyphen;1)) noexcept;
----

[.small]#<<boost-urls-grammar-range_rule-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    <<boost-urls-grammar-Rule,Rule>> R1,
    <<boost-urls-grammar-Rule,Rule>> R2&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-range_rule_t,range&lowbar;rule&lowbar;t>>&lt;R1, R2&gt;
<<boost-urls-grammar-range_rule-06,range&lowbar;rule>>(
    R1 const& first,
    R2 const& next,
    std::size&lowbar;t N = 0,
    std::size&lowbar;t M = std&colon;&colon;size&lowbar;t(&hyphen;1)) noexcept
requires ! std&colon;&colon;is&lowbar;integral&lt;R2&gt;&colon;&colon;value;
----

[.small]#<<boost-urls-grammar-range_rule-06,_» more..._>>#

== Description


Elements are matched using the passed rule&period;        Normally when the rule returns an error,    the range ends and the input is rewound to    one past the last character that matched    successfully&period; However, if the rule returns    the special value xref:#boost-urls-grammar-error[error&colon;&colon;end&lowbar;of&lowbar;range], the    input is not rewound&period; This allows for rules    which consume input without producing    elements in the range&period; For example, to    relax the grammar for a comma&hyphen;delimited    list by allowing extra commas in between    elements&period;


=== Value Type

[,cpp]
----
using value_type = range< typename Rule::value_type >;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
// range    = 1*( ";" token )

system::result< range<core::string_view> > rv = parse( ";alpha;xray;charlie",
    range_rule(
        tuple_rule(
            squelch( delim_rule( ';' ) ),
            token_rule( alpha_chars ) ),
        1 ) );
----

=== BNF

[,cpp]
----
range        = <N>*<M>next
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[3&period;6&period;  Variable Repetition (rfc5234)]



== Parameters


|===
| Name | Description

| *next*
| The rule to use for matching    each element&period; The range extends until this    rule returns an error&period;


| *N*
| The minimum number of elements for    the range to be valid&period; If omitted, this    defaults to zero&period;


| *M*
| The maximum number of elements for    the range to be valid&period; If omitted, this    defaults to unlimited&period;


| *first*
| The rule to use for matching    the first element&period; If this rule returns    an error, the range is empty&period;


|===

== See Also


xref:#boost-urls-grammar-alpha_chars[alpha&lowbar;chars],        xref:#boost-urls-grammar-delim_rule-01[delim&lowbar;rule],        xref:#boost-urls-grammar-error[error&colon;&colon;end&lowbar;of&lowbar;range],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-range[range],        xref:#boost-urls-grammar-tuple_rule[tuple&lowbar;rule],        xref:#boost-urls-grammar-squelch[squelch]&period;





Match a repeating number of elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L381[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-range_rule_t,range&lowbar;rule&lowbar;t>>&lt;R&gt;
range&lowbar;rule(
    R const& next,
    std::size&lowbar;t N = 0,
    std::size&lowbar;t M = std&colon;&colon;size&lowbar;t(&hyphen;1)) noexcept;
----

== Description


Elements are matched using the passed rule&period;        Normally when the rule returns an error,    the range ends and the input is rewound to    one past the last character that matched    successfully&period; However, if the rule returns    the special value xref:#boost-urls-grammar-error[error&colon;&colon;end&lowbar;of&lowbar;range], the    input is not rewound&period; This allows for rules    which consume input without producing    elements in the range&period; For example, to    relax the grammar for a comma&hyphen;delimited    list by allowing extra commas in between    elements&period;


=== Value Type

[,cpp]
----
using value_type = range< typename Rule::value_type >;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
// range    = 1*( ";" token )

system::result< range<core::string_view> > rv = parse( ";alpha;xray;charlie",
    range_rule(
        tuple_rule(
            squelch( delim_rule( ';' ) ),
            token_rule( alpha_chars ) ),
        1 ) );
----

=== BNF

[,cpp]
----
range        = <N>*<M>next
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[3&period;6&period;  Variable Repetition (rfc5234)]



== Parameters


|===
| Name | Description

| *next*
| The rule to use for matching    each element&period; The range extends until this    rule returns an error&period;


| *N*
| The minimum number of elements for    the range to be valid&period; If omitted, this    defaults to zero&period;


| *M*
| The maximum number of elements for    the range to be valid&period; If omitted, this    defaults to unlimited&period;


|===

== See Also


xref:#boost-urls-grammar-alpha_chars[alpha&lowbar;chars],        xref:#boost-urls-grammar-delim_rule-01[delim&lowbar;rule],        xref:#boost-urls-grammar-error[error&colon;&colon;end&lowbar;of&lowbar;range],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-range[range],        xref:#boost-urls-grammar-tuple_rule[tuple&lowbar;rule],        xref:#boost-urls-grammar-squelch[squelch]&period;





Match a repeating number of elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L509[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    <<boost-urls-grammar-Rule,Rule>> R1,
    <<boost-urls-grammar-Rule,Rule>> R2&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-range_rule_t,range&lowbar;rule&lowbar;t>>&lt;R1, R2&gt;
range&lowbar;rule(
    R1 const& first,
    R2 const& next,
    std::size&lowbar;t N = 0,
    std::size&lowbar;t M = std&colon;&colon;size&lowbar;t(&hyphen;1)) noexcept
requires ! std&colon;&colon;is&lowbar;integral&lt;R2&gt;&colon;&colon;value;
----

== Description


Two rules are used for match&period; The rule    `first` is used for matching the first    element, while the `next` rule is used    to match every subsequent element&period;        Normally when the rule returns an error,    the range ends and the input is rewound to    one past the last character that matched    successfully&period; However, if the rule returns    the special value xref:#boost-urls-grammar-error[error&colon;&colon;end&lowbar;of&lowbar;range], the    input is not rewound&period; This allows for rules    which consume input without producing    elements in the range&period; For example, to    relax the grammar for a comma&hyphen;delimited    list by allowing extra commas in between    elements&period;


=== Value Type

[,cpp]
----
using value_type = range< typename Rule::value_type >;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
// range    = [ token ] *( "," token )

system::result< range< core::string_view > > rv = parse( "whiskey,tango,foxtrot",
    range_rule(
        token_rule( alpha_chars ),          // first
        tuple_rule(                      // next
            squelch( delim_rule(',') ),
            token_rule( alpha_chars ) ) ) );
----

=== BNF

[,cpp]
----
range       = <1>*<1>first
            / first <N-1>*<M-1>next
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[3&period;6&period;  Variable Repetition (rfc5234)]



== Parameters


|===
| Name | Description

| *first*
| The rule to use for matching    the first element&period; If this rule returns    an error, the range is empty&period;


| *next*
| The rule to use for matching    each subsequent element&period; The range extends    until this rule returns an error&period;


| *N*
| The minimum number of elements for    the range to be valid&period; If omitted, this    defaults to zero&period;


| *M*
| The maximum number of elements for    the range to be valid&period; If omitted, this    defaults to unlimited&period;


|===

== See Also


xref:#boost-urls-grammar-alpha_chars[alpha&lowbar;chars],        xref:#boost-urls-grammar-delim_rule-01[delim&lowbar;rule],        xref:#boost-urls-grammar-error[error&colon;&colon;end&lowbar;of&lowbar;range],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-range[range],        xref:#boost-urls-grammar-tuple_rule[tuple&lowbar;rule],        xref:#boost-urls-grammar-squelch[squelch]&period;





Return a reference to a character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L251[boost&sol;url&sol;grammar&sol;charset&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-charset_ref,charset&lowbar;ref>>&lt;CS&gt;
<<boost-urls-grammar-ref-02,ref>>(CS const& cs) noexcept
requires is&lowbar;charset&lt;CS&gt;&colon;&colon;value &amp;&amp;
    ! std&colon;&colon;is&lowbar;same&lt;CS,
        implementation&lowbar;defined&colon;&colon;charset&lowbar;ref&lt;CS&gt; &gt;&colon;&colon;value;
----

[.small]#<<boost-urls-grammar-ref-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-rule_ref,rule&lowbar;ref>>&lt;R&gt;
<<boost-urls-grammar-ref-0e,ref>>(R const& r) noexcept
requires is&lowbar;rule&lt;R&gt;&colon;&colon;value &amp;&amp;
    ! std&colon;&colon;is&lowbar;same&lt;R,
        implementation&lowbar;defined&colon;&colon;rule&lowbar;ref&lt;R&gt; &gt;&colon;&colon;value;
----

[.small]#<<boost-urls-grammar-ref-0e,_» more..._>>#

== Description


This function returns a character set which    references the specified object&period; This is    used to reduce the number of bytes of    storage (`sizeof`) required by a combinator    when it stores a copy of the object&period;        Ownership of the object is not transferred&semi;    the caller is responsible for ensuring the    lifetime of the object is extended until it    is no longer referenced&period; For best results,    `ref` should only be used with compile&hyphen;time    constants&period;



== Parameters


|===
| Name | Description

| *r*
| The rule to use


|===


Return a reference to a character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L251[boost&sol;url&sol;grammar&sol;charset&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-charset_ref,charset&lowbar;ref>>&lt;CS&gt;
ref(CS const& cs) noexcept
requires is&lowbar;charset&lt;CS&gt;&colon;&colon;value &amp;&amp;
    ! std&colon;&colon;is&lowbar;same&lt;CS,
        implementation&lowbar;defined&colon;&colon;charset&lowbar;ref&lt;CS&gt; &gt;&colon;&colon;value;
----

== Description


This function returns a character set which    references the specified object&period; This is    used to reduce the number of bytes of    storage (`sizeof`) required by a combinator    when it stores a copy of the object&period;        Ownership of the object is not transferred&semi;    the caller is responsible for ensuring the    lifetime of the object is extended until it    is no longer referenced&period; For best results,    `ref` should only be used with compile&hyphen;time    constants&period;




Return a reference to a rule

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/parse.hpp#L102[boost&sol;url&sol;grammar&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-rule_ref,rule&lowbar;ref>>&lt;R&gt;
ref(R const& r) noexcept
requires is&lowbar;rule&lt;R&gt;&colon;&colon;value &amp;&amp;
    ! std&colon;&colon;is&lowbar;same&lt;R,
        implementation&lowbar;defined&colon;&colon;rule&lowbar;ref&lt;R&gt; &gt;&colon;&colon;value;
----

== Description


This function returns a rule which    references the specified object&period; This is    used to reduce the number of bytes of    storage (`sizeof`) required by a combinator    when it stores a copy of the object&period;        Ownership of the object is not transferred&semi;    the caller is responsible for ensuring the    lifetime of the object is extended until it    is no longer referenced&period; For best results,    `ref` should only be used with compile&hyphen;time    constants&period;



== Parameters


|===
| Name | Description

| *r*
| The rule to use


|===


Squelch the value of a rule

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/tuple_rule.hpp#L218[boost&sol;url&sol;grammar&sol;tuple&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-Rule,Rule>> R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-squelch_rule_t,squelch&lowbar;rule&lowbar;t>>&lt;R&gt;
squelch(R const& r) noexcept;
----

== Description


This function returns a new rule which    matches the specified rule, and converts    its value type to `void`&period; This is useful    for matching delimiters in a grammar,    where the value for the delimiter is not    needed&period;


=== Value Type

[,cpp]
----
using value_type = void;
----

=== Example 1

With `squelch`&colon;

[,cpp]
----
system::result< std::tuple< decode_view, core::string_view > > rv = parse(
    "www.example.com:443",
    tuple_rule(
        pct_encoded_rule(unreserved_chars + '-' + '.'),
        squelch( delim_rule( ':' ) ),
        token_rule( digit_chars ) ) );
----

=== Example 2

Without `squelch`&colon;

[,cpp]
----
system::result< std::tuple< decode_view, core::string_view, core::string_view > > rv = parse(
    "www.example.com:443",
    tuple_rule(
        pct_encoded_rule(unreserved_chars + '-' + '.'),
        delim_rule( ':' ),
        token_rule( digit_chars ) ) );
----


== Parameters


|===
| Name | Description

| *r*
| The rule to squelch


|===

== See Also


xref:#boost-urls-grammar-delim_rule-01[delim&lowbar;rule],        xref:#boost-urls-grammar-digit_chars[digit&lowbar;chars],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-tuple_rule[tuple&lowbar;rule],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule],        xref:#boost-urls-decode_view[decode&lowbar;view],        xref:#boost-urls-pct_encoded_rule[pct&lowbar;encoded&lowbar;rule],        xref:#boost-urls-unreserved_chars[unreserved&lowbar;chars]&period;





Return c converted to lowercase

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L53[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
char
to&lowbar;lower(char c) noexcept;
----

== Description


This function returns the character,    converting it to lowercase if it is    uppercase&period;    The function is defined only for    low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
assert( to_lower( 'A' ) == 'a' );
----

=== Exception Safety

Throws nothing&period;



== Return Value


The converted character



== Parameters


|===
| Name | Description

| *c*
| The character to convert


|===

== See Also


xref:#boost-urls-grammar-to_upper[to&lowbar;upper]&period;





Return c converted to uppercase

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L83[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
char
to&lowbar;upper(char c) noexcept;
----

== Description


This function returns the character,    converting it to uppercase if it is    lowercase&period;    The function is defined only for    low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
assert( to_upper( 'a' ) == 'A' );
----

=== Exception Safety

Throws nothing&period;



== Return Value


The converted character



== Parameters


|===
| Name | Description

| *c*
| The character to convert


|===

== See Also


xref:#boost-urls-grammar-to_lower[to&lowbar;lower]&period;





Match a non&hyphen;empty string of characters from a set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/token_rule.hpp#L78[boost&sol;url&sol;grammar&sol;token&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-token_rule_t,token&lowbar;rule&lowbar;t>>&lt;CS&gt;
token&lowbar;rule(CS const& cs) noexcept;
----

== Description


If there is no more input, the error code    xref:#boost-urls-grammar-error[error&colon;&colon;need&lowbar;more] is returned&period;


=== Value Type

[,cpp]
----
using value_type = core::string_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "abcdef", token_rule( alpha_chars ) );
----

=== BNF

[,cpp]
----
token     = 1*( ch )
----


== Parameters


|===
| Name | Description

| *cs*
| The character set to use


|===

== See Also


xref:#boost-urls-grammar-alpha_chars[alpha&lowbar;chars],        xref:#boost-urls-grammar-parse-02[parse]&period;





Match a series of rules in order

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/tuple_rule.hpp#L122[boost&sol;url&sol;grammar&sol;tuple&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    <<boost-urls-grammar-Rule,Rule>> R0,
    <<boost-urls-grammar-Rule,Rule>>... Rn&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-tuple_rule_t,tuple&lowbar;rule&lowbar;t>>&lt;R0, Rn...&gt;
tuple&lowbar;rule(
    R0 const& r0,
    Rn const&... rn) noexcept;
----

== Description


This matches a series of rules in the    order specified&period; Upon success the input    is adjusted to point to the first    unconsumed character&period; There is no    implicit specification of linear white    space between each rule&period;


=== Value Type

[,cpp]
----
using value_type = __see_below__;
----
The sequence rule usually returns a    `std&colon;&colon;tuple` containing the the `value&lowbar;type`    of each corresponding rule in the sequence,    except that `void` values are removed&period;    However, if there is exactly one non&hyphen;void    value type `T`, then the sequence rule    returns `system&colon;&colon;result&lt;T&gt;` instead of    `system&colon;&colon;result&lt;tuple&lt;&period;&period;&period;&gt;&gt;`&period;


=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
system::result< std::tuple< unsigned char, unsigned char, unsigned char, unsigned char > > rv =
    parse( "192.168.0.1",
        tuple_rule(
            dec_octet_rule,
            squelch( delim_rule('.') ),
            dec_octet_rule,
            squelch( delim_rule('.') ),
            dec_octet_rule,
            squelch( delim_rule('.') ),
            dec_octet_rule ) );
----

=== BNF

[,cpp]
----
sequence     = rule1 rule2 rule3...
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.1[3&period;1&period;  Concatenation (rfc5234)]



== Parameters


|===
| Name | Description

| *rn*
| A list of one or more rules to match


|===

== See Also


xref:#boost-urls-grammar-dec_octet_rule[dec&lowbar;octet&lowbar;rule],        xref:#boost-urls-grammar-delim_rule-01[delim&lowbar;rule],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-squelch[squelch]&period;





Match one of a set of rules

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/variant_rule.hpp#L101[boost&sol;url&sol;grammar&sol;variant&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    <<boost-urls-grammar-Rule,Rule>> R0,
    <<boost-urls-grammar-Rule,Rule>>... Rn&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-variant_rule_t,variant&lowbar;rule&lowbar;t>>&lt;R0, Rn...&gt;
variant&lowbar;rule(
    R0 const& r0,
    Rn const&... rn) noexcept;
----

== Description


Each specified rule is tried in sequence&period;    When the first match occurs, the result    is stored and returned in the variant&period; If    no match occurs, an error is returned&period;


=== Value Type

[,cpp]
----
using value_type = variant< typename Rules::value_type... >;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
// request-target = origin-form
//                / absolute-form
//                / authority-form
//                / asterisk-form

system::result< variant< url_view, url_view, authority_view, core::string_view > > rv = grammar::parse(
    "/index.html?width=full",
    variant_rule(
        origin_form_rule,
        absolute_uri_rule,
        authority_rule,
        delim_rule('*') ) );
----

=== BNF

[,cpp]
----
variant     = rule1 / rule2 / rule3...
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.2[3&period;2&period;  Alternatives (rfc5234)]
    
* link:https://datatracker.ietf.org/doc/html/rfc7230#section-5.3[5&period;3&period;  Request Target (rfc7230)]



== See Also


xref:#boost-urls-absolute_uri_rule[absolute&lowbar;uri&lowbar;rule],        xref:#boost-urls-authority_rule[authority&lowbar;rule],        xref:#boost-urls-grammar-delim_rule-01[delim&lowbar;rule],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-origin_form_rule[origin&lowbar;form&lowbar;rule],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Error conditions for errors received from rules

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/error.hpp#L114[boost&sol;url&sol;grammar&sol;error&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum class condition : int;
----

== Members


[,cols=2]
|===
|Name |Description
|`fatal`
|A fatal error in syntax was encountered&period;
|===

== See Also


xref:#boost-urls-grammar-error[error],        xref:#boost-urls-grammar-parse-02[parse]&period;





Error codes returned when using rules

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/error.hpp#L26[boost&sol;url&sol;grammar&sol;error&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum class error : int;
----

== Members


[,cols=2]
|===
|Name |Description
|`need&lowbar;more`
|More input is needed to match the rule
|`mismatch`
|The rule did not match the input&period;
|`end&lowbar;of&lowbar;range`
|A rule reached the end of a range
|`leftover`
|Leftover input remaining after match&period;
|`invalid`
|A rule encountered unrecoverable invalid input&period;
|`out&lowbar;of&lowbar;range`
|An integer overflowed during parsing&period;
|`syntax`
|An unspecified syntax error was found&period;
|===

== See Also


xref:#boost-urls-grammar-condition[condition],        xref:#boost-urls-grammar-parse-02[parse]&period;





Provides an aligned storage buffer aligned for T

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L43[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
using aligned&lowbar;storage = &sol;&ast; implementation-defined &ast;&sol;::aligned&lowbar;storage&lowbar;impl&lt;implementation&lowbar;defined&colon;&colon;nearest&lowbar;pow2(sizeof(T), 64), (alignof(&colon;&colon;max&lowbar;align&lowbar;t) &gt; alignof(T)) ? alignof(&colon;&colon;max&lowbar;align&lowbar;t) &colon; alignof(T)&gt;;
----

== Description


[,cpp]
----
template<class T>
struct aligned_storage
{
    /// Return a pointer to the aligned storage area
    void* addr() noexcept;

    /// Return a pointer to the aligned storage area
    void const* addr() const noexcept;
};
----



A case&hyphen;insensitive equals predicate for strings

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L314[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using ci&lowbar;equal = &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-ci_equal,ci&lowbar;equal>>;
----

== Description


The function object returns `true` when    two strings are equal, ignoring case&period;    This is a suitable equality predicate for    unordered containers&period;    The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
boost::unordered_map< std::string, std::string, ci_hash, ci_equal > m1;

std::unordered_map  < std::string, std::string, ci_hash, ci_equal > m2; // (since C++20)
----


== See Also


xref:#boost-urls-grammar-ci_hash[ci&lowbar;hash],        xref:#boost-urls-grammar-ci_less[ci&lowbar;less]&period;





A case&hyphen;insensitive hash function object for strings

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L275[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using ci&lowbar;hash = &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-ci_hash,ci&lowbar;hash>>;
----

== Description


The hash function is non&hyphen;cryptographic and    not hardened against algorithmic complexity    attacks&period;    This is a suitable hash function for    unordered containers&period;    The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
boost::unordered_map< std::string, std::string, ci_hash, ci_equal > m1;

std::unordered_map  < std::string, std::string, ci_hash, ci_equal > m2; // (since C++20)
----


== See Also


xref:#boost-urls-grammar-ci_equal[ci&lowbar;equal],        xref:#boost-urls-grammar-ci_less[ci&lowbar;less]&period;





A case&hyphen;insensitive less predicate for strings

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/ci_string.hpp#L353[boost&sol;url&sol;grammar&sol;ci&lowbar;string&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using ci&lowbar;less = &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-ci_less,ci&lowbar;less>>;
----

== Description


The comparison algorithm implements a    case&hyphen;insensitive total order on the set    of all ASCII strings&semi; however, it is    not a lexicographical comparison&period;    This is a suitable predicate for    ordered containers&period;    The function is defined only for strings    containing low&hyphen;ASCII characters&period;


=== Example

[,cpp]
----
boost::container::map< std::string, std::string, ci_less > m1;

std::map< std::string, std::string, ci_less > m2; // (since C++14)
----


== See Also


xref:#boost-urls-grammar-ci_equal[ci&lowbar;equal],        xref:#boost-urls-grammar-ci_hash[ci&lowbar;hash]&period;





Alias for `std&colon;&colon;true&lowbar;type` if T satisfies xref:#boost-urls-grammar-CharSet[CharSet]&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L66[boost&sol;url&sol;grammar&sol;charset&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
using is&lowbar;charset = &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-is_charset,is&lowbar;charset>>&lt;T&gt;;
----

== Description


This metafunction determines if the    type `T` meets these requirements of    _CharSet_&colon;

* An instance of 
`T`
 is invocable    with this equivalent function signature&colon;
    

[,cpp]
----
bool T::operator()( char ) const noexcept;
----

=== Example

Use with `enable&lowbar;if` on the return value&colon;

[,cpp]
----
template< class CharSet >
typename std::enable_if< is_charset<T>::value >::type
func( CharSet const& cs );
----


== Template Parameters


|===
| Name | Description

| *T*
| the type to check&period;


|===


Determine if T meets the requirements of xref:#boost-urls-grammar-Rule[Rule]

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/type_traits.hpp#L62[boost&sol;url&sol;grammar&sol;type&lowbar;traits&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
using is&lowbar;rule = &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-is_rule,is&lowbar;rule>>&lt;T&gt;;
----

== Description


This is an alias for `std&colon;&colon;true&lowbar;type` if    `T` meets the requirements, otherwise it    is an alias for `std&colon;&colon;false&lowbar;type`&period;


=== Example

[,cpp]
----
struct U
{
    struct value_type;

    auto
    parse(
        char const*& it,
        char const* end) const ->
            system::result<value_type>
};

static_assert( is_rule<U>::value, "Requirements not met" );
----


== See Also


xref:#boost-urls-grammar-parse-02[parse]&period;





The set of all characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/all_chars.hpp#L99[boost&sol;url&sol;grammar&sol;all&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-all_chars_t,all&lowbar;chars&lowbar;t>> all&lowbar;chars = all&lowbar;chars&lcub;&rcub;;
----

== Description



=== Example

Character sets are used with rules and the    functions xref:#boost-urls-grammar-find_if[find&lowbar;if] and xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "JohnDoe", token_rule( all_chars ) );
----

=== BNF

[,cpp]
----
ALL       = %x00-FF
----


== See Also


xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





The set of letters and digits

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/alnum_chars.hpp#L118[boost&sol;url&sol;grammar&sol;alnum&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-alnum_chars_t,alnum&lowbar;chars&lowbar;t>> alnum&lowbar;chars = &lcub;&rcub;;
----

== Description



=== Example

Character sets are used with rules and the    functions xref:#boost-urls-grammar-find_if[find&lowbar;if] and xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< core::string_view > = parse( "Johnny42", token_rule( alnumchars ) );
----

=== BNF

[,cpp]
----
ALNUM       = ALPHA / DIGIT

ALPHA       = %x41-5A / %x61-7A
            ; A-Z / a-z

DIGIT       = %x30-39
            ; 0-9
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B&period;1&period; Core Rules (rfc5234)]



== See Also


xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





The set of all letters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/alpha_chars.hpp#L110[boost&sol;url&sol;grammar&sol;alpha&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-alpha_chars_t,alpha&lowbar;chars&lowbar;t>> alpha&lowbar;chars = alpha&lowbar;chars&lcub;&rcub;;
----

== Description



=== Example

Character sets are used with rules and the    functions xref:#boost-urls-grammar-find_if[find&lowbar;if] and xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "JohnDoe", token_rule( alpha_chars ) );
----

=== BNF

[,cpp]
----
ALPHA       = %x41-5A / %x61-7A
            ; A-Z / a-z
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B&period;1&period; Core Rules (rfc5234)]



== See Also


xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





Match a decimal octet

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/dec_octet_rule.hpp#L104[boost&sol;url&sol;grammar&sol;dec&lowbar;octet&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-dec_octet_rule_t,dec&lowbar;octet&lowbar;rule&lowbar;t>> dec&lowbar;octet&lowbar;rule = &lcub;&rcub;;
----

== Description


A decimal octet is precise way of    saying a number from 0 to 255&period; These    are commonly used in IPv4 addresses&period;


=== Value Type

[,cpp]
----
using value_type = unsigned char;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[parse]&period;

[,cpp]
----
system::result< unsigned char > rv = parse( "255", dec_octet_rule );
----

=== BNF

[,cpp]
----
dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period;  Host (rfc3986)]



== See Also


xref:#boost-urls-grammar-parse-02[parse]&period;





The set of decimal digits

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/digit_chars.hpp#L105[boost&sol;url&sol;grammar&sol;digit&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-digit_chars_t,digit&lowbar;chars&lowbar;t>> digit&lowbar;chars = &lcub;&rcub;;
----

== Description



=== Example

Character sets are used with rules and the    functions xref:#boost-urls-grammar-find_if[find&lowbar;if] and xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "2022", token_rule( digit_chars ) );
----

=== BNF

[,cpp]
----
DIGIT       = %x30-39
            ; 0-9
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B&period;1&period; Core Rules (rfc5234)]



== See Also


xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





The set of hexadecimal digits

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/hexdig_chars.hpp#L136[boost&sol;url&sol;grammar&sol;hexdig&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-hexdig_chars_t,hexdig&lowbar;chars&lowbar;t>> hexdig&lowbar;chars = &lcub;&rcub;;
----

== Description



=== Example

Character sets are used with rules and the    functions xref:#boost-urls-grammar-find_if[find&lowbar;if] and xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "8086FC19", token_rule( hexdig_chars ) );
----

=== BNF

[,cpp]
----
HEXDIG      = DIGIT
            / "A" / "B" / "C" / "D" / "E" / "F"
            / "a" / "b" / "c" / "d" / "e" / "f"
----
[NOTE]
The RFCs are inconsistent on the case    sensitivity of hexadecimal digits&period; Existing    uses suggest case&hyphen;insensitivity is a de&hyphen;facto    standard&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B&period;1&period; Core Rules (rfc5234)]
    
* link:https://datatracker.ietf.org/doc/html/rfc7230#section-1.2[1&period;2&period; Syntax Notation (rfc7230)]
    
* link:https://datatracker.ietf.org/doc/html/rfc5952#section-2.3[2&period;3&period; Uppercase or Lowercase (rfc5952)]
    
* link:https://datatracker.ietf.org/doc/html/rfc5952#section-4.3[4&period;3&period; Lowercase (rfc5952)]



== See Also


xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-hexdig_value[hexdig&lowbar;value],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





The set of visible characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/vchars.hpp#L105[boost&sol;url&sol;grammar&sol;vchars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-grammar-implementation_defined-vchars_t,vchars&lowbar;t>> vchars = &lcub;&rcub;;
----

== Description



=== Example

Character sets are used with rules and the    functions xref:#boost-urls-grammar-find_if[find&lowbar;if] and xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "JohnDoe", token_rule( vchars ) );
----

=== BNF

[,cpp]
----
VCHAR       = 0x21-0x7E
            ; visible (printing) characters
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B&period;1&period; Core Rules (rfc5234)]



== See Also


xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-token_rule[token&lowbar;rule]&period;





== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L467[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
namespace string&lowbar;token = <<boost,boost>>::<<boost-urls,urls>>::<<boost-urls-string_token,string&lowbar;token>>;
----


Concept for a CharSet

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L114[boost&sol;url&sol;grammar&sol;charset&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
concept CharSet = requires (T const t, char c)
&lcub;
    &lcub; t(c) &rcub; &hyphen;&gt; std&colon;&colon;convertible&lowbar;to&lt;bool&gt;&semi;
&rcub;;
----

== Description


A `CharSet` is a unary predicate which is invocable with    this equivalent signature&colon;

[,cpp]
----
bool( char ch ) const noexcept;
----
The predicate returns `true` if `ch` is a member of the    set, or `false` otherwise&period;


=== Exemplar

For best results, it is suggested that all constructors and    member functions for character sets be marked `constexpr`&period;

[,cpp]
----
struct CharSet
{
    bool operator()( char c ) const noexcept;

    // These are both optional. If either or both are left
    // unspecified, a default implementation will be used.
    //
    char const* find_if( char const* first, char const* last ) const noexcept;
    char const* find_if_not( char const* first, char const* last ) const noexcept;
};
----

=== Models

* alnum&lowbar;chars
    
* alpha&lowbar;chars
    
* digit&lowbar;chars
    
* hexdig&lowbar;chars
    
* lut&lowbar;chars



== See Also


xref:#boost-urls-grammar-is_charset[is&lowbar;charset],        xref:#boost-urls-grammar-find_if[find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[find&lowbar;if&lowbar;not]&period;





Concept for a grammar Rule

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/type_traits.hpp#L119[boost&sol;url&sol;grammar&sol;type&lowbar;traits&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
concept Rule = requires (T t, char const&ast;&amp; it, char const&ast; end)
    &lcub;
        typename T&colon;&colon;value&lowbar;type&semi;
        &lcub; t&period;parse(it, end) &rcub; &hyphen;&gt; std&colon;&colon;same&lowbar;as&lt;system&colon;&colon;result&lt;typename T&colon;&colon;value&lowbar;type&gt;&gt;&semi;
    &rcub;;
----

== Description


This concept is satisfied if `T` is a    valid grammar Rule

A `Rule` defines an algorithm used to match an input    buffer of ASCII characters against a set of syntactical    specifications&period;

Each rule represents either a terminal symbol or a    composition in the represented grammar&period;

The library comes with a set of rules for productions    typically found in RFC documents&period;    Rules are not invoked directly&semi; instead, rule variables are    used with overloads of xref:#boost-urls-grammar-parse-02[parse] which provide a convenient,    uniform front end&period;


=== Exemplar

For best results, it is suggested that all constructors for    rules be marked `constexpr`&period;

[,cpp]
----
struct Rule
{
    struct value_type;

    constexpr Rule( Rule const& ) noexcept = default;

    auto parse( char const*& it, char const* end ) const -> result< value_type >;
};

// Declare a variable of type Rule for notational convenience
constexpr Rule rule{};
----

=== Model

* dec&lowbar;octet&lowbar;rule
    
* delim&lowbar;rule
    
* not&lowbar;empty&lowbar;rule
    
* optional&lowbar;rule
    
* range&lowbar;rule
    
* token&lowbar;rule
    
* tuple&lowbar;rule
    
* unsigned&lowbar;rule
    
* variant&lowbar;rule



== See Also


xref:#boost-urls-grammar-parse-02[parse],        xref:#boost-urls-grammar-is_rule[is&lowbar;rule]&period;





== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-string_token-arg,`arg`>> 
| Base class for string tokens, and algorithm parameters

| <<boost-urls-string_token-is_token,`is&lowbar;token`>> 
| Trait to determine if a type is a string token

| <<boost-urls-string_token-return_string,`return&lowbar;string`>> 
| A string token for returning a plain string

|===
== Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-string_token-append_to,`append&lowbar;to`>> 
| Create a string token for appending to a plain string

| <<boost-urls-string_token-assign_to,`assign&lowbar;to`>> 
| Create a string token for assigning to a plain string

| <<boost-urls-string_token-preserve_size,`preserve&lowbar;size`>> 
| Create a string token for a durable core&colon;&colon;string&lowbar;view

|===
== Concepts

[cols=2]
|===
| Name | Description 

| <<boost-urls-string_token-StringToken,`StringToken`>> 
| Concept for a string token

|===


Base class for string tokens, and algorithm parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L51[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct arg;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-string_token-arg-2constructor,`arg`>>         [.small]#[constructor]#
| Default constructor

Default move constructor

Deleted copy constructor


| <<boost-urls-string_token-arg-operator_assign,`operator&equals;`>>  [.small]#[deleted]#
| Deleted copy assignment

Deleted move assignment


| <<boost-urls-string_token-arg-prepare,`prepare`>>  [.small]#[virtual]#
| Return a modifiable character buffer

| <<boost-urls-string_token-arg-2destructor,`&#126;arg`>> [.small]#[destructor]# [.small]#[virtual]#
| Virtual destructor

|===



== Description


This abstract interface provides a means    for an algorithm to generically obtain a    modifiable, contiguous character buffer    of prescribed size&period;

A xref:#boost-urls-string_token-StringToken[StringToken] should be derived    from this class&period; As the author of an    algorithm using a xref:#boost-urls-string_token-StringToken[StringToken],    simply declare an rvalue reference    as a parameter type&period;

Instances of this type are intended only    to be used once and then destroyed&period;


=== Example

The declared function accepts any    temporary instance of `arg` to be    used for writing&colon;

[,cpp]
----
void algorithm( string_token::arg&& dest );
----
To implement the interface for your type    or use&hyphen;case, derive from the class and    implement the prepare function&period;




Default constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L76[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-string_token-arg-2constructor-01,arg>>() = default;
----

[.small]#<<boost-urls-string_token-arg-2constructor-01,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-string_token-arg-2constructor-0c,arg>>(<<boost-urls-string_token-arg,arg>>&&) = default;
----

[.small]#<<boost-urls-string_token-arg-2constructor-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-string_token-arg-2constructor-05,arg>>(<<boost-urls-string_token-arg,arg>> const&) = delete;
----

[.small]#<<boost-urls-string_token-arg-2constructor-05,_» more..._>>#


Default constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L76[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
arg() = default;
----


Default move constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L79[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
arg(<<boost-urls-string_token-arg,arg>>&&) = default;
----


Deleted copy constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L82[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
arg(<<boost-urls-string_token-arg,arg>> const&) = delete;
----


Deleted move assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L85[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-string_token-arg,arg>>&
<<boost-urls-string_token-arg-operator_assign-0f,operator&equals;>>(<<boost-urls-string_token-arg,arg>>&&) = delete;
----

[.small]#<<boost-urls-string_token-arg-operator_assign-0f,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-string_token-arg,arg>>&
<<boost-urls-string_token-arg-operator_assign-01,operator&equals;>>(<<boost-urls-string_token-arg,arg>> const&) = delete;
----

[.small]#<<boost-urls-string_token-arg-operator_assign-01,_» more..._>>#


Deleted move assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L85[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-string_token-arg,arg>>&
operator&equals;(<<boost-urls-string_token-arg,arg>>&&) = delete;
----


Deleted copy assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L88[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-string_token-arg,arg>>&
operator&equals;(<<boost-urls-string_token-arg,arg>> const&) = delete;
----


Return a modifiable character buffer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L70[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
char*
prepare(std::size&lowbar;t n) = 0;
----

== Description


This function attempts to obtain a        character buffer with space for at        least `n` characters&period; Upon success,        a pointer to the beginning of the        buffer is returned&period; Ownership is not        transferred&semi; the caller should not        attempt to free the storage&period; The        buffer shall remain valid until        `this` is destroyed&period;

[NOTE]
This function may only be called once&period;        After invoking the function, the only        valid operation is destruction&period;




Virtual destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L73[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
virtual
&#126;arg() = default;
----


Create a string token for appending to a plain string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L326[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Alloc = std::allocator&lt;char&gt;&gt;
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-string_token-implementation_defined-append_to_t,append&lowbar;to&lowbar;t>>&lt;Alloc&gt;
append&lowbar;to(std::basic&lowbar;string&lt;char, std::char&lowbar;traits&lt;char&gt;, Alloc&gt;& s);
----

== Description


This function creates a xref:#boost-urls-string_token-StringToken[StringToken]    which appends to an existing plain string&period;

Functions using this token will append    the result to the existing string and    return a reference to it&period;




Create a string token for assigning to a plain string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L386[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Alloc = std::allocator&lt;char&gt;&gt;
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-string_token-implementation_defined-assign_to_t,assign&lowbar;to&lowbar;t>>&lt;Alloc&gt;
assign&lowbar;to(std::basic&lowbar;string&lt;char, std::char&lowbar;traits&lt;char&gt;, Alloc&gt;& s);
----

== Description


This function creates a xref:#boost-urls-string_token-StringToken[StringToken]    which assigns to an existing plain string&period;

Functions using this token will assign    the result to the existing string and    return a reference to it&period;




Create a string token for a durable core&colon;&colon;string&lowbar;view

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L452[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Alloc = std::allocator&lt;char&gt;&gt;
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-string_token-implementation_defined-preserve_size_t,preserve&lowbar;size&lowbar;t>>&lt;Alloc&gt;
preserve&lowbar;size(std::basic&lowbar;string&lt;char, std::char&lowbar;traits&lt;char&gt;, Alloc&gt;& s);
----

== Description


This function creates a xref:#boost-urls-string_token-StringToken[StringToken]    which assigns to an existing plain string&period;

Functions using this token will assign    the result to the existing string and    return a `core&colon;&colon;string&lowbar;view` to it&period;




Trait to determine if a type is a string token

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L127[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
using is&lowbar;token = &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-string_token-implementation_defined-is_token,is&lowbar;token>>&lt;T&gt;;
----

== Description


This trait returns `true` if `T` is a valid    xref:#boost-urls-string_token-StringToken[StringToken] type, and `false` otherwise&period;


=== Example

[,cpp]
----
static_assert( string_token::is_token<T>::value );
----



A string token for returning a plain string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L274[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using return&lowbar;string = &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-string_token-implementation_defined-return_string,return&lowbar;string>>;
----

== Description


This xref:#boost-urls-string_token-StringToken[StringToken] is used to customize    a function to return a plain string&period;

This is default token type used by    the methods of xref:#boost-urls-url_view_base[url&lowbar;view&lowbar;base]    that return decoded strings&period;




Concept for a string token

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L228[boost&sol;url&sol;grammar&sol;string&lowbar;token&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
concept StringToken = std&colon;&colon;derived&lowbar;from&lt;T, string&lowbar;token&colon;&colon;arg&gt; &amp;&amp;
    requires (T t, std&colon;&colon;size&lowbar;t n)
&lcub;
    typename T&colon;&colon;result&lowbar;type&semi;
    &lcub; t&period;prepare(n) &rcub; &hyphen;&gt; std&colon;&colon;same&lowbar;as&lt;char&ast;&gt;&semi;
    &lcub; t&period;result() &rcub; &hyphen;&gt; std&colon;&colon;convertible&lowbar;to&lt;typename T&colon;&colon;result&lowbar;type&gt;&semi;
&rcub;;
----

== Description


This concept is satisfied if `T` is a    valid string token type&period;

A string token is an rvalue passed to a function template    which customizes the return type of the function and also    controls how a modifiable character buffer is obtained and presented&period;

The string token&apos;s lifetime extends only for the duration of the    function call in which it appears as a parameter&period;

A string token cannot be copied, moved, or assigned, and must be    destroyed when the function returns or throws&period;


=== Semantics

`T&colon;&colon;result&lowbar;type` determines the return type of functions    that accept a string token&period;

The `prepare()` function overrides the virtual function    in the base class xref:#boost-urls-string_token-arg[arg]&period; It must return a pointer to    a character buffer of at least size `n`, otherwise    throw an exception&period; This function is called only    once or not at all&period;

The `result()` function is invoked by the algorithm    to receive the result from the string token&period;    It is only invoked if `prepare()` returned    successfully and the string token was not destroyed&period;    It is only called after `prepare()` returns    successfully, and the string token is destroyed    when the algorithm completes or if an exception    is thrown&period;

String tokens cannot be reused&period;


=== Exemplars

String token prototype&colon;

[,cpp]
----
struct StringToken : string_token::arg
{
    using result_type = std::string;

    char* prepare( std::size_t n ) override;

    result_type result();
};
----
Algorithm prototype&colon;

[,cpp]
----
namespace detail {

// Algorithm implementation may be placed
// out of line, and written as an ordinary
// function (no template required).
void algorithm_impl( string_token::arg& token )
{
    std::size_t n = 0;

    // calculate space needed in n
    // ...

    // acquire a destination buffer
    char* dest = token.prepare( n );

    // write the characters to the buffer
}
} // detail

// public interface is a function template,
// defaulting to return std::string.
template< class StringToken = string_token::return_string >
auto
algorithm( StringToken&& token = {} ) ->
    typename StringToken::result_type
{
    // invoke the algorithm with the token
    algorithm_impl( token );

    // return the result from the token
    return token.result();
}
----

=== Models

The following classes and functions implement and    generate string tokens&period;

* return&lowbar;string
    
* assign&lowbar;to
    
* preserve&lowbar;size




A non&hyphen;owning reference to a valid authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L82[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class authority&lowbar;view;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-authority_view-2constructor,`authority&lowbar;view`>>         [.small]#[constructor]#
| Construct from a string&period;

Constructor


| <<boost-urls-authority_view-buffer,`buffer`>> 
| Return the complete authority

| <<boost-urls-authority_view-compare,`compare`>> 
| Return the result of comparing this with another authority

| <<boost-urls-authority_view-data,`data`>> 
| Return a pointer to the first character

| <<boost-urls-authority_view-empty,`empty`>> 
| Return true if the authority is empty

| <<boost-urls-authority_view-encoded_host,`encoded&lowbar;host`>> 
| Return the host

| <<boost-urls-authority_view-encoded_host_address,`encoded&lowbar;host&lowbar;address`>> 
| Return the host

| <<boost-urls-authority_view-encoded_host_and_port,`encoded&lowbar;host&lowbar;and&lowbar;port`>> 
| Return the host and port

| <<boost-urls-authority_view-encoded_host_name,`encoded&lowbar;host&lowbar;name`>> 
| Return the host name

| <<boost-urls-authority_view-encoded_password,`encoded&lowbar;password`>> 
| Return the password

| <<boost-urls-authority_view-encoded_user,`encoded&lowbar;user`>> 
| Return the user

| <<boost-urls-authority_view-encoded_userinfo,`encoded&lowbar;userinfo`>> 
| Return the userinfo

| <<boost-urls-authority_view-has_password,`has&lowbar;password`>> 
| Return true if a password is present

| <<boost-urls-authority_view-has_port,`has&lowbar;port`>> 
| Return true if a port is present

| <<boost-urls-authority_view-has_userinfo,`has&lowbar;userinfo`>> 
| Return true if a userinfo is present

| <<boost-urls-authority_view-host,`host`>> 
| Return the host

| <<boost-urls-authority_view-host_address,`host&lowbar;address`>> 
| Return the host

| <<boost-urls-authority_view-host_ipv4_address,`host&lowbar;ipv4&lowbar;address`>> 
| Return the host IPv4 address

| <<boost-urls-authority_view-host_ipv6_address,`host&lowbar;ipv6&lowbar;address`>> 
| Return the host IPv6 address

| <<boost-urls-authority_view-host_ipvfuture,`host&lowbar;ipvfuture`>> 
| Return the host IPvFuture address

| <<boost-urls-authority_view-host_name,`host&lowbar;name`>> 
| Return the host name

| <<boost-urls-authority_view-host_type,`host&lowbar;type`>> 
| Return the host type

| <<boost-urls-authority_view-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-authority_view-password,`password`>> 
| Return the password

| <<boost-urls-authority_view-port,`port`>> 
| Return the port

| <<boost-urls-authority_view-port_number,`port&lowbar;number`>> 
| Return the port

| <<boost-urls-authority_view-size,`size`>> 
| Return the number of characters in the authority

| <<boost-urls-authority_view-user,`user`>> 
| Return the user

| <<boost-urls-authority_view-userinfo,`userinfo`>> 
| Return the userinfo

| <<boost-urls-authority_view-2destructor,`&#126;authority&lowbar;view`>> [.small]#[destructor]# [.small]#[virtual]#
| Destructor

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-authority_view-08friend-0c,`operator!&equals;`>> 
| Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

| <<boost-urls-authority_view-08friend-076,`operator&lt;`>> 
| Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

| <<boost-urls-authority_view-08friend-08,`operator&lt;&lt;`>> 
| Format the encoded authority to the output stream

| <<boost-urls-authority_view-08friend-007,`operator&lt;&equals;`>> 
| Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

| <<boost-urls-authority_view-08friend-00c,`operator&equals;&equals;`>> 
| Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

| <<boost-urls-authority_view-08friend-0d,`operator&gt;`>> 
| Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

| <<boost-urls-authority_view-08friend-072,`operator&gt;&equals;`>> 
| Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

|===



== Description


Objects of this type represent valid authority    strings constructed from a parsed, external    character buffer whose storage is managed    by the caller&period; That is, it acts like a    `core&colon;&colon;string&lowbar;view` in terms of ownership&period;    The caller is responsible for ensuring    that the lifetime of the underlying    character buffer extends until it is no    longer referenced&period;


=== Example 1

Construction from a string parses the input    as an _authority_ and throws an    exception on error&period; Upon success, the    constructed object points to the passed    character buffer&semi; ownership is not    transferred&period;

[,cpp]
----
authority_view a( "user:pass@www.example.com:8080" );
----

=== Example 2

The parsing function xref:#boost-urls-parse_authority[parse&lowbar;authority] returns    a result containing either a valid    xref:#boost-urls-authority_view-2constructor-0e[authority&lowbar;view] upon succcess, otherwise it    contain an error&period; The error can be converted to    an exception by the caller if desired&colon;

[,cpp]
----
system::result< authority_view > rv = parse_authority( "user:pass@www.example.com:8080" );
----

=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = user [ ":" [ password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )

host          = IP-literal / IPv4address / reg-name

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-parse_authority[parse&lowbar;authority]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L121[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-authority_view-2constructor-0e,authority&lowbar;view>>() noexcept;
----

[.small]#<<boost-urls-authority_view-2constructor-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-authority_view-2constructor-03,authority&lowbar;view>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-authority_view-2constructor-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-authority_view-2constructor-04,authority&lowbar;view>>(<<boost-urls-authority_view,authority&lowbar;view>> const&) noexcept;
----

[.small]#<<boost-urls-authority_view-2constructor-04,_» more..._>>#

== Description


Default constructed authorities        refer to a string with zero length,        which is always valid&period; This matches        the grammar for a zero&hyphen;length host&period;


=== Exception Safety

Throws nothing&period;


=== Specification




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L121[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
authority&lowbar;view() noexcept;
----

== Description


Default constructed authorities        refer to a string with zero length,        which is always valid&period; This matches        the grammar for a zero&hyphen;length host&period;


=== Exception Safety

Throws nothing&period;


=== Specification




Construct from a string&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L158[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
authority&lowbar;view(core::string&lowbar;view s);
----

== Description


This function attempts to construct        an authority from the string `s`,        which must be a valid &lsqb;&apos;authority&rsqb; or        else an exception is thrown&period; Upon        successful construction, the view        refers to the characters in the        buffer pointed to by `s`&period;        Ownership is not transferred&semi; The        caller is responsible for ensuring        that the lifetime of the buffer        extends until the view is destroyed&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = user [ ":" [ password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )

host          = IP-literal / IPv4address / reg-name

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-parse_authority[parse&lowbar;authority]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L163[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
authority&lowbar;view(<<boost-urls-authority_view,authority&lowbar;view>> const&) noexcept;
----


Return the complete authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L253[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
buffer() const noexcept;
----

== Description


This function returns the authority        as a percent&hyphen;encoded string&period;


=== Example

[,cpp]
----
assert( parse_authority( "www.example.com" ).value().buffer() == "www.example.com" );
----

=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]




Return the result of comparing this with another authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1232[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
compare(<<boost-urls-authority_view,authority&lowbar;view>> const& other) const noexcept;
----

== Description


This function compares two authorities        according to Syntax&hyphen;Based comparison        algorithm&period;


=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`&hyphen;1` if `&ast;this &lt; other`, `0` if        `this &equals;&equals; other`, and 1 if `this &gt; other`&period;




Return a pointer to the first character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L225[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
char const*
data() const noexcept;
----

== Description


This function returns a pointer to the        beginning of the view, which is not        guaranteed to be null&hyphen;terminated&period;


=== Exception Safety

Throws nothing&period;




Return true if the authority is empty

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L210[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description


An empty authority has an empty host,        no userinfo, and no port&period;


=== Example

[,cpp]
----
assert( authority_view( "" ).empty() );
----

=== Exception Safety

Throws nothing&period;




Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L743[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host() const noexcept;
----

== Description


This function returns the host portion        of the authority as a string, or the        empty string if there is no authority&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).encoded_host() == "www%2droot.example.com" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L857[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host&lowbar;address() const noexcept;
----

== Description


The value returned by this function        depends on the type of host returned        from the function xref:#boost-urls-authority_view-host_type[host&lowbar;type]&period;

* If the type is 
host&lowbar;type&colon;&colon;ipv4
,        then the IPv4 address string is returned&period;
* If the type is 
host&lowbar;type&colon;&colon;ipv6
,        then the IPv6 address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;ipvfuture
,        then the IPvFuture address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;name
,        then the host name string is returned&period;        Any percent&hyphen;escapes in the string are
        decoded first&period;
* If the type is 
host&lowbar;type&colon;&colon;none
,        then an empty string is returned&period;        The returned string may contain
        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).encoded_host_address() == "www%2droot.example.com" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host and port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1207[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host&lowbar;and&lowbar;port() const noexcept;
----

== Description


If an authority is present, this        function returns the host and optional        port as a string, which may be empty&period;        Otherwise it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com:8080/index.htm" ).encoded_host_and_port() == "www.example.com:8080" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period;  Host (rfc3986)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_port[has&lowbar;port],            xref:#boost-urls-authority_view-port[port],            xref:#boost-urls-authority_view-port_number[port&lowbar;number]&period;





Return the host name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1057[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host&lowbar;name() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name],        this function returns the name as        a string&period;        Otherwise, if the host type is not an        name, it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).encoded_host_name() == "www%2droot.example.com" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the password

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L627[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;password() const noexcept;
----

== Description


This function returns the password portion        of the userinfo as a percent&hyphen;encoded string&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_password() == "pass" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_password[has&lowbar;password],            xref:#boost-urls-authority_view-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-authority_view-encoded_user[encoded&lowbar;user],            xref:#boost-urls-authority_view-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-authority_view-password[password],            xref:#boost-urls-authority_view-user[user],            xref:#boost-urls-authority_view-userinfo[userinfo]&period;





Return the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L494[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;user() const noexcept;
----

== Description


If present, this function returns a        string representing the user (which        may be empty)&period;        Otherwise it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_user() == "jane%2Ddoe" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_password[has&lowbar;password],            xref:#boost-urls-authority_view-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-authority_view-encoded_password[encoded&lowbar;password],            xref:#boost-urls-authority_view-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-authority_view-password[password],            xref:#boost-urls-authority_view-user[user],            xref:#boost-urls-authority_view-userinfo[userinfo]&period;





Return the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L396[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;userinfo() const noexcept;
----

== Description


If present, this function returns a        string representing the userinfo (which        may be empty)&period;        Otherwise it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_userinfo() == "jane%2Ddoe:pass" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_password[has&lowbar;password],            xref:#boost-urls-authority_view-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-authority_view-encoded_password[encoded&lowbar;password],            xref:#boost-urls-authority_view-encoded_user[encoded&lowbar;user],            xref:#boost-urls-authority_view-password[password],            xref:#boost-urls-authority_view-user[user],            xref:#boost-urls-authority_view-userinfo[userinfo]&period;





Return true if a password is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L535[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;password() const noexcept;
----

== Description


This function returns true if the        userinfo is present and contains        a password&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_password() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-authority_view-encoded_password[encoded&lowbar;password],            xref:#boost-urls-authority_view-encoded_user[encoded&lowbar;user],            xref:#boost-urls-authority_view-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-authority_view-password[password],            xref:#boost-urls-authority_view-user[user],            xref:#boost-urls-authority_view-userinfo[userinfo]&period;





Return true if a port is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1098[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;port() const noexcept;
----

== Description


This function returns true if an        authority is present and contains a port&period;


=== Example

[,cpp]
----
assert( url_view( "wss://www.example.com:443" ).has_port() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]

port        = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-authority_view-encoded_host_and_port[encoded&lowbar;host&lowbar;and&lowbar;port],            xref:#boost-urls-authority_view-port[port],            xref:#boost-urls-authority_view-port_number[port&lowbar;number]&period;





Return true if a userinfo is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L302[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;userinfo() const noexcept;
----

== Description


This function returns true if this        contains a userinfo&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_userinfo() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_password[has&lowbar;password],            xref:#boost-urls-authority_view-encoded_password[encoded&lowbar;password],            xref:#boost-urls-authority_view-encoded_user[encoded&lowbar;user],            xref:#boost-urls-authority_view-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-authority_view-password[password],            xref:#boost-urls-authority_view-user[user],            xref:#boost-urls-authority_view-userinfo[userinfo]&period;





Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L700[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
host(StringToken&& token);
----

== Description


This function returns the host portion        of the authority as a string, or the        empty string if there is no authority&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).host() == "www-root.example.com" );
----

=== Complexity

Linear in `this&hyphen;&gt;host()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L795[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
host&lowbar;address(StringToken&& token);
----

== Description


The value returned by this function        depends on the type of host returned        from the function xref:#boost-urls-authority_view-host_type[host&lowbar;type]&period;

* If the type is 
host&lowbar;type&colon;&colon;ipv4
,        then the IPv4 address string is returned&period;
* If the type is 
host&lowbar;type&colon;&colon;ipv6
,        then the IPv6 address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;ipvfuture
,        then the IPvFuture address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;name
,        then the host name string is returned&period;        Any percent&hyphen;escapes in the string are
        decoded first&period;
* If the type is 
host&lowbar;type&colon;&colon;none
,        then an empty string is returned&period;


=== Example

[,cpp]
----
assert( url_view( "https://[1::6:c0a8:1]/" ).host_address() == "1::6:c0a8:1" );
----

=== Complexity

Linear in `this&hyphen;&gt;host&lowbar;address()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host IPv4 address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L896[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv4_address,ipv4&lowbar;address>>
host&lowbar;ipv4&lowbar;address() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv4],        this function returns the address as        a value of type xref:#boost-urls-ipv4_address[ipv4&lowbar;address]&period;        Otherwise, if the host type is not an IPv4        address, it returns a default&hyphen;constructed        value which is equal to the unspecified        address &quot;0&period;0&period;0&period;0&quot;&period;


=== Example

[,cpp]
----
assert( url_view( "http://127.0.0.1/index.htm?user=win95" ).host_ipv4_address() == ipv4_address( "127.0.0.1" ) );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host IPv6 address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L943[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv6_address,ipv6&lowbar;address>>
host&lowbar;ipv6&lowbar;address() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv6],        this function returns the address as        a value of type xref:#boost-urls-ipv6_address[ipv6&lowbar;address]&period;        Otherwise, if the host type is not an IPv6        address, it returns a default&hyphen;constructed        value which is equal to the unspecified        address &quot;0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0&quot;&period;


=== Example

[,cpp]
----
assert( url_view( "ftp://[::1]/" ).host_ipv6_address() == ipv6_address( "::1" ) );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host IPvFuture address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L975[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
host&lowbar;ipvfuture() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipvfuture],        this function returns the address as        a string&period;        Otherwise, if the host type is not an        IPvFuture address, it returns an        empty string&period;


=== Example

[,cpp]
----
assert( url_view( "http://[v1fe.d:9]/index.htm" ).host_ipvfuture() == "v1fe.d:9" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
IPvFuture  = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1012[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
host&lowbar;name(StringToken&& token);
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name],        this function returns the name as        a string&period;        Otherwise, if the host type is not an        name, it returns an empty string&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).host_name() == "www-root.example.com" );
----

=== Complexity

Linear in `this&hyphen;&gt;host&lowbar;name()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L662[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls,urls>>::<<boost-urls-host_type,host&lowbar;type>>
host&lowbar;type() const noexcept;
----

== Description


This function returns one of the        following constants representing the        type of host present&period;

* host&lowbar;type&colon;&colon;ipv4
        
* host&lowbar;type&colon;&colon;ipv6
        
* host&lowbar;type&colon;&colon;ipvfuture
        
* host&lowbar;type&colon;&colon;name


=== Example

[,cpp]
----
assert( url_view( "https://192.168.0.1/local.htm" ).host_type() == host_type::ipv4 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L168[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-authority_view,authority&lowbar;view>>&
operator&equals;(<<boost-urls-authority_view,authority&lowbar;view>> const&) noexcept;
----


Return the password

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L579[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
password(StringToken&& token);
----

== Description


If present, this function returns a        string representing the password (which        may be an empty string)&period;        Otherwise it returns an empty string&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).password() == "pass" );
----

=== Complexity

Linear in `this&hyphen;&gt;password()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_password[has&lowbar;password],            xref:#boost-urls-authority_view-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-authority_view-encoded_password[encoded&lowbar;password],            xref:#boost-urls-authority_view-encoded_user[encoded&lowbar;user],            xref:#boost-urls-authority_view-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-authority_view-user[user],            xref:#boost-urls-authority_view-userinfo[userinfo]&period;





Return the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1133[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
port() const noexcept;
----

== Description


If present, this function returns a        string representing the port (which        may be empty)&period;        Otherwise it returns an empty string&period;


=== Example

[,cpp]
----
assert( url_view( "http://localhost.com:8080" ).port() == "8080" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
port        = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-authority_view-encoded_host_and_port[encoded&lowbar;host&lowbar;and&lowbar;port],            xref:#boost-urls-authority_view-has_port[has&lowbar;port],            xref:#boost-urls-authority_view-port_number[port&lowbar;number]&period;





Return the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1168[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::uint16&lowbar;t
port&lowbar;number() const noexcept;
----

== Description


If a port is present and the numerical        value is representable, it is returned        as an unsigned integer&period; Otherwise, the        number zero is returned&period;


=== Example

[,cpp]
----
assert( url_view( "http://localhost.com:8080" ).port_number() == 8080 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
port        = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-authority_view-encoded_host_and_port[encoded&lowbar;host&lowbar;and&lowbar;port],            xref:#boost-urls-authority_view-has_port[has&lowbar;port],            xref:#boost-urls-authority_view-port[port]&period;





Return the number of characters in the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L191[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
size() const noexcept;
----

== Description


This function returns the number of        characters in the authority&period;


=== Example

[,cpp]
----
assert( authority_view( "user:pass@www.example.com:8080" ).size() == 30 );
----

=== Exception Safety

Throws nothing&period;




Return the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L442[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
user(StringToken&& token);
----

== Description


If present, this function returns a        string representing the user (which        may be empty)&period;        Otherwise it returns an empty string&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).user() == "jane-doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;user()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_password[has&lowbar;password],            xref:#boost-urls-authority_view-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-authority_view-encoded_password[encoded&lowbar;password],            xref:#boost-urls-authority_view-encoded_user[encoded&lowbar;user],            xref:#boost-urls-authority_view-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-authority_view-password[password],            xref:#boost-urls-authority_view-userinfo[userinfo]&period;





Return the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L345[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
userinfo(StringToken&& token);
----

== Description


If present, this function returns a        string representing the userinfo (which        may be empty)&period;        Otherwise it returns an empty string&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).userinfo() == "jane-doe:pass" );
----

=== Complexity

Linear in `this&hyphen;&gt;userinfo()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-authority_view-has_password[has&lowbar;password],            xref:#boost-urls-authority_view-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-authority_view-encoded_password[encoded&lowbar;password],            xref:#boost-urls-authority_view-encoded_user[encoded&lowbar;user],            xref:#boost-urls-authority_view-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-authority_view-password[password],            xref:#boost-urls-authority_view-user[user]&period;





Destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L106[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
&#126;authority&lowbar;view();
----


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1266[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator!&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1286[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&lt;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Format the encoded authority to the output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1375[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a);
----

== Description


This hidden friend function serializes the encoded URL        to the output stream&period;


=== Example

[,cpp]
----
authority_view a( "www.example.com" );

std::cout << a << std::endl;
----


== Return Value


A reference to the output stream, for chaining



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to


| *a*
| The URL to write


|===


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1306[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&lt;&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1246[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&equals;&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1326[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&gt;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1346[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&gt;&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




A reference to a valid, percent&hyphen;encoded string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L72[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class decode&lowbar;view;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-decode_view-const_iterator,`const&lowbar;iterator`>> 
| An iterator of constant, decoded characters&period;

| <<boost-urls-decode_view-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-decode_view-difference_type,`difference&lowbar;type`>> 
| The signed integer type

| <<boost-urls-decode_view-iterator,`iterator`>> 
| An iterator of constant, decoded characters&period;

| <<boost-urls-decode_view-reference,`reference`>> 
| The reference type

| <<boost-urls-decode_view-size_type,`size&lowbar;type`>> 
| The unsigned integer type

| <<boost-urls-decode_view-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-decode_view-back,`back`>> 
| Return the last character

| <<boost-urls-decode_view-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-decode_view-compare,`compare`>> 
| Return the result of comparing to another string


| <<boost-urls-decode_view-2constructor,`decode&lowbar;view`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-decode_view-empty,`empty`>> 
| Return true if the string is empty

| <<boost-urls-decode_view-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-decode_view-ends_with,`ends&lowbar;with`>> 
| Checks if the string ends with the given prefix


| <<boost-urls-decode_view-find,`find`>> 
| Finds the first occurrence of character in this view

| <<boost-urls-decode_view-front,`front`>> 
| Return the first character

| <<boost-urls-decode_view-options,`options`>> 
| Return the decoding options

| <<boost-urls-decode_view-remove_prefix,`remove&lowbar;prefix`>> 
| Remove the first characters

| <<boost-urls-decode_view-remove_suffix,`remove&lowbar;suffix`>> 
| Remove the last characters

| <<boost-urls-decode_view-rfind,`rfind`>> 
| Finds the first occurrence of character in this view

| <<boost-urls-decode_view-size,`size`>> 
| Return the number of decoded characters

| <<boost-urls-decode_view-starts_with,`starts&lowbar;with`>> 
| Checks if the string begins with the given prefix


|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-decode_view-08friend-0f,`operator!&equals;`>> 
| Compare two decode views for inequality

| <<boost-urls-decode_view-08friend-09a,`operator!&equals;`>> 
| Compare two decode views for inequality

| <<boost-urls-decode_view-08friend-01,`operator!&equals;`>> 
| Compare two decode views for inequality

| <<boost-urls-decode_view-08friend-09c,`operator&lt;`>> 
| Compare two decode views for less than

| <<boost-urls-decode_view-08friend-054,`operator&lt;`>> 
| Compare two decode views for less than

| <<boost-urls-decode_view-08friend-047,`operator&lt;`>> 
| Compare two decode views for less than

| <<boost-urls-decode_view-08friend-08,`operator&lt;&lt;`>> 
| Format the string with percent&hyphen;decoding applied to the output stream

| <<boost-urls-decode_view-08friend-04a,`operator&lt;&equals;`>> 
| Compare two decode views for less than or equal

| <<boost-urls-decode_view-08friend-0b,`operator&lt;&equals;`>> 
| Compare two decode views for less than or equal

| <<boost-urls-decode_view-08friend-0c,`operator&lt;&equals;`>> 
| Compare two decode views for less than or equal

| <<boost-urls-decode_view-08friend-05f,`operator&equals;&equals;`>> 
| Compare two decode views for equality

| <<boost-urls-decode_view-08friend-097,`operator&equals;&equals;`>> 
| Compare two decode views for equality

| <<boost-urls-decode_view-08friend-0e8,`operator&equals;&equals;`>> 
| Compare two decode views for equality

| <<boost-urls-decode_view-08friend-02,`operator&gt;`>> 
| Compare two decode views for greater than

| <<boost-urls-decode_view-08friend-049,`operator&gt;`>> 
| Compare two decode views for greater than

| <<boost-urls-decode_view-08friend-0ec,`operator&gt;`>> 
| Compare two decode views for greater than

| <<boost-urls-decode_view-08friend-0d,`operator&gt;&equals;`>> 
| Compare two decode views for greater than or equal

| <<boost-urls-decode_view-08friend-0aa1,`operator&gt;&equals;`>> 
| Compare two decode views for greater than or equal

| <<boost-urls-decode_view-08friend-0aa2,`operator&gt;&equals;`>> 
| Compare two decode views for greater than or equal

|===



== Description


These views reference strings in parts of URLs    or other components that are percent&hyphen;encoded&period;    The special characters (those not in the    allowed character set) are stored as three    character escapes that consist of a percent    sign (&apos;%%&apos;) followed by a two&hyphen;digit hexadecimal    number of the corresponding unescaped character    code, which may be part of a UTF&hyphen;8 code point    depending on the context&period;

The view refers to the original character    buffer and only decodes escaped sequences when    needed&period; In particular these operations perform    percent&hyphen;decoding automatically without the    need to allocate memory&colon;

* Iteration of the string    
* Accessing the encoded character buffer    
* Comparison to encoded or plain strings

These objects can only be constructed from    strings that have a valid percent&hyphen;encoding,    otherwise construction fails&period; The caller is    responsible for ensuring that the lifetime    of the character buffer from which the view    is constructed extends unmodified until the    view is no longer accessed&period;




An iterator of constant, decoded characters&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L129[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----




== Description


This iterator is used to access the encoded        string as a *bidirectional* range of characters        with percent&hyphen;decoding applied&period; Escape sequences        are not decoded until the iterator is        dereferenced&period;




Return the last character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L331[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view-reference,reference>>
back() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).back() == 's' );
----

=== Preconditions

[,cpp]
----
not this->empty()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L273[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view-iterator,iterator>>
begin() const noexcept;
----

== Description



=== Example

[,cpp]
----
auto it = this->begin();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L501[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-decode_view-compare-02,compare>>(core::string&lowbar;view other) const noexcept;
----

[.small]#<<boost-urls-decode_view-compare-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
<<boost-urls-decode_view-compare-01,compare>>(<<boost-urls-decode_view,decode&lowbar;view>> other) const noexcept;
----

[.small]#<<boost-urls-decode_view-compare-01,_» more..._>>#

== Description


The length of the sequences to compare is the smaller of        `size()` and `other&period;size()`&period;

The function compares the two strings as if by calling        `char&lowbar;traits&lt;char&gt;&colon;&colon;compare(to&lowbar;string()&period;data(), v&period;data(), rlen)`&period;        This means the comparison is performed with        percent&hyphen;decoding applied to the current string&period;



== Return Value


Negative value if this string is less than the other        character sequence, zero if the both character sequences are        equal, positive value if this string is greater than the other        character sequence



== Parameters


|===
| Name | Description

| *other*
| string to compare


|===


Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L501[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(core::string&lowbar;view other) const noexcept;
----

== Description


The length of the sequences to compare is the smaller of        `size()` and `other&period;size()`&period;

The function compares the two strings as if by calling        `char&lowbar;traits&lt;char&gt;&colon;&colon;compare(to&lowbar;string()&period;data(), v&period;data(), rlen)`&period;        This means the comparison is performed with        percent&hyphen;decoding applied to the current string&period;



== Return Value


Negative value if this string is less than the other        character sequence, zero if the both character sequences are        equal, positive value if this string is greater than the other        character sequence



== Parameters


|===
| Name | Description

| *other*
| string to compare


|===


Return the result of comparing to another string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L522[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(<<boost-urls-decode_view,decode&lowbar;view>> other) const noexcept;
----

== Description


The length of the sequences to compare is the smaller of        `size()` and `other&period;size()`&period;

The function compares the two strings as if by calling        `char&lowbar;traits&lt;char&gt;&colon;&colon;compare(to&lowbar;string()&period;data(), v&period;to&lowbar;string()&period;data(), rlen)`&period;        This means the comparison is performed with        percent&hyphen;decoding applied to the current string&period;



== Return Value


Negative value if this string is less than the other        character sequence, zero if the both character sequences are        equal, positive value if this string is greater than the other        character sequence



== Parameters


|===
| Name | Description

| *other*
| string to compare


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L161[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-decode_view-2constructor-07,decode&lowbar;view>>() noexcept = default;
----

[.small]#<<boost-urls-decode_view-2constructor-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
<<boost-urls-decode_view-2constructor-03,decode&lowbar;view>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;) noexcept;
----

[.small]#<<boost-urls-decode_view-2constructor-03,_» more..._>>#

== Description


Default&hyphen;constructed views represent        empty strings&period;


=== Example

[,cpp]
----
decode_view ds;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *s*
| A percent&hyphen;encoded string that has        already been validated&period; Implicit conversion        from other string types is supported but        may throw exceptions&period;


| *opt*
| The options for decoding&period; If        this parameter is omitted, the default        options are used&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L161[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
decode&lowbar;view() noexcept = default;
----

== Description


Default&hyphen;constructed views represent        empty strings&period;


=== Example

[,cpp]
----
decode_view ds;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L199[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
decode&lowbar;view(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;) noexcept;
----

== Description


This constructs a view from the character        buffer `s`, which must remain valid and        unmodified until the view is no longer        accessed&period;


=== Example

[,cpp]
----
decode_view ds( "Program%20Files" );
----

=== Postconditions

[,cpp]
----
this->encoded() == s
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Although this function does not throw exceptions,        implicitly constructing a xref:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]        for the first argument can throw exceptions        on invalid input&period;



== Parameters


|===
| Name | Description

| *s*
| A percent&hyphen;encoded string that has        already been validated&period; Implicit conversion        from other string types is supported but        may throw exceptions&period;


| *opt*
| The options for decoding&period; If        this parameter is omitted, the default        options are used&period;


|===


Return true if the string is empty

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L230[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "" ).empty() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L289[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view-iterator,iterator>>
end() const noexcept;
----

== Description



=== Example

[,cpp]
----
auto it = this->end();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Checks if the string ends with the given prefix

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L365[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-decode_view-ends_with-04,ends&lowbar;with>>(core::string&lowbar;view s) const noexcept;
----

[.small]#<<boost-urls-decode_view-ends_with-04,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-decode_view-ends_with-0d,ends&lowbar;with>>(char ch) const noexcept;
----

[.small]#<<boost-urls-decode_view-ends_with-0d,_» more..._>>#

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).ends_with("Files") );
----

=== Complexity

Linear&period;


=== Exception Safety

Throws nothing&period;




Checks if the string ends with the given prefix

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L365[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
ends&lowbar;with(core::string&lowbar;view s) const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).ends_with("Files") );
----

=== Complexity

Linear&period;


=== Exception Safety

Throws nothing&period;




Checks if the string ends with the given prefix

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L399[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
ends&lowbar;with(char ch) const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).ends_with('s') );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Finds the first occurrence of character in this view

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L411[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view-const_iterator,const&lowbar;iterator>>
find(char ch) const noexcept;
----

== Description



=== Complexity

Linear&period;


=== Exception Safety

Throws nothing&period;




Return the first character

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L310[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view-reference,reference>>
front() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).front() == 'P' );
----

=== Preconditions

[,cpp]
----
not this->empty()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the decoding options

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L470[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-encoding_opts,encoding&lowbar;opts>>
options() const noexcept;
----


Remove the first characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L444[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
remove&lowbar;prefix(<<boost-urls-decode_view-size_type,size&lowbar;type>> n);
----

== Description



=== Example

[,cpp]
----
decode_view d( "Program%20Files" );
d.remove_prefix( 8 );
assert( d == "Files" );
----

=== Preconditions

[,cpp]
----
not this->empty()
----

=== Complexity

Linear&period;




Remove the last characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L465[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
remove&lowbar;suffix(<<boost-urls-decode_view-size_type,size&lowbar;type>> n);
----

== Description



=== Example

[,cpp]
----
decode_view d( "Program%20Files" );
d.remove_prefix( 6 );
assert( d == "Program" );
----

=== Preconditions

[,cpp]
----
not this->empty()
----

=== Complexity

Linear&period;




Finds the first occurrence of character in this view

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L423[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view-const_iterator,const&lowbar;iterator>>
rfind(char ch) const noexcept;
----

== Description



=== Complexity

Linear&period;


=== Exception Safety

Throws nothing&period;




Return the number of decoded characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L254[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view-size_type,size&lowbar;type>>
size() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).size() == 13 );
----

=== Effects

[,cpp]
----
return std::distance( this->begin(), this->end() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Checks if the string begins with the given prefix

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L348[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-decode_view-starts_with-01,starts&lowbar;with>>(core::string&lowbar;view s) const noexcept;
----

[.small]#<<boost-urls-decode_view-starts_with-01,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-decode_view-starts_with-0b,starts&lowbar;with>>(char ch) const noexcept;
----

[.small]#<<boost-urls-decode_view-starts_with-0b,_» more..._>>#

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).starts_with("Program") );
----

=== Complexity

Linear&period;


=== Exception Safety

Throws nothing&period;




Checks if the string begins with the given prefix

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L348[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
starts&lowbar;with(core::string&lowbar;view s) const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).starts_with("Program") );
----

=== Complexity

Linear&period;


=== Exception Safety

Throws nothing&period;




Checks if the string begins with the given prefix

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L382[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
starts&lowbar;with(char ch) const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( decode_view( "Program%20Files" ).starts_with('P') );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




An iterator of constant, decoded characters&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L132[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = <<boost-urls-decode_view-iterator,iterator>>;
----

== Description


This iterator is used to access the encoded        string as a *bidirectional* range of characters        with percent&hyphen;decoding applied&period; Escape sequences        are not decoded until the iterator is        dereferenced&period;




The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L111[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = char;
----


The signed integer type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L119[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using difference&lowbar;type = std::ptrdiff&lowbar;t;
----


The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L108[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = char;
----


The unsigned integer type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L115[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using size&lowbar;type = std::size&lowbar;t;
----


The value type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L104[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = char;
----


Compare two decode views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L630[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
bool
operator!&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L641[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator!&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L653[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator!&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L677[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
bool
operator&lt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L688[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&lt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L700[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&lt;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Format the string with percent&hyphen;decoding applied to the output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L864[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-decode_view,decode&lowbar;view>> const& s);
----

== Description


This hidden friend function serializes the decoded view        to the output stream&period;



== Return Value


A reference to the output stream, for chaining



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to


| *s*
| The decoded view to write


|===


Compare two decode views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L724[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
bool
operator&lt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L735[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&lt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L747[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&lt;&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L583[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
bool
operator&equals;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L594[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&equals;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L606[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&equals;&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L771[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
bool
operator&gt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L782[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&gt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L794[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&gt;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L818[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
constexpr
bool
operator&gt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Compare two decode views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L829[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&gt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L841[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
friend
constexpr
bool
operator&gt;&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Percent&hyphen;encoding options

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encoding_opts.hpp#L31[boost&sol;url&sol;encoding&lowbar;opts&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct encoding&lowbar;opts;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-encoding_opts-2constructor,`encoding&lowbar;opts`>>         [.small]#[constructor]#
| Constructs an `encoding&lowbar;opts` object with the specified options&period;

|===
== Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-encoding_opts-disallow_null,`disallow&lowbar;null`>> 
| True if nulls are not allowed

| <<boost-urls-encoding_opts-lower_case,`lower&lowbar;case`>> 
| True if hexadecimal digits are emitted as lower case

| <<boost-urls-encoding_opts-space_as_plus,`space&lowbar;as&lowbar;plus`>> 
| True if spaces encode to and from plus signs

|===



== Description


These options are used to customize    the behavior of algorithms which use    percent escapes, such as encoding    or decoding&period;



== See Also


xref:#boost-urls-encode-04[encode],        xref:#boost-urls-encoded_size[encoded&lowbar;size],        xref:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]&period;





Constructs an `encoding&lowbar;opts` object with the specified options&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encoding_opts.hpp#L76[boost&sol;url&sol;encoding&lowbar;opts&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
encoding&lowbar;opts(
    bool const space&lowbar;as&lowbar;plus = false,
    bool const lower&lowbar;case = false,
    bool const disallow&lowbar;null = false) noexcept;
----

== Parameters


|===
| Name | Description

| *space&lowbar;as&lowbar;plus*
| If true, spaces will be encoded as plus signs&period;


| *lower&lowbar;case*
| If true, hexadecimal digits will be emitted as lower case&period;


| *disallow&lowbar;null*
| If true, null characters will not be allowed&period;


|===


True if nulls are not allowed

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encoding_opts.hpp#L68[boost&sol;url&sol;encoding&lowbar;opts&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool disallow&lowbar;null = false;
----

== Description


Normally all possible character values        (from 0 to 255) are allowed, with reserved        characters being replaced with escapes        upon encoding&period; When this option is true,        attempting to decode a null will result        in an error&period;




True if hexadecimal digits are emitted as lower case

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encoding_opts.hpp#L57[boost&sol;url&sol;encoding&lowbar;opts&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool lower&lowbar;case = false;
----

== Description


By default, percent&hyphen;encoding algorithms        emit hexadecimal digits A through F as        uppercase letters&period; When this option is        `true`, lowercase letters are used&period;




True if spaces encode to and from plus signs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encoding_opts.hpp#L48[boost&sol;url&sol;encoding&lowbar;opts&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool space&lowbar;as&lowbar;plus = false;
----

== Description


This option controls whether or not        the PLUS character (&quot;&plus;&quot;) is used to        represent the SP character (&quot; &quot;) when        encoding or decoding&period;        Although not prescribed by the RFC, plus        signs are commonly treated as spaces upon        decoding when used in the query of URLs        using well known schemes such as HTTP&period;


=== Specification

* link:https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1[            application&sol;x&hyphen;www&hyphen;form&hyphen;urlencoded (w3&period;org)]




An optional parameter to determine case&hyphen;sensitivity

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ignore_case.hpp#L43[boost&sol;url&sol;ignore&lowbar;case&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ignore&lowbar;case&lowbar;param;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-ignore_case_param-2constructor,`ignore&lowbar;case&lowbar;param`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-ignore_case_param-2conversion,`operator bool`>> 
| True if an algorithm should ignore case

|===



== Description


Functions may use parameters of this type    to allow the user to optionally indicate    that comparisons should be case&hyphen;insensitive    when the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed&period;



== See Also


xref:#boost-urls-params_ref[params&lowbar;ref]





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ignore_case.hpp#L68[boost&sol;url&sol;ignore&lowbar;case&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ignore_case_param-2constructor-03,ignore&lowbar;case&lowbar;param>>() noexcept = default;
----

[.small]#<<boost-urls-ignore_case_param-2constructor-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ignore_case_param-2constructor-00,ignore&lowbar;case&lowbar;param>>(&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-ignore_case_t,ignore&lowbar;case&lowbar;t>>) noexcept;
----

[.small]#<<boost-urls-ignore_case_param-2constructor-00,_» more..._>>#

== Description


By default, comparisons are        case&hyphen;sensitive&period;


=== Example

This function performs case&hyphen;sensitive        comparisons when called with no        arguments&colon;

[,cpp]
----
void f( ignore_case_param = {} );
----



Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ignore_case.hpp#L68[boost&sol;url&sol;ignore&lowbar;case&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
ignore&lowbar;case&lowbar;param() noexcept = default;
----

== Description


By default, comparisons are        case&hyphen;sensitive&period;


=== Example

This function performs case&hyphen;sensitive        comparisons when called with no        arguments&colon;

[,cpp]
----
void f( ignore_case_param = {} );
----



Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ignore_case.hpp#L89[boost&sol;url&sol;ignore&lowbar;case&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
ignore&lowbar;case&lowbar;param(&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-ignore_case_t,ignore&lowbar;case&lowbar;t>>) noexcept;
----

== Description


Construction from xref:#boost-urls-ignore_case[ignore&lowbar;case]        indicates that comparisons should        be case&hyphen;insensitive&period;

The first parameter to this function        should be the variable        xref:#boost-urls-ignore_case[ignore&lowbar;case]&period;


=== Example

When xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed as        an argument, this function ignores        case when performing comparisons&colon;

[,cpp]
----
void f( ignore_case_param(ignore_case) );
----



True if an algorithm should ignore case

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ignore_case.hpp#L104[boost&sol;url&sol;ignore&lowbar;case&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator bool() const noexcept;
----

== Description


Values of type `ignore&lowbar;case&lowbar;param`        evaluate to true when constructed        with the constant xref:#boost-urls-ignore_case[ignore&lowbar;case]&period;        Otherwise, they are default&hyphen;constructed        and evaluate to `false`&period;




An IP version 4 style address&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L53[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ipv4&lowbar;address;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv4_address-bytes_type,`bytes&lowbar;type`>> 
| The type used to represent an address as an array of bytes

| <<boost-urls-ipv4_address-uint_type,`uint&lowbar;type`>> 
| The type used to represent an address as an unsigned integer

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv4_address-2constructor,`ipv4&lowbar;address`>>         [.small]#[constructor]#
| Construct from a string&period;

Construct from an array of bytes&period;

Construct from an unsigned integer&period;

Constructor&period;


| <<boost-urls-ipv4_address-is_loopback,`is&lowbar;loopback`>> 
| Return true if the address is a loopback address

| <<boost-urls-ipv4_address-is_multicast,`is&lowbar;multicast`>> 
| Return true if the address is a multicast address

| <<boost-urls-ipv4_address-is_unspecified,`is&lowbar;unspecified`>> 
| Return true if the address is unspecified

| <<boost-urls-ipv4_address-operator_assign,`operator&equals;`>> 
| Copy Assignment&period;

| <<boost-urls-ipv4_address-to_buffer,`to&lowbar;buffer`>> 
| Write a dotted decimal string representing the address to a buffer

| <<boost-urls-ipv4_address-to_bytes,`to&lowbar;bytes`>> 
| Return the address as bytes, in network byte order&period;

| <<boost-urls-ipv4_address-to_string,`to&lowbar;string`>> 
| Return the address as a string in dotted decimal format

| <<boost-urls-ipv4_address-to_uint,`to&lowbar;uint`>> 
| Return the address as an unsigned integer&period;

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv4_address-any,`any`>> 
| Return an address object that represents any address

| <<boost-urls-ipv4_address-broadcast,`broadcast`>> 
| Return an address object that represents the broadcast address

| <<boost-urls-ipv4_address-loopback,`loopback`>> 
| Return an address object that represents the loopback address

|===
== Static Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv4_address-max_str_len,`max&lowbar;str&lowbar;len`>> 
| The number of characters in the longest possible IPv4 string&period;

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv4_address-08friend-08,`operator!&equals;`>> 
| Return true if two addresses are not equal

| <<boost-urls-ipv4_address-08friend-07,`operator&lt;&lt;`>> 
| Format the address to an output stream&period;

| <<boost-urls-ipv4_address-08friend-01,`operator&equals;&equals;`>> 
| Return true if two addresses are equal

|===



== Description


Objects of this type are used to construct,    parse, and manipulate IP version 6 addresses&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
    
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== See Also


xref:#boost-urls-parse_ipv4_address[parse&lowbar;ipv4&lowbar;address],        xref:#boost-urls-ipv6_address[ipv6&lowbar;address]&period;





Return an address object that represents any address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L263[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
<<boost-urls-ipv4_address,ipv4&lowbar;address>>
any() noexcept;
----


Return an address object that represents the broadcast address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L281[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
<<boost-urls-ipv4_address,ipv4&lowbar;address>>
broadcast() noexcept;
----


Constructor&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L76[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ipv4_address-2constructor-0c,ipv4&lowbar;address>>() = default;
----

[.small]#<<boost-urls-ipv4_address-2constructor-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ipv4_address-2constructor-0d,ipv4&lowbar;address>>(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const&) = default;
----

[.small]#<<boost-urls-ipv4_address-2constructor-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-ipv4_address-2constructor-06,ipv4&lowbar;address>>(<<boost-urls-ipv4_address-uint_type,uint&lowbar;type>> u) noexcept;
----

[.small]#<<boost-urls-ipv4_address-2constructor-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-ipv4_address-2constructor-0b,ipv4&lowbar;address>>(<<boost-urls-ipv4_address-bytes_type,bytes&lowbar;type>> const& bytes) noexcept;
----

[.small]#<<boost-urls-ipv4_address-2constructor-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-ipv4_address-2constructor-08,ipv4&lowbar;address>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-ipv4_address-2constructor-08,_» more..._>>#

== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The integer to construct from&period;


| *bytes*
| The value to construct from&period;


| *s*
| The string to parse&period;


|===


Constructor&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L76[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
ipv4&lowbar;address() = default;
----


Constructor&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L80[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
ipv4&lowbar;address(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const&) = default;
----


Construct from an unsigned integer&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L103[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
ipv4&lowbar;address(<<boost-urls-ipv4_address-uint_type,uint&lowbar;type>> u) noexcept;
----

== Description


This function constructs an address from        the unsigned integer `u`, where the most        significant byte forms the first octet        of the resulting address&period;



== Parameters


|===
| Name | Description

| *u*
| The integer to construct from&period;


|===


Construct from an array of bytes&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L116[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
ipv4&lowbar;address(<<boost-urls-ipv4_address-bytes_type,bytes&lowbar;type>> const& bytes) noexcept;
----

== Description


This function constructs an address        from the array in `bytes`, which is        interpreted in big&hyphen;endian&period;



== Parameters


|===
| Name | Description

| *bytes*
| The value to construct from&period;


|===


Construct from a string&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L145[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
ipv4&lowbar;address(core::string&lowbar;view s);
----

== Description


This function constructs an address from        the string `s`, which must contain a valid        IPv4 address string or else an exception        is thrown&period;

[NOTE]
For a non&hyphen;throwing parse function,        use xref:#boost-urls-parse_ipv4_address[parse&lowbar;ipv4&lowbar;address]&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===

== See Also


xref:#boost-urls-parse_ipv4_address[parse&lowbar;ipv4&lowbar;address]&period;





Return true if the address is a loopback address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L224[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;loopback() const noexcept;
----


Return true if the address is a multicast address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L236[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;multicast() const noexcept;
----


Return true if the address is unspecified

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L230[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;unspecified() const noexcept;
----


Return an address object that represents the loopback address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L272[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
<<boost-urls-ipv4_address,ipv4&lowbar;address>>
loopback() noexcept;
----


Copy Assignment&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L85[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ipv4_address,ipv4&lowbar;address>>&
operator&equals;(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const&) = default;
----


Write a dotted decimal string representing the address to a buffer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L216[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
to&lowbar;buffer(
    char* dest,
    std::size&lowbar;t dest&lowbar;size) const;
----

== Description


The resulting buffer is not null&hyphen;terminated&period;



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `dest&lowbar;size &lt; ipv4&lowbar;address&colon;&colon;max&lowbar;str&lowbar;len`


|===

== Return Value


The formatted string



== Parameters


|===
| Name | Description

| *dest*
| The buffer in which to write,        which must have at least `dest&lowbar;size` space&period;


| *dest&lowbar;size*
| The size of the output buffer&period;


|===


Return the address as bytes, in network byte order&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L152[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv4_address-bytes_type,bytes&lowbar;type>>
to&lowbar;bytes() const noexcept;
----


Return the address as a string in dotted decimal format

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L194[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
to&lowbar;string(StringToken&& token = &lcub;&rcub;);
----

== Description


When called with no arguments, the        return type is `std&colon;&colon;string`&period;        Otherwise, the return type and style        of output is determined by which string        token is passed&period;


=== Example

[,cpp]
----
assert( ipv4_address(0x01020304).to_string() == "1.2.3.4" );
----

=== Complexity

Constant&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        String tokens may throw exceptions&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.2[            2&period;2&period; Text Representation of Addresses (rfc4291)]



== Return Value


The return type of the string token&period;        If the token parameter is omitted, then        a new `std&colon;&colon;string` is returned&period;        Otherwise, the function return type        is the result type of the token&period;



== Parameters


|===
| Name | Description

| *token*
| An optional string token&period;


|===


Return the address as an unsigned integer&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L158[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv4_address-uint_type,uint&lowbar;type>>
to&lowbar;uint() const noexcept;
----


The type used to represent an address as an array of bytes

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L71[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using bytes&lowbar;type = std::array&lt;unsigned char, 4&gt;;
----


The type used to represent an address as an unsigned integer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L66[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using uint&lowbar;type = std::uint&lowbar;least32&lowbar;t;
----


The number of characters in the longest possible IPv4 string&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L60[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr static
std::size&lowbar;t max&lowbar;str&lowbar;len = 15;
----

== Description


The longest ipv4 address string is &quot;255&period;255&period;255&period;255&quot;&period;




Return true if two addresses are not equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L252[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator!&equals;(
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a1,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a2) noexcept;
----


Format the address to an output stream&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L297[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr);
----

== Description


IPv4 addresses written to output streams        are written in their dotted decimal format&period;



== Parameters


|===
| Name | Description

| *os*
| The output stream&period;


| *addr*
| The address to format&period;


|===


Return true if two addresses are equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L241[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&equals;&equals;(
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a1,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a2) noexcept;
----


An IP version 6 style address&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L64[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ipv6&lowbar;address;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv6_address-bytes_type,`bytes&lowbar;type`>> 
| The type used to represent an address as an array of bytes&period;

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv6_address-2constructor,`ipv6&lowbar;address`>>         [.small]#[constructor]#
| Construct from a string&period;

Construct from an IPv4 address&period;

Construct from an array of bytes&period;

Constructor&period;


| <<boost-urls-ipv6_address-is_loopback,`is&lowbar;loopback`>> 
| Return true if the address is a loopback address

| <<boost-urls-ipv6_address-is_unspecified,`is&lowbar;unspecified`>> 
| Return true if the address is unspecified

| <<boost-urls-ipv6_address-is_v4_mapped,`is&lowbar;v4&lowbar;mapped`>> 
| Return true if the address is a mapped IPv4 address

| <<boost-urls-ipv6_address-operator_assign,`operator&equals;`>> 
| Copy Assignment

| <<boost-urls-ipv6_address-to_buffer,`to&lowbar;buffer`>> 
| Write a dotted decimal string representing the address to a buffer

| <<boost-urls-ipv6_address-to_bytes,`to&lowbar;bytes`>> 
| Return the address as bytes, in network byte order

| <<boost-urls-ipv6_address-to_string,`to&lowbar;string`>> 
| Return the address as a string&period;

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv6_address-loopback,`loopback`>> 
| Return an address object that represents the loopback address

|===
== Static Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv6_address-max_str_len,`max&lowbar;str&lowbar;len`>> 
| The number of characters in the longest possible IPv6 string&period;

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-ipv6_address-08friend-01,`operator!&equals;`>> 
| Return true if two addresses are not equal

| <<boost-urls-ipv6_address-08friend-09,`operator&lt;&lt;`>> 
| Format the address to an output stream

| <<boost-urls-ipv6_address-08friend-0d,`operator&equals;&equals;`>> 
| Return true if two addresses are equal

|===



== Description


Objects of this type are used to construct,    parse, and manipulate IP version 6 addresses&period;


=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
    
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== See Also


xref:#boost-urls-ipv4_address[ipv4&lowbar;address],        xref:#boost-urls-parse_ipv6_address[parse&lowbar;ipv6&lowbar;address]&period;





Constructor&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L103[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ipv6_address-2constructor-04,ipv6&lowbar;address>>() = default;
----

[.small]#<<boost-urls-ipv6_address-2constructor-04,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ipv6_address-2constructor-06,ipv6&lowbar;address>>(<<boost-urls-ipv6_address,ipv6&lowbar;address>> const&) = default;
----

[.small]#<<boost-urls-ipv6_address-2constructor-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv6_address-2constructor-0f,ipv6&lowbar;address>>(<<boost-urls-ipv6_address-bytes_type,bytes&lowbar;type>> const& bytes) noexcept;
----

[.small]#<<boost-urls-ipv6_address-2constructor-0f,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv6_address-2constructor-08,ipv6&lowbar;address>>(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr) noexcept;
----

[.small]#<<boost-urls-ipv6_address-2constructor-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv6_address-2constructor-00,ipv6&lowbar;address>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-ipv6_address-2constructor-00,_» more..._>>#

== Description


Default constructed objects represent        the unspecified address&period;

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[2&period;5&period;2&period; The Unspecified Address]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *bytes*
| The value to construct from&period;


| *addr*
| The address to construct from&period;


| *s*
| The string to parse&period;


|===

== See Also


xref:#boost-urls-ipv6_address-is_unspecified[is&lowbar;unspecified] 





Constructor&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L103[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
ipv6&lowbar;address() = default;
----

== Description


Default constructed objects represent        the unspecified address&period;

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[2&period;5&period;2&period; The Unspecified Address]



== See Also


xref:#boost-urls-ipv6_address-is_unspecified[is&lowbar;unspecified] 





Constructor&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L107[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
ipv6&lowbar;address(<<boost-urls-ipv6_address,ipv6&lowbar;address>> const&) = default;
----


Construct from an array of bytes&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L125[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
ipv6&lowbar;address(<<boost-urls-ipv6_address-bytes_type,bytes&lowbar;type>> const& bytes) noexcept;
----

== Description


This function constructs an address        from the array in `bytes`, which is        interpreted in big&hyphen;endian&period;



== Parameters


|===
| Name | Description

| *bytes*
| The value to construct from&period;


|===


Construct from an IPv4 address&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L141[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
ipv6&lowbar;address(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr) noexcept;
----

== Description


This function constructs an IPv6 address        from the IPv4 address `addr`&period; The resulting        address is an IPv4&hyphen;Mapped IPv6 Address&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2[2&period;5&period;5&period;2&period; IPv4&hyphen;Mapped IPv6 Address (rfc4291)]



== Parameters


|===
| Name | Description

| *addr*
| The address to construct from&period;


|===


Construct from a string&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L170[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
ipv6&lowbar;address(core::string&lowbar;view s);
----

== Description


This function constructs an address from        the string `s`, which must contain a valid        IPv6 address string or else an exception        is thrown&period;

[NOTE]
For a non&hyphen;throwing parse function,        use xref:#boost-urls-parse_ipv6_address[parse&lowbar;ipv6&lowbar;address]&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===

== See Also


xref:#boost-urls-parse_ipv6_address[parse&lowbar;ipv6&lowbar;address]&period;





Return true if the address is a loopback address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L275[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;loopback() const noexcept;
----

== Description


The unicast address 0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;1 is called        the loopback address&period; It may be used by a node        to send an IPv6 packet to itself&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3[            2&period;5&period;3&period; The Loopback Address (rfc4291)]




Return true if the address is unspecified

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L261[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;unspecified() const noexcept;
----

== Description


The address 0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0 is called the        unspecified address&period; It indicates the        absence of an address&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[            2&period;5&period;2&period; The Unspecified Address (rfc4291)]




Return true if the address is a mapped IPv4 address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L288[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;v4&lowbar;mapped() const noexcept;
----

== Description


This address type is used to represent the        addresses of IPv4 nodes as IPv6 addresses&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2[            2&period;5&period;5&period;2&period; IPv4&hyphen;Mapped IPv6 Address (rfc4291)]




Return an address object that represents the loopback address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L324[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
<<boost-urls-ipv6_address,ipv6&lowbar;address>>
loopback() noexcept;
----

== Description


The unicast address 0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;1 is called        the loopback address&period; It may be used by a node        to send an IPv6 packet to itself&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3[            2&period;5&period;3&period; The Loopback Address (rfc4291)]




Copy Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L112[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-ipv6_address,ipv6&lowbar;address>>&
operator&equals;(<<boost-urls-ipv6_address,ipv6&lowbar;address>> const&) = default;
----


Write a dotted decimal string representing the address to a buffer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L245[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
to&lowbar;buffer(
    char* dest,
    std::size&lowbar;t dest&lowbar;size) const;
----

== Description


The resulting buffer is not null&hyphen;terminated&period;



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `dest&lowbar;size &lt; ipv6&lowbar;address&colon;&colon;max&lowbar;str&lowbar;len`


|===

== Return Value


The formatted string



== Parameters


|===
| Name | Description

| *dest*
| The buffer in which to write,        which must have at least `dest&lowbar;size` space&period;


| *dest&lowbar;size*
| The size of the output buffer&period;


|===


Return the address as bytes, in network byte order

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L175[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv6_address-bytes_type,bytes&lowbar;type>>
to&lowbar;bytes() const noexcept;
----


Return the address as a string&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L222[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
to&lowbar;string(StringToken&& token);
----

== Description


The returned string does not        contain surrounding square brackets&period;

When called with no arguments, the        return type is `std&colon;&colon;string`&period;        Otherwise, the return type and style        of output is determined by which string        token is passed&period;


=== Example

[,cpp]
----
ipv6_address::bytes_type b = {{
        0, 1, 0, 2, 0, 3, 0, 4,
        0, 5, 0, 6, 0, 7, 0, 8 }};
ipv6_address a(b);
assert(a.to_string() == "1:2:3:4:5:6:7:8");
assert( ipv4_address(0x01020304).to_string() == "1.2.3.4" );
----

=== Complexity

Constant&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        String tokens may throw exceptions&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.2[            2&period;2&period; Text Representation of Addresses (rfc4291)]



== Return Value


The return type of the string token&period;        If the token parameter is omitted, then        a new `std&colon;&colon;string` is returned&period;        Otherwise, the function return type        is the result type of the token&period;



== Parameters


|===
| Name | Description

| *token*
| An optional string token&period;


|===


The type used to represent an address as an array of bytes&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L89[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using bytes&lowbar;type = std::array&lt;unsigned char, 16&gt;;
----

== Description


Octets are stored in network byte order&period;




The number of characters in the longest possible IPv6 string&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L81[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr static
std::size&lowbar;t max&lowbar;str&lowbar;len = 49;
----

== Description


The longest IPv6 address is&colon;

[,cpp]
----
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
----


== See Also


xref:#boost-urls-ipv6_address-to_buffer[to&lowbar;buffer]&period;





Return true if two addresses are not equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L304[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator!&equals;(
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a1,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a2) noexcept;
----


Format the address to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L340[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& addr);
----

== Description


This hidden friend function writes the        address to an output stream using        standard notation&period;



== Return Value


The output stream, for chaining&period;



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to&period;


| *addr*
| The address to write&period;


|===


Return true if two addresses are equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L293[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&equals;&equals;(
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a1,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a2) noexcept;
----


The type of xref:#boost-urls-no_value[no&lowbar;value]

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L30[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct no&lowbar;value&lowbar;t { /* see-below */ };
----





A query parameter

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L75[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct param;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-param-operator_ptr,`operator&hyphen;&gt;`>> 
| Arrow support

| <<boost-urls-param-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-param-2constructor,`param`>>         [.small]#[constructor]#
| Aggregate construction

Constructor


|===
== Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-param-has_value,`has&lowbar;value`>> 
| True if a value is present

| <<boost-urls-param-key,`key`>> 
| The key

| <<boost-urls-param-value,`value`>> 
| The value

|===



== Description


Objects of this type represent a single key    and value pair in a query string where a key    is always present and may be empty, while the    presence of a value is indicated by    xref:#boost-urls-param-has_value[has&lowbar;value] equal to true&period;    An empty value is distinct from no value&period;

Depending on where the object was obtained,    the strings may or may not contain percent    escapes&period;

For most usages, key comparisons are    case&hyphen;sensitive and duplicate keys in    a query are possible&period; However, it is    the authority that has final control    over how the query is interpreted&period;


=== BNF

[,cpp]
----
query-params    = query-param *( "&" query-param )
query-param     = key [ "=" value ]
key             = *qpchar
value           = *( qpchar / "=" )
----

=== Specification

* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-param_view[param&lowbar;view],        xref:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view]&period;





Arrow support

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L334[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param,param>> const*
operator&hyphen;&gt;() const noexcept;
----

== Description


This operator returns the address of the        object so that it can be used in pointer        contexts&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L191[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param,param>>&
<<boost-urls-param-operator_assign-0b,operator&equals;>>(<<boost-urls-param,param>>&& other) noexcept;
----

[.small]#<<boost-urls-param-operator_assign-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-param,param>>&
<<boost-urls-param-operator_assign-0cd,operator&equals;>>(<<boost-urls-param,param>> const&) = default;
----

[.small]#<<boost-urls-param-operator_assign-0cd,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param,param>>&
<<boost-urls-param-operator_assign-0cb,operator&equals;>>(<<boost-urls-param_view,param&lowbar;view>> const& other);
----

[.small]#<<boost-urls-param-operator_assign-0cb,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param,param>>&
<<boost-urls-param-operator_assign-03,operator&equals;>>(<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& other);
----

[.small]#<<boost-urls-param-operator_assign-03,_» more..._>>#

== Description


Upon assignment, this acquires        ownership of the members of other        via move assignment&period; The moved        from object is as if default        constructed&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== other The object to assign from&period;



== Parameters


|===
| Name | Description

| *other*
| The parameter to copy&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L191[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param,param>>&
operator&equals;(<<boost-urls-param,param>>&& other) noexcept;
----

== Description


Upon assignment, this acquires        ownership of the members of other        via move assignment&period; The moved        from object is as if default        constructed&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== other The object to assign from&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L224[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-param,param>>&
operator&equals;(<<boost-urls-param,param>> const&) = default;
----

== Description


Upon assignment, this becomes a copy        of `other`&period;


=== Postconditions

[,cpp]
----
this->key == other.key && this->value == other.value && this->has_value == other.has_value
----

=== Complexity

Linear in `other&period;key&period;size() &plus; other&period;value&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== other The object to assign from&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L303[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param,param>>&
operator&equals;(<<boost-urls-param_view,param&lowbar;view>> const& other);
----

== Description


The members of `other` are copied,        re&hyphen;using already existing string capacity&period;


=== Postconditions

[,cpp]
----
this->key == other.key && this->value == other.value && this->has_value == other.has_value
----

=== Complexity

Linear in `other&period;key&period;size() &plus; other&period;value&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The parameter to copy&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L324[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param,param>>&
operator&equals;(<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& other);
----

== Description


The members of `other` are copied,        re&hyphen;using already existing string capacity&period;


=== Postconditions

[,cpp]
----
this->key == other.key && this->value == other.value && this->has_value == other.has_value
----

=== Complexity

Linear in `other&period;key&period;size() &plus; other&period;value&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The parameter to copy&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L124[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-param-2constructor-09,param>>() = default;
----

[.small]#<<boost-urls-param-2constructor-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param-2constructor-07,param>>(<<boost-urls-param,param>>&& other) noexcept;
----

[.small]#<<boost-urls-param-2constructor-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-param-2constructor-0d,param>>(<<boost-urls-param,param>> const& other) = default;
----

[.small]#<<boost-urls-param-2constructor-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
<<boost-urls-param-2constructor-0b,param>>(
    core::string&lowbar;view key,
    OptionalString const& value);
----

[.small]#<<boost-urls-param-2constructor-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param-2constructor-0a,param>>(
    core::string&lowbar;view key,
    core::string&lowbar;view value,
    bool has&lowbar;value) noexcept;
----

[.small]#<<boost-urls-param-2constructor-0a,_» more..._>>#

== Description


Default constructed query parameters        have an empty key and no value&period;


=== Example

[,cpp]
----
param qp;
----

=== Postconditions

[,cpp]
----
this->key == "" && this->value == "" && this->has_value == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Template Parameters


|===
| Name | Description

| *OptionalString*
| An optional string        type, such as `core&colon;&colon;string&lowbar;view`,        `std&colon;&colon;nullptr`, xref:#boost-urls-no_value_t[no&lowbar;value&lowbar;t], or        `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;


|===

== Parameters


|===
| Name | Description

| *key,*
| value The key and value to set&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L277[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
param(
    core::string&lowbar;view key,
    OptionalString const& value);
----

== Description


This constructs a parameter with a key        and value&period;

No validation is performed on the strings&period;        Ownership of the key and value is acquired        by making copies&period;


=== Example

[,cpp]
----
param qp( "key", "value" );
----
[,cpp]
----
param qp( "key", optional<core::string_view>("value") );
----
[,cpp]
----
param qp( "key", boost::none );
----
[,cpp]
----
param qp( "key", nullptr );
----
[,cpp]
----
param qp( "key", no_value );
----

=== Postconditions

[,cpp]
----
this->key == key && this->value == value && this->has_value == true
----

=== Complexity

Linear in `key&period;size() &plus; value&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;



== Template Parameters


|===
| Name | Description

| *OptionalString*
| An optional string        type, such as `core&colon;&colon;string&lowbar;view`,        `std&colon;&colon;nullptr`, xref:#boost-urls-no_value_t[no&lowbar;value&lowbar;t], or        `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;


|===

== Parameters


|===
| Name | Description

| *key,*
| value The key and value to set&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L124[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
param() = default;
----

== Description


Default constructed query parameters        have an empty key and no value&period;


=== Example

[,cpp]
----
param qp;
----

=== Postconditions

[,cpp]
----
this->key == "" && this->value == "" && this->has_value == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L142[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param(<<boost-urls-param,param>>&& other) noexcept;
----

== Description


Upon construction, this acquires        ownership of the members of other        via move construction&period; The moved        from object is as if default        constructed&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== other The object to construct from&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L173[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
param(<<boost-urls-param,param>> const& other) = default;
----

== Description


Upon construction, this becomes a copy        of `other`&period;


=== Postconditions

[,cpp]
----
this->key == other.key && this->value == other.value && this->has_value == other.has_value
----

=== Complexity

Linear in `other&period;key&period;size() &plus; other&period;value&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== other The object to construct from&period;




Aggregate construction

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L341[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param(
    core::string&lowbar;view key,
    core::string&lowbar;view value,
    bool has&lowbar;value) noexcept;
----


True if a value is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L101[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool has&lowbar;value = false;
----

== Description


The presence of a value is indicated by        `has&lowbar;value &equals;&equals; true`&period;        An empty value is distinct from no value&period;




The key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L85[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string key;
----

== Description


For most usages, key comparisons are        case&hyphen;sensitive and duplicate keys in        a query are possible&period; However, it is        the authority that has final control        over how the query is interpreted&period;




The value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L93[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string value;
----

== Description


The presence of a value is indicated by        xref:#boost-urls-param-has_value[has&lowbar;value] equal to true&period;        An empty value is distinct from no value&period;




A view of a percent&hyphen;encoded query parameter

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L646[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct param&lowbar;pct&lowbar;view;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-param_pct_view-2conversion-00,`operator param`>> 
| Conversion

| <<boost-urls-param_pct_view-2conversion-0c,`operator param&lowbar;view`>> 
| Conversion to param&lowbar;view

| <<boost-urls-param_pct_view-operator_ptr,`operator&hyphen;&gt;`>> 
| Arrow support

| <<boost-urls-param_pct_view-2constructor,`param&lowbar;pct&lowbar;view`>>         [.small]#[constructor]#
| Aggregate construction

Construction

Constructor


|===
== Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-param_pct_view-has_value,`has&lowbar;value`>> 
| True if a value is present

| <<boost-urls-param_pct_view-key,`key`>> 
| The key

| <<boost-urls-param_pct_view-value,`value`>> 
| The value

|===



== Description


Objects of this type represent a single key    and value pair in a query string where a key    is always present and may be empty, while the    presence of a value is indicated by    xref:#boost-urls-param_pct_view-has_value[has&lowbar;value] equal to true&period;    An empty value is distinct from no value&period;

The strings may have percent escapes, and    offer an additional invariant&colon; they never    contain an invalid percent&hyphen;encoding&period;

For most usages, key comparisons are    case&hyphen;sensitive and duplicate keys in    a query are possible&period; However, it is    the authority that has final control    over how the query is interpreted&period;

Keys and values in this object reference    external character buffers&period;    Ownership of the buffers is not transferred&semi;    the caller is responsible for ensuring that    the assigned buffers remain valid until    they are no longer referenced&period;


=== BNF

[,cpp]
----
query-params    = query-param *( "&" query-param )
query-param     = key [ "=" value ]
key             = *qpchar
value           = *( qpchar / "=" )
----

=== Specification

* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-param[param],        xref:#boost-urls-param_view[param&lowbar;view]&period;





Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L848[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
operator <<boost-urls-param,param>>() const;
----

== Description


This function performs a conversion from        a reference&hyphen;like query parameter to one        retaining ownership of the strings by        making a copy&period;


=== Complexity

Linear in `this&hyphen;&gt;key&period;size() &plus; this&hyphen;&gt;value&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;




Conversion to param&lowbar;view

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L867[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator <<boost-urls-param_view,param&lowbar;view>>() const noexcept;
----

== Description


This function performs a conversion from        a pct&lowbar;string&lowbar;view query parameter to one        using a simple string&lowbar;view&period;


=== Exception Safety

Calls to allocate may throw&period;




Arrow support

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L881[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const*
operator&hyphen;&gt;() const noexcept;
----

== Description


This operator returns the address of the        object so that it can be used in pointer        contexts&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L697[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-param_pct_view-2constructor-00,param&lowbar;pct&lowbar;view>>() = default;
----

[.small]#<<boost-urls-param_pct_view-2constructor-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param_pct_view-2constructor-0e,param&lowbar;pct&lowbar;view>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value) noexcept;
----

[.small]#<<boost-urls-param_pct_view-2constructor-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
<<boost-urls-param_pct_view-2constructor-05,param&lowbar;pct&lowbar;view>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    OptionalString const& value);
----

[.small]#<<boost-urls-param_pct_view-2constructor-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-param_pct_view-2constructor-03,param&lowbar;pct&lowbar;view>>(<<boost-urls-param_view,param&lowbar;view>> const& p);
----

[.small]#<<boost-urls-param_pct_view-2constructor-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param_pct_view-2constructor-02,param&lowbar;pct&lowbar;view>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value,
    bool has&lowbar;value) noexcept;
----

[.small]#<<boost-urls-param_pct_view-2constructor-02,_» more..._>>#

== Description


Default constructed query parameters        have an empty key and no value&period;


=== Example

[,cpp]
----
param_pct_view qp;
----

=== Postconditions

[,cpp]
----
this->key == "" && this->value == "" && this->has_value == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` or `value` contains an invalid percent&hyphen;encoding&period;


|===

== Template Parameters


|===
| Name | Description

| *OptionalString*
| An optional        `core&colon;&colon;string&lowbar;view` type, such as        `boost&colon;&colon;optional&lt;core&colon;&colon;string&lowbar;view&gt;` or        `std&colon;&colon;optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;


|===

== Parameters


|===
| Name | Description

| *key,*
| value The key and value to set&period;


| *p*
| The param to construct from&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L783[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
param&lowbar;pct&lowbar;view(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    OptionalString const& value);
----

== Description


This constructs a parameter with a key        and optional value, which may both        contain percent escapes&period;

The new key and value reference        the same corresponding underlying        character buffers&period;

Ownership of the buffers is not transferred&semi;        the caller is responsible for ensuring that        the assigned buffers remain valid until        they are no longer referenced&period;


=== Example

[,cpp]
----
param_pct_view qp( "key", optional<core::string_view>("value") );
----

=== Postconditions

[,cpp]
----
this->key.data() == key.data() && this->value->data() == value->data() && this->has_value == true
----

=== Complexity

Linear in `key&period;size() &plus; value&hyphen;&gt;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` or `value` contains an invalid percent&hyphen;encoding&period;


|===

== Template Parameters


|===
| Name | Description

| *OptionalString*
| An optional        `core&colon;&colon;string&lowbar;view` type, such as        `boost&colon;&colon;optional&lt;core&colon;&colon;string&lowbar;view&gt;` or        `std&colon;&colon;optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;


|===

== Parameters


|===
| Name | Description

| *key,*
| value The key and value to set&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L697[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
param&lowbar;pct&lowbar;view() = default;
----

== Description


Default constructed query parameters        have an empty key and no value&period;


=== Example

[,cpp]
----
param_pct_view qp;
----

=== Postconditions

[,cpp]
----
this->key == "" && this->value == "" && this->has_value == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L733[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param&lowbar;pct&lowbar;view(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value) noexcept;
----

== Description


This constructs a parameter with a key        and value, which may both contain percent        escapes&period;        The new key and value reference        the same corresponding underlying        character buffers&period;        Ownership of the buffers is not transferred&semi;        the caller is responsible for ensuring that        the assigned buffers remain valid until        they are no longer referenced&period;


=== Example

[,cpp]
----
param_pct_view qp( "key", "value" );
----

=== Postconditions

[,cpp]
----
this->key.data() == key.data() && this->value.data() == value.data() && this->has_value == true
----

=== Complexity

Linear in `key&period;size() &plus; value&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` or `value` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *key,*
| value The key and value to set&period;


|===


Construction

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L824[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
param&lowbar;pct&lowbar;view(<<boost-urls-param_view,param&lowbar;view>> const& p);
----

== Description


This converts a param which may        contain unvalidated percent&hyphen;escapes into        a param whose key and value are        guaranteed to contain strings with no        invalid percent&hyphen;escapes, otherwise        an exception is thrown&period;

The new key and value reference        the same corresponding underlying        character buffers&period;        Ownership of the buffers is not transferred&semi;        the caller is responsible for ensuring that        the assigned buffers remain valid until        they are no longer referenced&period;


=== Example

[,cpp]
----
param_pct_view qp( param_view( "key", "value" ) );
----

=== Complexity

Linear in `key&period;size() &plus; value&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` or `value` contains an invalid percent escape&period;


|===

== Parameters


|===
| Name | Description

| *p*
| The param to construct from&period;


|===


Aggregate construction

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L888[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param&lowbar;pct&lowbar;view(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value,
    bool has&lowbar;value) noexcept;
----


True if a value is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L672[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool has&lowbar;value = false;
----

== Description


The presence of a value is indicated by        `has&lowbar;value &equals;&equals; true`&period;        An empty value is distinct from no value&period;




The key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L656[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key;
----

== Description


For most usages, key comparisons are        case&hyphen;sensitive and duplicate keys in        a query are possible&period; However, it is        the authority that has final control        over how the query is interpreted&period;




The value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L664[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value;
----

== Description


The presence of a value is indicated by        xref:#boost-urls-param_pct_view-has_value[has&lowbar;value] equal to true&period;        An empty value is distinct from no value&period;




A view of a query parameter

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L408[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct param&lowbar;view;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-param_view-2conversion,`operator param`>> 
| Conversion

| <<boost-urls-param_view-operator_ptr,`operator&hyphen;&gt;`>> 
| Arrow support

| <<boost-urls-param_view-2constructor,`param&lowbar;view`>>         [.small]#[constructor]#
| Aggregate construction

Constructor


|===
== Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-param_view-has_value,`has&lowbar;value`>> 
| True if a value is present

| <<boost-urls-param_view-key,`key`>> 
| The key

| <<boost-urls-param_view-value,`value`>> 
| The value

|===



== Description


Objects of this type represent a single key    and value pair in a query string where a key    is always present and may be empty, while the    presence of a value is indicated by    xref:#boost-urls-param_view-has_value[has&lowbar;value] equal to true&period;    An empty value is distinct from no value&period;

Depending on where the object was obtained,    the strings may or may not contain percent    escapes&period;

For most usages, key comparisons are    case&hyphen;sensitive and duplicate keys in    a query are possible&period; However, it is    the authority that has final control    over how the query is interpreted&period;

Keys and values in this object reference    external character buffers&period;    Ownership of the buffers is not transferred&semi;    the caller is responsible for ensuring that    the assigned buffers remain valid until    they are no longer referenced&period;


=== BNF

[,cpp]
----
query-params    = query-param *( "&" query-param )
query-param     = key [ "=" value ]
key             = *qpchar
value           = *( qpchar / "=" )
----

=== Specification

* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-param[param],        xref:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view]&period;





Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L558[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
operator <<boost-urls-param,param>>();
----

== Description


This function performs a conversion from        a reference&hyphen;like query parameter to one        retaining ownership of the strings by        making a copy&period;        No validation is performed on the strings&period;


=== Complexity

Linear in `this&hyphen;&gt;key&period;size() &plus; this&hyphen;&gt;value&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;




Arrow support

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L572[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param_view,param&lowbar;view>> const*
operator&hyphen;&gt;() const noexcept;
----

== Description


This operator returns the address of the        object so that it can be used in pointer        contexts&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L459[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-param_view-2constructor-07a,param&lowbar;view>>() = default;
----

[.small]#<<boost-urls-param_view-2constructor-07a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
<<boost-urls-param_view-2constructor-01,param&lowbar;view>>(
    core::string&lowbar;view key,
    OptionalString const& value) noexcept;
----

[.small]#<<boost-urls-param_view-2constructor-01,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param_view-2constructor-07e,param&lowbar;view>>(<<boost-urls-param,param>> const& other) noexcept;
----

[.small]#<<boost-urls-param_view-2constructor-07e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-param_view-2constructor-03,param&lowbar;view>>(
    core::string&lowbar;view key&lowbar;,
    core::string&lowbar;view value&lowbar;,
    bool has&lowbar;value&lowbar;) noexcept;
----

[.small]#<<boost-urls-param_view-2constructor-03,_» more..._>>#

== Description


Default constructed query parameters        have an empty key and no value&period;


=== Example

[,cpp]
----
param_view qp;
----

=== Postconditions

[,cpp]
----
this->key == "" && this->value == "" && this->has_value == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Template Parameters


|===
| Name | Description

| *OptionalString*
| An optional string        type, such as `core&colon;&colon;string&lowbar;view`,        `std&colon;&colon;nullptr`, xref:#boost-urls-no_value_t[no&lowbar;value&lowbar;t], or        `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;


|===

== Parameters


|===
| Name | Description

| *key,*
| value The key and value to set&period;


| *other*
| The param to reference


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L497[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
param&lowbar;view(
    core::string&lowbar;view key,
    OptionalString const& value) noexcept;
----

== Description


This constructs a parameter with a key        and value&period;        No validation is performed on the strings&period;        The new key and value reference        the same corresponding underlying        character buffers&period;        Ownership of the buffers is not transferred&semi;        the caller is responsible for ensuring that        the assigned buffers remain valid until        they are no longer referenced&period;


=== Example

[,cpp]
----
param_view qp( "key", "value" );
----

=== Postconditions

[,cpp]
----
this->key.data() == key.data() && this->value.data() == value.data() && this->has_value == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Template Parameters


|===
| Name | Description

| *OptionalString*
| An optional string        type, such as `core&colon;&colon;string&lowbar;view`,        `std&colon;&colon;nullptr`, xref:#boost-urls-no_value_t[no&lowbar;value&lowbar;t], or        `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;


|===

== Parameters


|===
| Name | Description

| *key,*
| value The key and value to set&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L459[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
param&lowbar;view() = default;
----

== Description


Default constructed query parameters        have an empty key and no value&period;


=== Example

[,cpp]
----
param_view qp;
----

=== Postconditions

[,cpp]
----
this->key == "" && this->value == "" && this->has_value == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L535[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param&lowbar;view(<<boost-urls-param,param>> const& other) noexcept;
----

== Description


This function constructs a param        which references the character buffers        representing the key and value in another        container&period;        Ownership of the buffers is not transferred&semi;        the caller is responsible for ensuring that        the assigned buffers remain valid until        they are no longer referenced&period;


=== Example

[,cpp]
----
param qp( "key", "value" );
param_view qpv( qp );
----

=== Postconditions

[,cpp]
----
this->key == key && this->value == value && this->has_value == other.has_value
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The param to reference


|===


Aggregate construction

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L579[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param&lowbar;view(
    core::string&lowbar;view key&lowbar;,
    core::string&lowbar;view value&lowbar;,
    bool has&lowbar;value&lowbar;) noexcept;
----


True if a value is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L434[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool has&lowbar;value = false;
----

== Description


The presence of a value is indicated by        `has&lowbar;value &equals;&equals; true`&period;        An empty value is distinct from no value&period;




The key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L418[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view key;
----

== Description


For most usages, key comparisons are        case&hyphen;sensitive and duplicate keys in        a query are possible&period; However, it is        the authority that has final control        over how the query is interpreted&period;




The value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L426[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view value;
----

== Description


The presence of a value is indicated by        xref:#boost-urls-param_view-has_value[has&lowbar;value] equal to true&period;        An empty value is distinct from no value&period;




Common functionality for containers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L46[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class params&lowbar;base;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-params_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-params_base-iterator,`iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_base-reference,`reference`>> 
| The reference type

| <<boost-urls-params_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type to represent sizes&period;

| <<boost-urls-params_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-params_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-params_base-contains,`contains`>> 
| Return true if a matching key exists

| <<boost-urls-params_base-count,`count`>> 
| Return the number of matching keys

| <<boost-urls-params_base-empty,`empty`>> 
| Return true if there are no params

| <<boost-urls-params_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-params_base-find,`find`>> 
| Find a matching key


| <<boost-urls-params_base-find_last,`find&lowbar;last`>> 
| Find a matching key


| <<boost-urls-params_base-size,`size`>> 
| Return the number of params

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


This base class is used by the library    to provide common member functions for    containers&period; This cannot be instantiated    directly&semi; Instead, use one of the    containers or functions&colon;


=== Containers

* params&lowbar;ref
    
* params&lowbar;view
    
* params&lowbar;encoded&lowbar;ref
    
* params&lowbar;encoded&lowbar;view




A Bidirectional iterator to a query parameter

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L95[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----




== Description


Objects of this type allow iteration        through the parameters in the query&period;        Any percent&hyphen;escapes in returned strings        are decoded first&period;        The values returned are read&hyphen;only&semi;        changes to parameters must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators are        dereferenced belong to the iterator and        become invalidated when that particular        iterator is incremented, decremented,        or destroyed&period;

[NOTE]
The implementation may use temporary,        recycled storage to store decoded        strings&period; These iterators are meant        to be used ephemerally&period; That is, for        short durations such as within a        function scope&period; Do not store        iterators with static storage        duration or as long&hyphen;lived objects&period;




Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L221[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
begin() const noexcept;
----

== Description



=== Complexity

Linear in the size of the first param&period;


=== Exception Safety

Throws nothing&period;




Return the referenced character buffer&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L178[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
buffer() const noexcept;
----

== Description


This function returns the character        buffer referenced by the view&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).params().buffer() == "?first=John&last=Doe" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return true if a matching key exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L265[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
contains(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find a match for        the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).params().contains( "first" ) );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Return the number of matching keys

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L299[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
count(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the        parameters in the container to        find the number of matches for        the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).params().count( "first" ) == 1 );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Return true if there are no params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L194[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( ! url_view( "?key=value" ).params().empty() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L232[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
end() const noexcept;
----

== Description



=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L344[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_base-find-09,find>>(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_base-find-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_base-find-04,find>>(
    <<boost-urls-params_base-iterator,iterator>> from,
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_base-find-04,_» more..._>>#

== Description


This function examines the parameters        in the container to find a match for        the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the first param        and proceeds forward until either the        key is found or the end of the range is        reached, in which case `end()` is        returned&period;


=== Example

[,cpp]
----
assert( (*url_view( "?first=John&last=Doe" ).params().find( "First", ignore_case )).value == "John" );
----

=== Effects

[,cpp]
----
return this->find( this->begin(), key, ic );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;



== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


| *from*
| The position to begin the            search from&period; This can be `end()`&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L344[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
find(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find a match for        the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the first param        and proceeds forward until either the        key is found or the end of the range is        reached, in which case `end()` is        returned&period;


=== Example

[,cpp]
----
assert( (*url_view( "?first=John&last=Doe" ).params().find( "First", ignore_case )).value == "John" );
----

=== Effects

[,cpp]
----
return this->find( this->begin(), key, ic );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;



== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L389[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
find(
    <<boost-urls-params_base-iterator,iterator>> from,
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the        parameters in the container to        find a match for the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts at `from`        and proceeds forward until either the        key is found or the end of the range is        reached, in which case `end()` is        returned&period;


=== Example

[,cpp]
----
url_view u( "?First=John&Last=Doe" );

assert( u.params().find( "first" ) != u.params().find( "first", ignore_case ) );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;



== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *from*
| The position to begin the            search from&period; This can be `end()`&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L430[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_base-find_last-04,find&lowbar;last>>(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_base-find_last-04,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_base-find_last-0d,find&lowbar;last>>(
    <<boost-urls-params_base-iterator,iterator>> before,
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_base-find_last-0d,_» more..._>>#

== Description


This function examines the        parameters in the container to        find a match for the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the last param        and proceeds backwards until either the        key is found or the beginning of the        range is reached, in which case `end()`        is returned&period;


=== Example

[,cpp]
----
assert( (*url_view( "?first=John&last=Doe" ).params().find_last( "last" )).value == "Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;



== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


| *before*
| One past the position        to begin the search from&period; This can        be `end()`&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L430[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
find&lowbar;last(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the        parameters in the container to        find a match for the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the last param        and proceeds backwards until either the        key is found or the beginning of the        range is reached, in which case `end()`        is returned&period;


=== Example

[,cpp]
----
assert( (*url_view( "?first=John&last=Doe" ).params().find_last( "last" )).value == "Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;



== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L476[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
find&lowbar;last(
    <<boost-urls-params_base-iterator,iterator>> before,
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the        parameters in the container to        find a match for the specified key&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts prior to `before`        and proceeds backwards until either the        key is found or the beginning of the        range is reached, in which case `end()`        is returned&period;


=== Example

[,cpp]
----
url_view u( "?First=John&Last=Doe" );

assert( u.params().find_last( "last" ) != u.params().find_last( "last", ignore_case ) );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;



== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *before*
| One past the position        to begin the search from&period; This can        be `end()`&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Return the maximum number of characters possible

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L152[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
static
std::size&lowbar;t
max&lowbar;size() noexcept;
----

== Description


This represents the largest number of        characters that are possible in a path,        not including any null terminator&period;


=== Exception Safety

Throws nothing&period;




Return the number of params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L210[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
size() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( url_view( "?key=value").params().size() == 1 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




A Bidirectional iterator to a query parameter

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L98[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = <<boost-urls-params_base-iterator,iterator>>;
----

== Description


Objects of this type allow iteration        through the parameters in the query&period;        Any percent&hyphen;escapes in returned strings        are decoded first&period;        The values returned are read&hyphen;only&semi;        changes to parameters must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators are        dereferenced belong to the iterator and        become invalidated when that particular        iterator is incremented, decremented,        or destroyed&period;

[NOTE]
The implementation may use temporary,        recycled storage to store decoded        strings&period; These iterators are meant        to be used ephemerally&period; That is, for        short durations such as within a        function scope&period; Do not store        iterators with static storage        duration or as long&hyphen;lived objects&period;




The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L127[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = <<boost-urls-param,param>>;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;



== See Also


xref:#boost-urls-param_view[param&lowbar;view]&period;





A signed integer type used to represent differences&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L135[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using difference&lowbar;type = std::ptrdiff&lowbar;t;
----


The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L124[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = <<boost-urls-param,param>>;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;



== See Also


xref:#boost-urls-param_view[param&lowbar;view]&period;





An unsigned integer type to represent sizes&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L131[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using size&lowbar;type = std::size&lowbar;t;
----


The value type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L114[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = <<boost-urls-param,param>>;
----

== Description


Values of this type represent parameters        whose strings retain unique ownership by        making a copy&period;


=== Example

[,cpp]
----
params_view::value_type qp( *url_view( "?first=John&last=Doe" ).params().find( "first" ) );
----


== See Also


xref:#boost-urls-param[param]&period;





Common functionality for containers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L38[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class params&lowbar;encoded&lowbar;base;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_encoded_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-params_encoded_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-params_encoded_base-iterator,`iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_encoded_base-reference,`reference`>> 
| The reference type

| <<boost-urls-params_encoded_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type to represent sizes&period;

| <<boost-urls-params_encoded_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-params_encoded_base-buffer,`buffer`>> 
| Return the query corresponding to these params

| <<boost-urls-params_encoded_base-contains,`contains`>> 
| Return true if a matching key exists

| <<boost-urls-params_encoded_base-count,`count`>> 
| Return the number of matching keys

| <<boost-urls-params_encoded_base-empty,`empty`>> 
| Return true if there are no params

| <<boost-urls-params_encoded_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-params_encoded_base-find,`find`>> 
| Find a matching key


| <<boost-urls-params_encoded_base-find_last,`find&lowbar;last`>> 
| Find a matching key


| <<boost-urls-params_encoded_base-size,`size`>> 
| Return the number of params

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


This base class is used by the library    to provide common member functions for    containers&period; This cannot be instantiated    directly&semi; Instead, use one of the    containers or functions&colon;


=== Containers

* params&lowbar;ref
    
* params&lowbar;view
    
* params&lowbar;encoded&lowbar;ref
    
* params&lowbar;encoded&lowbar;view




A Bidirectional iterator to a query parameter

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L103[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----




== Description


Objects of this type allow iteration        through the parameters in the query&period;        Strings returned by iterators may        contain percent escapes&period;        The values returned are read&hyphen;only&semi;        changes to parameters must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators        are dereferenced refer to the underlying        character buffer&period;        Ownership is not transferred&semi; the caller        is responsible for ensuring that the        lifetime of the buffer extends until        it is no longer referenced by any        container or iterator&period;




Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L242[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
begin() const noexcept;
----

== Description



=== Complexity

Linear in the size of the first param&period;


=== Exception Safety

Throws nothing&period;




Return the query corresponding to these params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L199[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
buffer() const noexcept;
----

== Description


This function returns the query string        referenced by the container&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).encoded_params().buffer() == "first=John&last=Doe" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query-params    = query-param *( "&" query-param )
query-param     = key [ "=" value ]
key             = *qpchar
value           = *( qpchar / "=" )
----

=== Specification

* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]




Return true if a matching key exists

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L290[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
contains(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find a match for        the specified key,        which may contain percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).encoded_params().contains( "first" ) );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Return the number of matching keys

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L327[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
count(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find the number of        matches for the specified key,        which may contain percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).encoded_params().count( "first" ) == 1 );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Return true if there are no params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L215[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( ! url_view( "?key=value" ).encoded_params().empty() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L253[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
end() const noexcept;
----

== Description



=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L379[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_base-find-03,find>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_encoded_base-find-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_base-find-00,find>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> from,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_encoded_base-find-00,_» more..._>>#

== Description


This function examines the parameters        in the container to find a match for        the specified key,        which may contain percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the first param        and proceeds forward until either the        key is found or the end of the range is        reached, in which case `end()` is        returned&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).encoded_params().find( "First", ignore_case )->value == "John" );
----

=== Effects

[,cpp]
----
return this->find( this->begin(), key, ic );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


| *from*
| The position to begin the            search from&period; This can be `end()`&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L379[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
find(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find a match for        the specified key,        which may contain percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the first param        and proceeds forward until either the        key is found or the end of the range is        reached, in which case `end()` is        returned&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).encoded_params().find( "First", ignore_case )->value == "John" );
----

=== Effects

[,cpp]
----
return this->find( this->begin(), key, ic );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L431[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
find(
    <<boost-urls-params_encoded_base-iterator,iterator>> from,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find a match for        the specified key, which may contain        percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts at `from`        and proceeds forward until either the        key is found or the end of the range is        reached, in which case `end()` is        returned&period;


=== Example

[,cpp]
----
url_view u( "?First=John&Last=Doe" );

assert( u.encoded_params().find( "first" ) != u.encoded_params().find( "first", ignore_case ) );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *from*
| The position to begin the            search from&period; This can be `end()`&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L479[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_base-find_last-05,find&lowbar;last>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_encoded_base-find_last-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_base-find_last-0d,find&lowbar;last>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

[.small]#<<boost-urls-params_encoded_base-find_last-0d,_» more..._>>#

== Description


This function examines the parameters        in the container to find a match for        the specified key, which may contain        percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the last param        and proceeds backwards until either the        key is found or the beginning of the        range is reached, in which case `end()`        is returned&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).encoded_params().find_last( "last" )->value == "Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


| *before*
| One past the position        to begin the search from&period; This can        be `end()`&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L479[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
find&lowbar;last(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find a match for        the specified key, which may contain        percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts from the last param        and proceeds backwards until either the        key is found or the beginning of the        range is reached, in which case `end()`        is returned&period;


=== Example

[,cpp]
----
assert( url_view( "?first=John&last=Doe" ).encoded_params().find_last( "last" )->value == "Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Find a matching key

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L526[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
find&lowbar;last(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) const noexcept;
----

== Description


This function examines the parameters        in the container to find a match for        the specified key, which may contain        percent escapes&period;        The comparison is performed as if all        escaped characters were decoded first&period;

The search starts prior to `before`        and proceeds backwards until either the        key is found or the beginning of the        range is reached, in which case `end()`        is returned&period;


=== Example

[,cpp]
----
url_view u( "?First=John&Last=Doe" );

assert( u.encoded_params().find_last( "last" ) != u.encoded_params().find_last( "last", ignore_case ) );
----

=== Complexity

Linear in `this&hyphen;&gt;buffer()&period;size()`&period;



== Return Value


an iterator to the param



== Parameters


|===
| Name | Description

| *before*
| One past the position        to begin the search from&period; This can        be `end()`&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Return the maximum number of characters possible

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L161[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
static
std::size&lowbar;t
max&lowbar;size() noexcept;
----

== Description


This represents the largest number of        characters that are possible in a path,        not including any null terminator&period;


=== Exception Safety

Throws nothing&period;




Return the number of params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L231[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
size() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( url_view( "?key=value").encoded_params().size() == 1 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




A Bidirectional iterator to a query parameter

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L107[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = <<boost-urls-params_encoded_base-iterator,iterator>>;
----

== Description


Objects of this type allow iteration        through the parameters in the query&period;        Strings returned by iterators may        contain percent escapes&period;        The values returned are read&hyphen;only&semi;        changes to parameters must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators        are dereferenced refer to the underlying        character buffer&period;        Ownership is not transferred&semi; the caller        is responsible for ensuring that the        lifetime of the buffer extends until        it is no longer referenced by any        container or iterator&period;




The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L136[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = <<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;



== See Also


xref:#boost-urls-param_view[param&lowbar;view]&period;





A signed integer type used to represent differences&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L144[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using difference&lowbar;type = std::ptrdiff&lowbar;t;
----


The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L133[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = <<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;



== See Also


xref:#boost-urls-param_view[param&lowbar;view]&period;





An unsigned integer type to represent sizes&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L140[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using size&lowbar;type = std::size&lowbar;t;
----


The value type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L123[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = <<boost-urls-param,param>>;
----

== Description


Values of this type represent parameters        whose strings retain unique ownership by        making a copy&period;


=== Example

[,cpp]
----
params_encoded_view::value_type qp( *url_view( "?first=John&last=Doe" ).params().find( "first" ) );
----


== See Also


xref:#boost-urls-param[param]&period;





A view representing query parameters in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L73[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class params&lowbar;encoded&lowbar;ref
    : public <<boost-urls-params_encoded_base,params&lowbar;encoded&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_encoded_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-params_encoded_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-params_encoded_base-iterator,`iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_encoded_base-reference,`reference`>> 
| The reference type

| <<boost-urls-params_encoded_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type to represent sizes&period;

| <<boost-urls-params_encoded_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_ref-append,`append`>> 
| Append params


| <<boost-urls-params_encoded_ref-assign,`assign`>> 
| Assign params


| <<boost-urls-params_encoded_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-params_encoded_base-buffer,`buffer`>> 
| Return the query corresponding to these params

| <<boost-urls-params_encoded_ref-clear,`clear`>> 
| Clear the contents of the container

| <<boost-urls-params_encoded_base-contains,`contains`>> 
| Return true if a matching key exists

| <<boost-urls-params_encoded_base-count,`count`>> 
| Return the number of matching keys

| <<boost-urls-params_encoded_base-empty,`empty`>> 
| Return true if there are no params

| <<boost-urls-params_encoded_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-params_encoded_ref-erase,`erase`>> 
| Erase params


| <<boost-urls-params_encoded_base-find,`find`>> 
| Find a matching key


| <<boost-urls-params_encoded_base-find_last,`find&lowbar;last`>> 
| Find a matching key


| <<boost-urls-params_encoded_ref-insert,`insert`>> 
| Insert params


| <<boost-urls-params_encoded_ref-2conversion,`operator params&lowbar;encoded&lowbar;view`>> 
| Conversion

| <<boost-urls-params_encoded_ref-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-params_encoded_ref-2constructor-01,`params&lowbar;encoded&lowbar;ref`>>         [.small]#[constructor]#
| Constructor

| <<boost-urls-params_encoded_ref-replace,`replace`>> 
| Replace params


| <<boost-urls-params_encoded_ref-set,`set`>> 
| Set a value


| <<boost-urls-params_encoded_base-size,`size`>> 
| Return the number of params

| <<boost-urls-params_encoded_ref-unset,`unset`>> 
| Remove the value on an element

| <<boost-urls-params_encoded_ref-url,`url`>> 
| Return the referenced url

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


Objects of this type are used to interpret    the query parameters as a bidirectional view    of key value pairs&period;

The view does not retain ownership of the    elements and instead references the original    url&period; The caller is responsible for ensuring    that the lifetime of the referenced url    extends until it is no longer referenced&period;

The view is modifiable&semi; calling non&hyphen;const    members causes changes to the referenced    url&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

params_encoded_ref p = u.encoded_params();
----
Strings produced when elements are returned    have type xref:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view] and represent    encoded strings&period; Strings passed to member    functions may contain percent escapes, and    throw exceptions on invalid inputs&period;


=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;    Modifications made through the container    invalidate some iterators to the underlying    character buffer&colon;

* append
 &colon; Only 
`end()`
&period;    
* assign
, 
clear
,        
`operator&equals;`
 &colon; All params&period;    
* erase
 &colon; Erased params and all        params after (including 
`end()`
)&period;
    
* insert
 &colon; All params at or after        the insertion point (including 
`end()`
)&period;
    
* replace
, 
set
 &colon; Modified        params and all params
        after (including 
`end()`
)&period;




Append params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L362[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-append-07,append>>(<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& p);
----

[.small]#<<boost-urls-params_encoded_ref-append-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-append-0e,append>>(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_encoded_ref-append-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-append-08,append>>(
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_encoded_ref-append-08,_» more..._>>#

== Description


This function appends a param to the view&period;

The `end()` iterator is invalidated&period;


=== Example

[,cpp]
----
url u;

u.encoded_params().append( { "first", "John" } );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the new element&period;



== Parameters


|===
| Name | Description

| *p*
| The param to append&period;


| *init*
| The list of params to append&period;


| *first,*
| last The range of params        to append&period;


|===


Append params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L435[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
append(
    FwdIt first,
    FwdIt last);
----

== Description


This function appends a range of params        to the view&period;

The `end()` iterator is invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first new element&period;



== Parameters


|===
| Name | Description

| *first,*
| last The range of params        to append&period;


|===


Append params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L362[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
append(<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& p);
----

== Description


This function appends a param to the view&period;

The `end()` iterator is invalidated&period;


=== Example

[,cpp]
----
url u;

u.encoded_params().append( { "first", "John" } );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the new element&period;



== Parameters


|===
| Name | Description

| *p*
| The param to append&period;


|===


Append params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L396[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
append(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

== Description


This function appends the params in        an _initializer&hyphen;list_ to the view&period;

The `end()` iterator is invalidated&period;


=== Example

[,cpp]
----
url u;

u.encoded_params().append({ {"first", "John"}, {"last", "Doe"} });
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first new element&period;



== Parameters


|===
| Name | Description

| *init*
| The list of params to append&period;


|===


Assign params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L289[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
<<boost-urls-params_encoded_ref-assign-00,assign>>(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_encoded_ref-assign-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-params_encoded_ref-assign-07,assign>>(
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_encoded_ref-assign-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-params_encoded_ref-assign-07,assign>>(
    FwdIt first,
    FwdIt last,
    std::forward&lowbar;iterator&lowbar;tag);
----

[.small]#<<boost-urls-params_encoded_ref-assign-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-params_encoded_ref-assign-07,assign>>(
    FwdIt first,
    FwdIt last,
    std::input&lowbar;iterator&lowbar;tag) = delete;
----

[.small]#<<boost-urls-params_encoded_ref-assign-07,_» more..._>>#

== Description


This function replaces the entire        contents of the view with the params        in the _initializer&hyphen;list_&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u;

u.encoded_params().assign({ { "first", "John" }, { "last", "Doe" } });
----

=== Complexity

Linear in `init&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *init*
| The list of params to assign&period;


| *first,*
| last The range of params        to assign&period;


|===


Assign params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L327[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
assign(
    FwdIt first,
    FwdIt last);
----

== Description


This function replaces the entire        contents of the view with the params        in the range&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true
----

=== Complexity

Linear in the size of the range&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *first,*
| last The range of params        to assign&period;


|===


Assign params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L289[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
assign(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

== Description


This function replaces the entire        contents of the view with the params        in the _initializer&hyphen;list_&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u;

u.encoded_params().assign({ { "first", "John" }, { "last", "Doe" } });
----

=== Complexity

Linear in `init&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *init*
| The list of params to assign&period;


|===


Clear the contents of the container

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L250[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
clear() noexcept;
----

== Description


All iterators are invalidated&period;


=== Effects

[,cpp]
----
this->url().remove_query();
----

=== Postconditions

[,cpp]
----
this->empty() == true && this->url().has_query() == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Erase params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L597[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-erase-08,erase>>(<<boost-urls-params_encoded_base-iterator,iterator>> pos) noexcept;
----

[.small]#<<boost-urls-params_encoded_ref-erase-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-erase-0b,erase>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> first,
    <<boost-urls-params_encoded_base-iterator,iterator>> last) noexcept;
----

[.small]#<<boost-urls-params_encoded_ref-erase-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
<<boost-urls-params_encoded_ref-erase-00,erase>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) noexcept;
----

[.small]#<<boost-urls-params_encoded_ref-erase-00,_» more..._>>#

== Description


This function removes an element from        the container&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

params_encoded_ref::iterator it = u.encoded_params().erase( u.encoded_params().begin() );

assert( u.encoded_query() == "last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to one past        the removed element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *first,*
| last The range of        params to erase&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Erase params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L597[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
erase(<<boost-urls-params_encoded_base-iterator,iterator>> pos) noexcept;
----

== Description


This function removes an element from        the container&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

params_encoded_ref::iterator it = u.encoded_params().erase( u.encoded_params().begin() );

assert( u.encoded_query() == "last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


|===


Erase params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L621[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
erase(
    <<boost-urls-params_encoded_base-iterator,iterator>> first,
    <<boost-urls-params_encoded_base-iterator,iterator>> last) noexcept;
----

== Description


This function removes a range of params        from the container&period;

All iterators that are equal to        `first` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed range&period;



== Parameters


|===
| Name | Description

| *first,*
| last The range of        params to erase&period;


|===


Erase params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L657[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
erase(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) noexcept;
----

== Description


All iterators are invalidated&period;


=== Postconditions

[,cpp]
----
this->count( key, ic ) == 0
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


The number of params removed        from the container&period;



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Insert params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L471[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-insert-03,insert>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    <<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& p);
----

[.small]#<<boost-urls-params_encoded_ref-insert-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-insert-0b,insert>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_encoded_ref-insert-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-insert-05,insert>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_encoded_ref-insert-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-insert-05,insert>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::forward&lowbar;iterator&lowbar;tag);
----

[.small]#<<boost-urls-params_encoded_ref-insert-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-insert-05,insert>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::input&lowbar;iterator&lowbar;tag) = delete;
----

[.small]#<<boost-urls-params_encoded_ref-insert-05,_» more..._>>#

== Description


This function inserts a param        before the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the inserted        element&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the param is inserted&period; This may        be equal to `end()`&period;


| *p*
| The param to insert&period;


| *init*
| The list of params to insert&period;


| *first,*
| last The range of params        to insert&period;


|===


Insert params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L559[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
insert(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

== Description


This function inserts a range of        params before the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        element inserted, or `before` if        `first &equals;&equals; last`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the element is inserted&period; This may        be equal to `end()`&period;


| *first,*
| last The range of params        to insert&period;


|===


Insert params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L471[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
insert(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    <<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& p);
----

== Description


This function inserts a param        before the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the inserted        element&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the param is inserted&period; This may        be equal to `end()`&period;


| *p*
| The param to insert&period;


|===


Insert params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L512[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
insert(
    <<boost-urls-params_encoded_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

== Description


This function inserts the params in        an _initializer&hyphen;list_ before        the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        element inserted, or `before` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the element is inserted&period; This may        be equal to `end()`&period;


| *init*
| The list of params to insert&period;


|===


Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L191[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator <<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>>() const noexcept;
----

== Description



=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L142[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>>&
<<boost-urls-params_encoded_ref-operator_assign-02,operator&equals;>>(<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>> const& other);
----

[.small]#<<boost-urls-params_encoded_ref-operator_assign-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>>&
<<boost-urls-params_encoded_ref-operator_assign-03,operator&equals;>>(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_encoded_ref-operator_assign-03,_» more..._>>#

== Description


The previous contents of this are        replaced by the contents of other&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by `other`        must not come from the underlying url,        or else the behavior is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *other*
| The params to assign&period;


| *init*
| The list of params to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L142[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>>&
operator&equals;(<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>> const& other);
----

== Description


The previous contents of this are        replaced by the contents of other&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by `other`        must not come from the underlying url,        or else the behavior is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The params to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L179[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>>&
operator&equals;(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

== Description


After assignment, the previous contents        of the query parameters are replaced by        the contents of the initializer&hyphen;list&period;

All iterators are invalidated&period;


=== Preconditions

None of character buffers referenced by        `init` may overlap the character buffer of        the underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( init.begin(), init.end() );
----

=== Complexity

Linear in `init&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *init*
| The list of params to assign&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L80[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>>(<<boost-urls-url_base,url&lowbar;base>>& u) noexcept;
----

[.small]#<<boost-urls-params_encoded_ref,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-params_encoded_ref-2constructor-01,params&lowbar;encoded&lowbar;ref>>(<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>> const& other) = default;
----

[.small]#<<boost-urls-params_encoded_ref-2constructor-01,_» more..._>>#

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L112[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
params&lowbar;encoded&lowbar;ref(<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>> const& other) = default;
----

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


|===


Replace params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L705[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-replace-0f,replace>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> pos,
    <<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& p);
----

[.small]#<<boost-urls-params_encoded_ref-replace-0f,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-replace-08,replace>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> from,
    <<boost-urls-params_encoded_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_encoded_ref-replace-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-replace-06,replace>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> from,
    <<boost-urls-params_encoded_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_encoded_ref-replace-06,_» more..._>>#

== Description


This function replaces the contents        of the element at `pos` with the        specified param&period;

All iterators that are equal to        `pos` or come after are invalidated&period;

[NOTE]
The strings passed in must not come        from the element being replaced,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

u.encoded_params().replace( u.encoded_params().begin(), { "title", "Mr" });

assert( u.encoded_query() == "title=Mr&last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *p*
| The param to assign&period;


| *from,to*
| The range of params        to replace&period;


| *init*
| The list of params to assign&period;


| *first,*
| last The range of params        to assign&period;


|===


Replace params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L792[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_encoded_base-iterator,iterator>>
replace(
    <<boost-urls-params_encoded_base-iterator,iterator>> from,
    <<boost-urls-params_encoded_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

== Description


This function replaces a range of        params with a range of params&period;

All iterators that are equal to        `from` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        element inserted, or one past `to` if        `first &equals;&equals; last`&period;



== Parameters


|===
| Name | Description

| *from,to*
| The range of params to        replace&period;


| *first,*
| last The range of params        to assign&period;


|===


Replace params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L705[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
replace(
    <<boost-urls-params_encoded_base-iterator,iterator>> pos,
    <<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>> const& p);
----

== Description


This function replaces the contents        of the element at `pos` with the        specified param&period;

All iterators that are equal to        `pos` or come after are invalidated&period;

[NOTE]
The strings passed in must not come        from the element being replaced,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

u.encoded_params().replace( u.encoded_params().begin(), { "title", "Mr" });

assert( u.encoded_query() == "title=Mr&last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *p*
| The param to assign&period;


|===


Replace params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L745[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
replace(
    <<boost-urls-params_encoded_base-iterator,iterator>> from,
    <<boost-urls-params_encoded_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; init);
----

== Description


This function replaces a range of        params with the params in an        _initializer&hyphen;list_&period;

All iterators that are equal to        `from` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        element inserted, or one past `to` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *from,to*
| The range of params        to replace&period;


| *init*
| The list of params to assign&period;


|===


Set a value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L879[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-set-0d,set>>(
    <<boost-urls-params_encoded_base-iterator,iterator>> pos,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value);
----

[.small]#<<boost-urls-params_encoded_ref-set-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
<<boost-urls-params_encoded_ref-set-07,set>>(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;);
----

[.small]#<<boost-urls-params_encoded_ref-set-07,_» more..._>>#

== Description


This function replaces the value of an        element at the specified position&period;

All iterators that are equal to        `pos` or come after are invalidated&period;

[NOTE]
The string passed in must not come        from the element being replaced,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u( "?id=42&id=69" );

u.encoded_params().set( u.encoded_params().begin(), "none" );

assert( u.encoded_query() == "id=none&id=69" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `value` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *value*
| The value to assign&period; The        empty string still counts as a value&period;        That is, `has&lowbar;value` for the element        is true&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Set a value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L879[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
set(
    <<boost-urls-params_encoded_base-iterator,iterator>> pos,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value);
----

== Description


This function replaces the value of an        element at the specified position&period;

All iterators that are equal to        `pos` or come after are invalidated&period;

[NOTE]
The string passed in must not come        from the element being replaced,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u( "?id=42&id=69" );

u.encoded_params().set( u.encoded_params().begin(), "none" );

assert( u.encoded_query() == "id=none&id=69" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `value` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *value*
| The value to assign&period; The        empty string still counts as a value&period;        That is, `has&lowbar;value` for the element        is true&period;


|===


Set a value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L951[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
set(
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> key,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> value,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;);
----

== Description


This function performs one of two        actions depending on the value of        `this&hyphen;&gt;contains( key, ic )`&period;

* If key is contained in the view        then one of the matching params has
        its value changed to the specified value&period;        The remaining params with a matching
        key are erased&period; Otherwise,
* If 
`key`
 is not contained in the        view, then the function apppends the
        param 
`&lcub; key, value &rcub;`
&period;

All iterators are invalidated&period;

[NOTE]
The strings passed in must not come        from the element being replaced,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u( "?id=42&id=69" );

u.encoded_params().set( "id", "none" );

assert( u.encoded_params().count( "id" ) == 1 );
----

=== Postconditions

[,cpp]
----
this->count( key, ic ) == 1 && this->find( key, ic )->value == value
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `key` or `value` contain an invalid        percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the appended        or modified element&period;



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *value*
| The value to assign&period; The        empty string still counts as a value&period;        That is, `has&lowbar;value` for the element        is true&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Remove the value on an element

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L832[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_base-iterator,iterator>>
unset(<<boost-urls-params_encoded_base-iterator,iterator>> pos) noexcept;
----

== Description


This function removes the value of        an element at the specified position&period;        After the call returns, `has&lowbar;value`        for the element is false&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

u.encoded_params().unset( u.encoded_params().begin() );

assert( u.encoded_query() == "first&last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


|===


Return the referenced url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L217[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
url() const noexcept;
----

== Description


This function returns the url referenced        by the view&period;


=== Example

[,cpp]
----
url u( "?key=value" );

assert( &u.encoded_params().url() == &u );
----

=== Exception Safety

[,cpp]
----
Throws nothing.
----



A view representing query parameters in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L58[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class params&lowbar;encoded&lowbar;view
    : public <<boost-urls-params_encoded_base,params&lowbar;encoded&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_encoded_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-params_encoded_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-params_encoded_base-iterator,`iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_encoded_base-reference,`reference`>> 
| The reference type

| <<boost-urls-params_encoded_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type to represent sizes&period;

| <<boost-urls-params_encoded_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-params_encoded_base-buffer,`buffer`>> 
| Return the query corresponding to these params

| <<boost-urls-params_encoded_base-contains,`contains`>> 
| Return true if a matching key exists

| <<boost-urls-params_encoded_base-count,`count`>> 
| Return the number of matching keys

| <<boost-urls-params_encoded_base-empty,`empty`>> 
| Return true if there are no params

| <<boost-urls-params_encoded_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-params_encoded_base-find,`find`>> 
| Find a matching key


| <<boost-urls-params_encoded_base-find_last,`find&lowbar;last`>> 
| Find a matching key


| <<boost-urls-params_encoded_view-2conversion,`operator params&lowbar;view`>> 
| Conversion

| <<boost-urls-params_encoded_view-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-params_encoded_view-2constructor,`params&lowbar;encoded&lowbar;view`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-params_encoded_base-size,`size`>> 
| Return the number of params

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_encoded_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===
== Friends

[cols=1]
|===
| Name 

| <<boost-urls-params_encoded_view-08friend,`parse&lowbar;query`>> 
|===



== Description


Objects of this type are used to interpret    the query parameters as a bidirectional view    of key&sol;value pairs&period;

The view does not retain ownership of the    elements and instead references the original    character buffer&period; The caller is responsible    for ensuring that the lifetime of the buffer    extends until it is no longer referenced&period;


=== Example

[,cpp]
----
url_view u( "?first=John&last=Doe" );

params_encoded_view p = u.encoded_params();
----
Strings produced when elements are returned    have type xref:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view] and represent    encoded strings&period; Strings passed to member    functions may contain percent escapes, and    throw exceptions on invalid inputs&period;


=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;




Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L227[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator <<boost-urls-params_view,params&lowbar;view>>() const noexcept;
----

== Description


This conversion returns a new view which        references the same underlying character        buffer, and whose iterators and members        return ordinary strings with decoding        applied to any percent escapes&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Example

[,cpp]
----
params_view qp = parse_path( "/path/to/file.txt" ).value();
----

=== Postconditions

[,cpp]
----
params_view( *this ).buffer().data() == this->buffer().data()
----

=== Complexity

Constant


=== Exception Safety

Throws nothing




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L194[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>>&
operator&equals;(<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>> const&) = default;
----

== Description


After assignment, both views        reference the same underlying character        buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L91[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-params_encoded_view-2constructor-02,params&lowbar;encoded&lowbar;view>>() = default;
----

[.small]#<<boost-urls-params_encoded_view-2constructor-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-params_encoded_view-2constructor-06,params&lowbar;encoded&lowbar;view>>(<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>> const& other) = default;
----

[.small]#<<boost-urls-params_encoded_view-2constructor-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_view-2constructor-0c,params&lowbar;encoded&lowbar;view>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-params_encoded_view-2constructor-0c,_» more..._>>#

== Description


Default&hyphen;constructed params have        zero elements&period;


=== Example

[,cpp]
----
params_encoded_view qp;
----

=== Effects

[,cpp]
----
return params_encoded_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid query parameter        string&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L91[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
params&lowbar;encoded&lowbar;view() = default;
----

== Description


Default&hyphen;constructed params have        zero elements&period;


=== Example

[,cpp]
----
params_encoded_view qp;
----

=== Effects

[,cpp]
----
return params_encoded_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L114[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
params&lowbar;encoded&lowbar;view(<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>> const& other) = default;
----

== Description


After construction both views        reference the same character buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L169[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;encoded&lowbar;view(core::string&lowbar;view s);
----

== Description


This function constructs params from        a valid query parameter string, which        can contain percent escapes&period; Unlike        the parameters in URLs, the string        passed here should not start with &quot;?&quot;&period;        Upon construction, the view        references the character buffer pointed        to by `s`&period; The caller is responsible        for ensuring that the lifetime of the        buffer extends until it is no longer        referenced&period;


=== Example

[,cpp]
----
params_encoded_view qp( "first=John&last=Doe" );
----

=== Effects

[,cpp]
----
return parse_query( s ).value();
----

=== Postconditions

[,cpp]
----
this->buffer().data() == s.data()
----

=== Complexity

Linear in `s`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query-params    = [ query-param ] *( "&" query-param )

query-param     = key [ "=" value ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid query parameter        string&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L232[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
system::result&lt;<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>>&gt;
parse&lowbar;query(core::string&lowbar;view s) noexcept;
----


A view representing query parameters in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L80[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class params&lowbar;ref
    : public <<boost-urls-params_base,params&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-params_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-params_base-iterator,`iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_base-reference,`reference`>> 
| The reference type

| <<boost-urls-params_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type to represent sizes&period;

| <<boost-urls-params_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_ref-append,`append`>> 
| Append elements


| <<boost-urls-params_ref-assign,`assign`>> 
| Assign elements


| <<boost-urls-params_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-params_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-params_ref-clear,`clear`>> 
| Clear the contents of the container

| <<boost-urls-params_base-contains,`contains`>> 
| Return true if a matching key exists

| <<boost-urls-params_base-count,`count`>> 
| Return the number of matching keys

| <<boost-urls-params_base-empty,`empty`>> 
| Return true if there are no params

| <<boost-urls-params_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-params_ref-erase,`erase`>> 
| Erase elements


| <<boost-urls-params_base-find,`find`>> 
| Find a matching key


| <<boost-urls-params_base-find_last,`find&lowbar;last`>> 
| Find a matching key


| <<boost-urls-params_ref-insert,`insert`>> 
| Insert elements


| <<boost-urls-params_ref-2conversion,`operator params&lowbar;view`>> 
| Conversion

| <<boost-urls-params_ref-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-params_ref-2constructor,`params&lowbar;ref`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-params_ref-replace,`replace`>> 
| Replace elements


| <<boost-urls-params_ref-set,`set`>> 
| Set a value


| <<boost-urls-params_base-size,`size`>> 
| Return the number of params

| <<boost-urls-params_ref-unset,`unset`>> 
| Remove the value on an element

| <<boost-urls-params_ref-url,`url`>> 
| Return the referenced url

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


Objects of this type are used to interpret    the query parameters as a bidirectional view    of key&sol;value pairs&period;    The view does not retain ownership of the    elements and instead references the original    url&period; The caller is responsible for ensuring    that the lifetime of the referenced url    extends until it is no longer referenced&period;    The view is modifiable&semi; calling non&hyphen;const    members causes changes to the referenced    url&period;

Percent escapes in strings returned when    dereferencing iterators are automatically    decoded&period;    Reserved characters in strings supplied    to modifier functions are automatically    percent&hyphen;escaped&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

params_ref p = u.params();
----

=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;    Modifications made through the container    invalidate some or all iterators&colon; 

* append
 &colon; Only 
`end()`
&period;
* assign
, 
clear
,        
`operator&equals;`
 &colon; All elements&period;
* erase
 &colon; Erased elements and all        elements after (including 
`end()`
)&period;
* insert
 &colon; All elements at or after        the insertion point (including 
`end()`
)&period;
* replace
, 
set
 &colon; Modified        elements and all elements
        after (including 
`end()`
)&period;




Append elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L380[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-append-0f,append>>(<<boost-urls-param_view,param&lowbar;view>> const& p);
----

[.small]#<<boost-urls-params_ref-append-0f,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-append-07,append>>(std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_ref-append-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-append-0c,append>>(
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_ref-append-0c,_» more..._>>#

== Description


This function appends a param to the view&period;

The `end()` iterator is invalidated&period;


=== Example

[,cpp]
----
url u;

u.params().append( { "first", "John" } );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the new element&period;



== Parameters


|===
| Name | Description

| *p*
| The param to append&period;


| *init*
| The list of params to append&period;


| *first,*
| last The range of params        to append&period;


|===


Append elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L445[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
append(
    FwdIt first,
    FwdIt last);
----

== Description


This function appends a range of params        to the view&period;

The `end()` iterator is invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first new element&period;



== Parameters


|===
| Name | Description

| *first,*
| last The range of params        to append&period;


|===


Append elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L380[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
append(<<boost-urls-param_view,param&lowbar;view>> const& p);
----

== Description


This function appends a param to the view&period;

The `end()` iterator is invalidated&period;


=== Example

[,cpp]
----
url u;

u.params().append( { "first", "John" } );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the new element&period;



== Parameters


|===
| Name | Description

| *p*
| The param to append&period;


|===


Append elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L410[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
append(std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

== Description


This function appends the params in        an _initializer&hyphen;list_ to the view&period;

The `end()` iterator is invalidated&period;


=== Example

[,cpp]
----
url u;

u.params().append({ { "first", "John" }, { "last", "Doe" } });
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first new element&period;



== Parameters


|===
| Name | Description

| *init*
| The list of params to append&period;


|===


Assign elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L315[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
<<boost-urls-params_ref-assign-098,assign>>(std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_ref-assign-098,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-params_ref-assign-02,assign>>(
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_ref-assign-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-params_ref-assign-02,assign>>(
    FwdIt first,
    FwdIt last,
    std::forward&lowbar;iterator&lowbar;tag);
----

[.small]#<<boost-urls-params_ref-assign-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-params_ref-assign-02,assign>>(
    FwdIt first,
    FwdIt last,
    std::input&lowbar;iterator&lowbar;tag) = delete;
----

[.small]#<<boost-urls-params_ref-assign-02,_» more..._>>#

== Description


This function replaces the entire        contents of the view with the params        in the _initializer&hyphen;list_&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u;

u.params().assign( {{ "first", "John" }, { "last", "Doe" }} );
----

=== Complexity

Linear in `init&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *init*
| The list of params to assign&period;


| *first,*
| last The range of params        to assign&period;


|===


Assign elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L349[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
assign(
    FwdIt first,
    FwdIt last);
----

== Description


This function replaces the entire        contents of the view with the params        in the range&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true
----

=== Complexity

Linear in the size of the range&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *first,*
| last The range of params        to assign&period;


|===


Assign elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L315[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
assign(std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

== Description


This function replaces the entire        contents of the view with the params        in the _initializer&hyphen;list_&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Example

[,cpp]
----
url u;

u.params().assign( {{ "first", "John" }, { "last", "Doe" }} );
----

=== Complexity

Linear in `init&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *init*
| The list of params to assign&period;


|===


Clear the contents of the container

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L280[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
clear() noexcept;
----

== Description


All iterators are invalidated&period;


=== Effects

[,cpp]
----
this->url().remove_query();
----

=== Postconditions

[,cpp]
----
this->empty() == true && this->url().has_query() == false
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Erase elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L595[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-erase-05,erase>>(<<boost-urls-params_base-iterator,iterator>> pos) noexcept;
----

[.small]#<<boost-urls-params_ref-erase-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-erase-0f,erase>>(
    <<boost-urls-params_base-iterator,iterator>> first,
    <<boost-urls-params_base-iterator,iterator>> last) noexcept;
----

[.small]#<<boost-urls-params_ref-erase-0f,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
<<boost-urls-params_ref-erase-00,erase>>(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) noexcept;
----

[.small]#<<boost-urls-params_ref-erase-00,_» more..._>>#

== Description


This function removes an element from        the container&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

params_ref::iterator it = u.params().erase( u.params().begin() );

assert( u.encoded_query() == "last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *first,*
| last The range of        elements to erase&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Erase elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L595[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
erase(<<boost-urls-params_base-iterator,iterator>> pos) noexcept;
----

== Description


This function removes an element from        the container&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

params_ref::iterator it = u.params().erase( u.params().begin() );

assert( u.encoded_query() == "last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


|===


Erase elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L619[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
erase(
    <<boost-urls-params_base-iterator,iterator>> first,
    <<boost-urls-params_base-iterator,iterator>> last) noexcept;
----

== Description


This function removes a range of elements        from the container&period;

All iterators that are equal to        `first` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed range&period;



== Parameters


|===
| Name | Description

| *first,*
| last The range of        elements to erase&period;


|===


Erase elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L652[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
erase(
    core::string&lowbar;view key,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;) noexcept;
----

== Description


All iterators are invalidated&period;


=== Postconditions

[,cpp]
----
this->count( key, ic ) == 0
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


The number of elements removed        from the container&period;



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Insert elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L477[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-insert-08a,insert>>(
    <<boost-urls-params_base-iterator,iterator>> before,
    <<boost-urls-param_view,param&lowbar;view>> const& p);
----

[.small]#<<boost-urls-params_ref-insert-08a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-insert-02,insert>>(
    <<boost-urls-params_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_ref-insert-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-insert-05,insert>>(
    <<boost-urls-params_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_ref-insert-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-insert-05,insert>>(
    <<boost-urls-params_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::forward&lowbar;iterator&lowbar;tag);
----

[.small]#<<boost-urls-params_ref-insert-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-insert-05,insert>>(
    <<boost-urls-params_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::input&lowbar;iterator&lowbar;tag) = delete;
----

[.small]#<<boost-urls-params_ref-insert-05,_» more..._>>#

== Description


This function inserts a param        before the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the inserted        element&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the param is inserted&period; This may        be equal to `end()`&period;


| *p*
| The param to insert&period;


| *init*
| The list of params to insert&period;


| *first,*
| last The range of params        to insert&period;


|===


Insert elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L557[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
insert(
    <<boost-urls-params_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

== Description


This function inserts a range of        params before the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        element inserted, or `before` if        `first &equals;&equals; last`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the element is inserted&period; This may        be equal to `end()`&period;


| *first,*
| last The range of params        to insert&period;


|===


Insert elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L477[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
insert(
    <<boost-urls-params_base-iterator,iterator>> before,
    <<boost-urls-param_view,param&lowbar;view>> const& p);
----

== Description


This function inserts a param        before the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the inserted        element&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the param is inserted&period; This may        be equal to `end()`&period;


| *p*
| The param to insert&period;


|===


Insert elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L514[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
insert(
    <<boost-urls-params_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

== Description


This function inserts the params in        an _initializer&hyphen;list_ before        the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        element inserted, or `before` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the element is inserted&period; This may        be equal to `end()`&period;


| *init*
| The list of params to insert&period;


|===


Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L221[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator <<boost-urls-params_view,params&lowbar;view>>() const noexcept;
----


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L184[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>&
<<boost-urls-params_ref-operator_assign-0c,operator&equals;>>(<<boost-urls-params_ref,params&lowbar;ref>> const& other);
----

[.small]#<<boost-urls-params_ref-operator_assign-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>&
<<boost-urls-params_ref-operator_assign-03,operator&equals;>>(std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_ref-operator_assign-03,_» more..._>>#

== Description


The previous contents of this are        replaced by the contents of other&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by `other`        must not come from the underlying url,        or else the behavior is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The params to assign&period;


| *init*
| The list of params to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L184[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>&
operator&equals;(<<boost-urls-params_ref,params&lowbar;ref>> const& other);
----

== Description


The previous contents of this are        replaced by the contents of other&period;

All iterators are invalidated&period;

[NOTE]
The strings referenced by `other`        must not come from the underlying url,        or else the behavior is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The params to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L214[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>&
operator&equals;(std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

== Description


After assignment, the previous contents        of the query parameters are replaced by        the contents of the initializer&hyphen;list&period;


=== Preconditions

None of character buffers referenced by        `init` may overlap the character buffer of        the underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( init );
----

=== Complexity

Linear in `init&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *init*
| The list of params to assign&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L87[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>(
    <<boost-urls-url_base,url&lowbar;base>>& u,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) noexcept;
----

[.small]#<<boost-urls-params_ref,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-params_ref-2constructor-0b,params&lowbar;ref>>(<<boost-urls-params_ref,params&lowbar;ref>> const& other) = default;
----

[.small]#<<boost-urls-params_ref-2constructor-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref-2constructor-09,params&lowbar;ref>>(
    <<boost-urls-params_ref,params&lowbar;ref>> const& other,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) noexcept;
----

[.small]#<<boost-urls-params_ref-2constructor-09,_» more..._>>#

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


| *opt*
| The options for decoding&period; If        this parameter is omitted, `space&lowbar;as&lowbar;plus`        is used&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L120[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
params&lowbar;ref(<<boost-urls-params_ref,params&lowbar;ref>> const& other) = default;
----

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L153[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;ref(
    <<boost-urls-params_ref,params&lowbar;ref>> const& other,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) noexcept;
----

== Description


After construction, both views will        reference the same url but this        instance will use the specified        xref:#boost-urls-encoding_opts[encoding&lowbar;opts] when the values        are decoded&period;

Ownership is not transferred&semi; the        caller is responsible for ensuring        the lifetime of the url extends        until it is no longer referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


| *opt*
| The options for decoding&period; If        this parameter is omitted, `space&lowbar;as&lowbar;plus`        is used&period;


|===


Replace elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L691[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-replace-0d,replace>>(
    <<boost-urls-params_base-iterator,iterator>> pos,
    <<boost-urls-param_view,param&lowbar;view>> const& p);
----

[.small]#<<boost-urls-params_ref-replace-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-replace-0b,replace>>(
    <<boost-urls-params_base-iterator,iterator>> from,
    <<boost-urls-params_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-params_ref-replace-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-replace-01,replace>>(
    <<boost-urls-params_base-iterator,iterator>> from,
    <<boost-urls-params_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-params_ref-replace-01,_» more..._>>#

== Description


This function replaces the contents        of the element at `pos` with the        specified param&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

u.params().replace( u.params().begin(), { "title", "Mr" });

assert( u.encoded_query() == "title=Mr&last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *p*
| The param to assign&period;


| *from,to*
| The range of elements        to replace&period;


| *init*
| The list of params to assign&period;


| *first,*
| last The range of params        to assign&period;


|===


Replace elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L770[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-params_base-iterator,iterator>>
replace(
    <<boost-urls-params_base-iterator,iterator>> from,
    <<boost-urls-params_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

== Description


This function replaces a range of        elements with a range of params&period;

All iterators that are equal to        `from` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        element inserted, or one past `to` if        `first &equals;&equals; last`&period;



== Parameters


|===
| Name | Description

| *from,to*
| The range of elements to        replace&period;


| *first,*
| last The range of params        to assign&period;


|===


Replace elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L691[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
replace(
    <<boost-urls-params_base-iterator,iterator>> pos,
    <<boost-urls-param_view,param&lowbar;view>> const& p);
----

== Description


This function replaces the contents        of the element at `pos` with the        specified param&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

u.params().replace( u.params().begin(), { "title", "Mr" });

assert( u.encoded_query() == "title=Mr&last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *p*
| The param to assign&period;


|===


Replace elements

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L727[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
replace(
    <<boost-urls-params_base-iterator,iterator>> from,
    <<boost-urls-params_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; init);
----

== Description


This function replaces a range of        elements with the params in an        _initializer&hyphen;list_&period;

All iterators that are equal to        `from` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs        must not come from the underlying url,        or else the behavior is undefined&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        element inserted, or one past `to` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *from,to*
| The range of elements        to replace&period;


| *init*
| The list of params to assign&period;


|===


Set a value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L848[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-set-09,set>>(
    <<boost-urls-params_base-iterator,iterator>> pos,
    core::string&lowbar;view value);
----

[.small]#<<boost-urls-params_ref-set-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
<<boost-urls-params_ref-set-01,set>>(
    core::string&lowbar;view key,
    core::string&lowbar;view value,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;);
----

[.small]#<<boost-urls-params_ref-set-01,_» more..._>>#

== Description


This function replaces the value of an        element at the specified position&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?id=42&id=69" );

u.params().set( u.params().begin(), "none" );

assert( u.encoded_query() == "id=none&id=69" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *value*
| The value to assign&period; The        empty string still counts as a value&period;        That is, `has&lowbar;value` for the element        is true&period;


| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Set a value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L848[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
set(
    <<boost-urls-params_base-iterator,iterator>> pos,
    core::string&lowbar;view value);
----

== Description


This function replaces the value of an        element at the specified position&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?id=42&id=69" );

u.params().set( u.params().begin(), "none" );

assert( u.encoded_query() == "id=none&id=69" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *value*
| The value to assign&period; The        empty string still counts as a value&period;        That is, `has&lowbar;value` for the element        is true&period;


|===


Set a value

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L910[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
set(
    core::string&lowbar;view key,
    core::string&lowbar;view value,
    <<boost-urls-ignore_case_param,ignore&lowbar;case&lowbar;param>> ic = &lcub;&rcub;);
----

== Description


This function performs one of two        actions depending on the value of        `this&hyphen;&gt;contains( key, ic )`&period;

* If key is contained in the view        then one of the matching elements has
        its value changed to the specified value&period;        The remaining elements with a matching
        key are erased&period; Otherwise,
* If 
`key`
 is not contained in the        view, then the function apppends the
        param 
`&lcub; key, value &rcub;`
&period;

All iterators are invalidated&period;


=== Example

[,cpp]
----
url u( "?id=42&id=69" );

u.params().set( "id", "none" );

assert( u.params().count( "id" ) == 1 );
----

=== Postconditions

[,cpp]
----
this->count( key, ic ) == 1 && this->find( key, ic )->value == value
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the appended        or modified element&period;



== Parameters


|===
| Name | Description

| *key*
| The key to match&period;        By default, a case&hyphen;sensitive        comparison is used&period;


| *value*
| The value to assign&period; The        empty string still counts as a value&period;        That is, `has&lowbar;value` for the element        is true&period;


| *ic*
| An optional parameter&period; If        the value xref:#boost-urls-ignore_case[ignore&lowbar;case] is passed        here, the comparison is        case&hyphen;insensitive&period;


|===


Remove the value on an element

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L810[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_base-iterator,iterator>>
unset(<<boost-urls-params_base-iterator,iterator>> pos) noexcept;
----

== Description


This function removes the value of        an element at the specified position&period;        After the call returns, `has&lowbar;value`        for the element is false&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Example

[,cpp]
----
url u( "?first=John&last=Doe" );

u.params().unset( u.params().begin() );

assert( u.encoded_query() == "first&last=Doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to the element&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


|===


Return the referenced url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L247[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
url() const noexcept;
----

== Description


This function returns the url referenced        by the view&period;


=== Example

[,cpp]
----
url u( "?key=value" );

assert( &u.segments().url() == &u );
----

=== Exception Safety

[,cpp]
----
Throws nothing.
----



A view representing query parameters in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L47[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class params&lowbar;view
    : public <<boost-urls-params_base,params&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-params_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-params_base-iterator,`iterator`>> 
| A Bidirectional iterator to a query parameter

| <<boost-urls-params_base-reference,`reference`>> 
| The reference type

| <<boost-urls-params_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type to represent sizes&period;

| <<boost-urls-params_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-params_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-params_base-contains,`contains`>> 
| Return true if a matching key exists

| <<boost-urls-params_base-count,`count`>> 
| Return the number of matching keys

| <<boost-urls-params_base-empty,`empty`>> 
| Return true if there are no params

| <<boost-urls-params_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-params_base-find,`find`>> 
| Find a matching key


| <<boost-urls-params_base-find_last,`find&lowbar;last`>> 
| Find a matching key


| <<boost-urls-params_view-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-params_view-2constructor,`params&lowbar;view`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-params_base-size,`size`>> 
| Return the number of params

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-params_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


Objects of this type are used to interpret    the query parameters as a bidirectional view    of key&sol;value pairs&period;

The view does not retain ownership of the    elements and instead references the original    character buffer&period; The caller is responsible    for ensuring that the lifetime of the buffer    extends until it is no longer referenced&period;


=== Example

[,cpp]
----
url_view u( "?first=John&last=Doe" );

params_view p = u.params();
----
Percent escapes in strings returned when    dereferencing iterators are automatically    decoded&period;


=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L278[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view,params&lowbar;view>>&
operator&equals;(<<boost-urls-params_view,params&lowbar;view>> const&) = default;
----

== Description


After assignment, both views reference        the same underlying character buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L80[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view-2constructor-0d,params&lowbar;view>>() = default;
----

[.small]#<<boost-urls-params_view-2constructor-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-params_view-2constructor-091,params&lowbar;view>>(<<boost-urls-params_view,params&lowbar;view>> const& other) = default;
----

[.small]#<<boost-urls-params_view-2constructor-091,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view-2constructor-01,params&lowbar;view>>(
    <<boost-urls-params_view,params&lowbar;view>> const& other,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) noexcept;
----

[.small]#<<boost-urls-params_view-2constructor-01,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view-2constructor-09a,params&lowbar;view>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-params_view-2constructor-09a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view-2constructor-04,params&lowbar;view>>(
    core::string&lowbar;view s,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt);
----

[.small]#<<boost-urls-params_view-2constructor-04,_» more..._>>#

== Description


Default&hyphen;constructed params have        zero elements&period;


=== Example

[,cpp]
----
params_view qp;
----

=== Effects

[,cpp]
----
return params_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid query parameter        string&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


| *opt*
| The options for decoding&period; If        this parameter is omitted, `space&lowbar;as&lowbar;plus`        is used&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L80[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;view() = default;
----

== Description


Default&hyphen;constructed params have        zero elements&period;


=== Example

[,cpp]
----
params_view qp;
----

=== Effects

[,cpp]
----
return params_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L103[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
params&lowbar;view(<<boost-urls-params_view,params&lowbar;view>> const& other) = default;
----

== Description


After construction both views reference        the same character buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L130[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;view(
    <<boost-urls-params_view,params&lowbar;view>> const& other,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) noexcept;
----

== Description


After construction both views will        reference the same character buffer        but this instance will use the specified        xref:#boost-urls-encoding_opts[encoding&lowbar;opts] when the values        are decoded&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L186[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;view(core::string&lowbar;view s);
----

== Description


This function constructs params from        a valid query parameter string, which        can contain percent escapes&period; Unlike        the parameters in URLs, the string        passed here should not start with &quot;?&quot;&period;        Upon construction, the view references        the character buffer pointed to by `s`&period;        The caller is responsible for ensuring        that the lifetime of the buffer extends        until it is no longer referenced&period;


=== Example

[,cpp]
----
params_view qp( "first=John&last=Doe" );
----

=== Effects

[,cpp]
----
return parse_query( s ).value();
----

=== Postconditions

[,cpp]
----
this->buffer().data() == s.data()
----

=== Complexity

Linear in `s`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query-params    = [ query-param ] *( "&" query-param )

query-param     = key [ "=" value ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid query parameter        string&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L253[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;view(
    core::string&lowbar;view s,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt);
----

== Description


This function constructs params from        a valid query parameter string, which        can contain percent escapes&period;

This instance will use the specified        xref:#boost-urls-encoding_opts[encoding&lowbar;opts] when the values        are decoded&period;

Unlike the parameters in URLs, the string        passed here should not start with &quot;?&quot;&period;        Upon construction, the view will        reference the character buffer pointed        to by `s`&period; The caller is responsible        for ensuring that the lifetime of the        buffer extends until it is no longer        referenced&period;


=== Example

[,cpp]
----
encoding_opts opt;
opt.space_as_plus = true;
params_view qp( "name=John+Doe", opt );
----

=== Effects

[,cpp]
----
return params_view(parse_query( s ).value(), opt);
----

=== Postconditions

[,cpp]
----
this->buffer().data() == s.data()
----

=== Complexity

Linear in `s`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query-params    = [ query-param ] *( "&" query-param )

query-param     = key [ "=" value ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid query parameter        string&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


| *opt*
| The options for decoding&period; If        this parameter is omitted, `space&lowbar;as&lowbar;plus`        is used&period;


|===


A reference to a valid percent&hyphen;encoded string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L59[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class pct&lowbar;string&lowbar;view
    : public <<boost-urls-grammar,grammar>>::<<boost-urls-grammar-string_view_base,string&lowbar;view&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-const_iterator,`const&lowbar;iterator`>> 
| The const iterator type

| <<boost-urls-grammar-string_view_base-const_pointer,`const&lowbar;pointer`>> 
| The const pointer type

| <<boost-urls-grammar-string_view_base-const_reference,`const&lowbar;reference`>> 
| The const reference type

| <<boost-urls-grammar-string_view_base-const_reverse_iterator,`const&lowbar;reverse&lowbar;iterator`>> 
| The const reverse iterator type

| <<boost-urls-grammar-string_view_base-difference_type,`difference&lowbar;type`>> 
| The difference type

| <<boost-urls-grammar-string_view_base-iterator,`iterator`>> 
| The iterator type

| <<boost-urls-grammar-string_view_base-pointer,`pointer`>> 
| The pointer type

| <<boost-urls-grammar-string_view_base-reference,`reference`>> 
| The reference type

| <<boost-urls-grammar-string_view_base-reverse_iterator,`reverse&lowbar;iterator`>> 
| The reverse iterator type

| <<boost-urls-grammar-string_view_base-size_type,`size&lowbar;type`>> 
| The size type

| <<boost-urls-grammar-string_view_base-traits_type,`traits&lowbar;type`>> 
| The character traits

| <<boost-urls-grammar-string_view_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-at,`at`>> 
| Access a character

| <<boost-urls-grammar-string_view_base-back,`back`>> 
| Return the last character

| <<boost-urls-grammar-string_view_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-grammar-string_view_base-cbegin,`cbegin`>> 
| Return an iterator to the beginning

| <<boost-urls-grammar-string_view_base-cend,`cend`>> 
| Return an iterator to the end

| <<boost-urls-grammar-string_view_base-compare,`compare`>> 
| Return the result of comparing to another string


| <<boost-urls-grammar-string_view_base-contains,`contains`>> 
| Return true if matching characters are found


| <<boost-urls-grammar-string_view_base-copy,`copy`>> 
| Copy the characters to another buffer

| <<boost-urls-grammar-string_view_base-crbegin,`crbegin`>> 
| Return a reverse iterator to the end

| <<boost-urls-grammar-string_view_base-crend,`crend`>> 
| Return a reverse iterator to the beginning

| <<boost-urls-grammar-string_view_base-data,`data`>> 
| Return a pointer to the character buffer

| <<boost-urls-pct_string_view-decode,`decode`>> 
| Return the string with percent&hyphen;decoding

| <<boost-urls-pct_string_view-decoded_size,`decoded&lowbar;size`>> 
| Return the decoded size

| <<boost-urls-grammar-string_view_base-empty,`empty`>> 
| Return true if the string is empty

| <<boost-urls-grammar-string_view_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-grammar-string_view_base-ends_with,`ends&lowbar;with`>> 
| Return true if a matching suffix exists


| <<boost-urls-grammar-string_view_base-find,`find`>> 
| Return the position of matching characters


| <<boost-urls-grammar-string_view_base-find_first_not_of,`find&lowbar;first&lowbar;not&lowbar;of`>> 
| Return the position of the first non&hyphen;match


| <<boost-urls-grammar-string_view_base-find_first_of,`find&lowbar;first&lowbar;of`>> 
| Return the position of the first match


| <<boost-urls-grammar-string_view_base-find_last_not_of,`find&lowbar;last&lowbar;not&lowbar;of`>> 
| Return the position of the last non&hyphen;match


| <<boost-urls-grammar-string_view_base-find_last_of,`find&lowbar;last&lowbar;of`>> 
| Return the position of the last match


| <<boost-urls-grammar-string_view_base-front,`front`>> 
| Return the first character

| <<boost-urls-grammar-string_view_base-length,`length`>> 
| Return the size

| <<boost-urls-grammar-string_view_base-max_size,`max&lowbar;size`>> 
| Return the maximum allowed size

| <<boost-urls-grammar-string_view_base-2conversion-06,`operator std::string`>> 
| Conversion

| <<boost-urls-grammar-string_view_base-2conversion-0e,`operator std::string&lowbar;view`>> 
| Conversion

| <<boost-urls-pct_string_view-operator_star,`operator&ast;`>> 
| Return the string as a range of decoded characters

| <<boost-urls-pct_string_view-operator_ptr,`operator&hyphen;&gt;`>> 
| Arrow support

| <<boost-urls-pct_string_view-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-grammar-string_view_base-operator_subs,`operator&lsqb;&rsqb;`>> 
| Access a character

| <<boost-urls-pct_string_view-2constructor,`pct&lowbar;string&lowbar;view`>>         [.small]#[constructor]#
| Constructor

Constructor (deleted)


| <<boost-urls-grammar-string_view_base-rbegin,`rbegin`>> 
| Return a reverse iterator to the end

| <<boost-urls-grammar-string_view_base-rend,`rend`>> 
| Return a reverse iterator to the beginning

| <<boost-urls-grammar-string_view_base-rfind,`rfind`>> 
| Return the position of matching characters


| <<boost-urls-grammar-string_view_base-size,`size`>> 
| Return the size

| <<boost-urls-grammar-string_view_base-starts_with,`starts&lowbar;with`>> 
| Return true if a matching prefix exists


| <<boost-urls-grammar-string_view_base-substr,`substr`>> 
| Return a view to part of the string

| <<boost-urls-pct_string_view-swap,`swap`>> 
| Swap

|===
== Static Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-npos,`npos`>> 
| A constant used to represent &quot;no position&quot;

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-pct_string_view-08friend,`make&lowbar;pct&lowbar;string&lowbar;view`>> 
| 

| <<boost-urls-grammar-string_view_base-08friend-017,`operator!&equals;`>> 
| Compare two string views for inequality

| <<boost-urls-grammar-string_view_base-08friend-010,`operator&lt;`>> 
| Compare two string views for less than

| <<boost-urls-grammar-string_view_base-08friend-0a,`operator&lt;&lt;`>> 
| Format a string to an output stream

| <<boost-urls-grammar-string_view_base-08friend-0c,`operator&lt;&equals;`>> 
| Compare two string views for less than or equal

| <<boost-urls-grammar-string_view_base-08friend-09,`operator&equals;&equals;`>> 
| Compare two string views for equality

| <<boost-urls-grammar-string_view_base-08friend-0d,`operator&gt;`>> 
| Compare two string views for greater than

| <<boost-urls-grammar-string_view_base-08friend-02,`operator&gt;&equals;`>> 
| Compare two string views for greater than or equal

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-grammar-string_view_base-swap,`swap`>> 
| Swap

|===
== Protected Data Members

[cols=2]
|===
| Name | Description 

| <<boost-urls-grammar-string_view_base-s_,`s&lowbar;`>> 
| The referenced character buffer

|===


== Description


Objects of this type behave like a    `core&colon;&colon;string&lowbar;view` and have the same interface,    but offer an additional invariant&colon; they can    only be constructed from strings containing    valid percent&hyphen;escapes&period;

Attempting construction from a string    containing invalid or malformed percent    escapes results in an exception&period;




Return the string with percent&hyphen;decoding

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L334[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
decode(
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;,
    StringToken&& token);
----

== Description


This function converts percent escapes        in the string into ordinary characters        and returns the result&period;        When called with no arguments, the        return type is `std&colon;&colon;string`&period;        Otherwise, the return type and style        of output is determined by which string        token is passed&period;


=== Example

[,cpp]
----
assert( pct_string_view( "Program%20Files" ).decode() == "Program Files" );
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;        String tokens may throw exceptions&period;



== Parameters


|===
| Name | Description

| *opt*
| The options for encoding&period; If        this parameter is omitted, the default        options are used&period;


| *token*
| An optional string token&period;        If this parameter is omitted, then        a new `std&colon;&colon;string` is returned&period;        Otherwise, the function return type        is the result type of the token&period;


|===

== See Also


xref:#boost-urls-encoding_opts[encoding&lowbar;opts],            xref:#boost-urls-string_token-return_string[string&lowbar;token&colon;&colon;return&lowbar;string]&period;





Return the decoded size

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L276[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
std::size&lowbar;t
decoded&lowbar;size() const noexcept;
----

== Description


This function returns the number of        characters in the resulting string if        percent escapes were converted into        ordinary characters&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the string as a range of decoded characters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L294[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-decode_view,decode&lowbar;view>>
operator&ast;() const noexcept;
----

== Description



=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== See Also


xref:#boost-urls-decode_view[decode&lowbar;view]&period;





Arrow support

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L356[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> const*
operator&hyphen;&gt;() const noexcept;
----


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L252[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&
operator&equals;(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> const& other) = default;
----

== Description


The copy references the same        underlying character buffer&period;        Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->data() == other.data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== other The string to copy&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L104[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-pct_string_view-2constructor-00,pct&lowbar;string&lowbar;view>>() = default;
----

[.small]#<<boost-urls-pct_string_view-2constructor-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-pct_string_view-2constructor-07,pct&lowbar;string&lowbar;view>>(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> const& other) = default;
----

[.small]#<<boost-urls-pct_string_view-2constructor-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; String&gt;
requires std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value
constexpr
<<boost-urls-pct_string_view-2constructor-0c,pct&lowbar;string&lowbar;view>>(String const& s);
----

[.small]#<<boost-urls-pct_string_view-2constructor-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view-2constructor-0f,pct&lowbar;string&lowbar;view>>(std::nullptr&lowbar;t) = delete;
----

[.small]#<<boost-urls-pct_string_view-2constructor-0f,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view-2constructor-06,pct&lowbar;string&lowbar;view>>(
    char const* s,
    std::size&lowbar;t len);
----

[.small]#<<boost-urls-pct_string_view-2constructor-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view-2constructor-0d,pct&lowbar;string&lowbar;view>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-pct_string_view-2constructor-0d,_» more..._>>#

== Description


Default constructed string are empty&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The string contains an invalid percent encoding&period;


|===

== Template Parameters


|===
| Name | Description

| *String*
| A type convertible to `core&colon;&colon;string&lowbar;view`


|===

== Parameters


|===
| Name | Description

| *s*
| The string to construct from&period;


| *len*
| The length of the string&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L153[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; String&gt;
requires std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value
constexpr
pct&lowbar;string&lowbar;view(String const& s);
----

== Description


The newly constructed string references        the specified character buffer&period;        Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->data() == core::string_view(s).data()
----

=== Complexity

Linear in `core&colon;&colon;string&lowbar;view(s)&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The string contains an invalid percent encoding&period;


|===

== Template Parameters


|===
| Name | Description

| *String*
| A type convertible to `core&colon;&colon;string&lowbar;view`


|===

== Parameters


|===
| Name | Description

| *s*
| The string to construct from&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L104[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
pct&lowbar;string&lowbar;view() = default;
----

== Description


Default constructed string are empty&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L125[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
pct&lowbar;string&lowbar;view(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> const& other) = default;
----

== Description


The copy references the same        underlying character buffer&period;        Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->data() == other.data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== other The string to copy&period;




Constructor (deleted)

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L173[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
pct&lowbar;string&lowbar;view(std::nullptr&lowbar;t) = delete;
----


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L199[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
pct&lowbar;string&lowbar;view(
    char const* s,
    std::size&lowbar;t len);
----

== Description


The newly constructed string references        the specified character buffer&period; Ownership        is not transferred&period;


=== Postconditions

[,cpp]
----
this->data() == s && this->size() == len
----

=== Complexity

Linear in `len`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The string contains an invalid percent encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to construct from&period;


| *len*
| The length of the string&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L230[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
pct&lowbar;string&lowbar;view(core::string&lowbar;view s);
----

== Description


The newly constructed string references        the specified character buffer&period; Ownership        is not transferred&period;


=== Postconditions

[,cpp]
----
this->data() == s.data() && this->size() == s.size()
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The string contains an invalid percent encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to construct from&period;


|===


Swap

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L368[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>& s) noexcept;
----


== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L255[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
system::result&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt;
make&lowbar;pct&lowbar;string&lowbar;view(core::string&lowbar;view s) noexcept;
----


Common functionality for containers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L37[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class segments&lowbar;base;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-segments_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-segments_base-iterator,`iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_base-reference,`reference`>> 
| The reference type

| <<boost-urls-segments_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type used to represent size&period;

| <<boost-urls-segments_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-back,`back`>> 
| Return the last segment

| <<boost-urls-segments_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-segments_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-segments_base-empty,`empty`>> 
| Return true if there are no segments

| <<boost-urls-segments_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-segments_base-front,`front`>> 
| Return the first segment

| <<boost-urls-segments_base-is_absolute,`is&lowbar;absolute`>> 
| Returns true if this references an absolute path&period;

| <<boost-urls-segments_base-size,`size`>> 
| Return the number of segments

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


This base class is used by the library    to provide common member functions for    containers&period; This cannot be instantiated    directly&semi; Instead, use one of the    containers or functions&colon;


=== Containers

* segments&lowbar;ref
    
* segments&lowbar;view
    
* segments&lowbar;encoded&lowbar;ref
    
* segments&lowbar;encoded&lowbar;view




A Bidirectional iterator to a path segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/impl/segments_base.hpp#L21[boost&sol;url&sol;impl&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----




== Description


Objects of this type allow iteration        through the segments in the path&period;        Any percent&hyphen;escapes in returned strings        are decoded first&period;        The values returned are read&hyphen;only&semi;        changes to segments must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators are        dereferenced belong to the iterator and        become invalidated when that particular        iterator is incremented, decremented,        or destroyed&period;




Return the last segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L292[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string
back() const noexcept;
----

== Description



=== Preconditions

[,cpp]
----
this->empty() == false
----

=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).segments().back() == "file.txt" );
----

=== Preconditions

[,cpp]
----
this->empty() == false
----

=== Effects

[,cpp]
----
return *--end();
----

=== Complexity

Linear in `this&hyphen;&gt;back()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;




Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L305[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
begin() const noexcept;
----

== Description



=== Complexity

Linear in `this&hyphen;&gt;front()&period;size()` or        constant if `this&hyphen;&gt;empty()`&period;


=== Exception Safety

Throws nothing&period;




Return the referenced character buffer&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L175[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
buffer() const noexcept;
----

== Description


This function returns the character        buffer referenced by the view&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).segments().buffer() == "/path/to/file.txt" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return true if there are no segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L212[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( ! url_view( "/index.htm" ).segments().empty() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L317[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
end() const noexcept;
----

== Description



=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the first segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L261[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string
front() const noexcept;
----

== Description


This function returns a string with the        first segment of the path without any        leading or trailing &apos;&sol;&apos; separators&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Preconditions

[,cpp]
----
this->empty() == false
----

=== Effects

[,cpp]
----
return *begin();
----

=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).segments().front() == "path" );
----

=== Complexity

Linear in `this&hyphen;&gt;front()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;




Returns true if this references an absolute path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L195[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;absolute() const noexcept;
----

== Description


Absolute paths always start with a        forward slash (&apos;&sol;&apos;)&period;


=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).segments().is_absolute() == true );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the maximum number of characters possible

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L148[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
static
std::size&lowbar;t
max&lowbar;size() noexcept;
----

== Description


This represents the largest number of        characters that are possible in a path,        not including any null terminator&period;


=== Exception Safety

Throws nothing&period;




== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L45[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base,segments&lowbar;base>>(&sol;&ast; implementation-defined &ast;&sol;::path&lowbar;ref const& ref) noexcept;
----

[.small]#<<boost-urls-segments_base,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_base,segments&lowbar;base>>() = default;
----

[.small]#<<boost-urls-segments_base,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_base,segments&lowbar;base>>(<<boost-urls-segments_base,segments&lowbar;base>> const&) = default;
----

[.small]#<<boost-urls-segments_base,_» more..._>>#


Return the number of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L229[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
size() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).segments().size() == 3 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




A Bidirectional iterator to a path segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L100[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = <<boost-urls-segments_base-iterator,iterator>>;
----

== Description


Objects of this type allow iteration        through the segments in the path&period;        Any percent&hyphen;escapes in returned strings        are decoded first&period;        The values returned are read&hyphen;only&semi;        changes to segments must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators are        dereferenced belong to the iterator and        become invalidated when that particular        iterator is incremented, decremented,        or destroyed&period;




The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L123[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = std::string;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;




A signed integer type used to represent differences&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L131[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using difference&lowbar;type = std::ptrdiff&lowbar;t;
----


The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L120[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = std::string;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;




An unsigned integer type used to represent size&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L127[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using size&lowbar;type = std::size&lowbar;t;
----


The value type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L113[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = std::string;
----

== Description


Values of this type represent a segment        where unique ownership is retained by        making a copy&period;


=== Example

[,cpp]
----
segments_base::value_type ps( url_view( "/path/to/file.txt" ).segments().back() );
----



Common functionality for containers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L37[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class segments&lowbar;encoded&lowbar;base;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_encoded_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-segments_encoded_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-segments_encoded_base-iterator,`iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_encoded_base-reference,`reference`>> 
| The reference type

| <<boost-urls-segments_encoded_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type used to represent size&period;

| <<boost-urls-segments_encoded_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-back,`back`>> 
| Return the last segment

| <<boost-urls-segments_encoded_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-segments_encoded_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-segments_encoded_base-empty,`empty`>> 
| Return true if there are no segments

| <<boost-urls-segments_encoded_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-segments_encoded_base-front,`front`>> 
| Return the first segment

| <<boost-urls-segments_encoded_base-is_absolute,`is&lowbar;absolute`>> 
| Returns true if this references an absolute path&period;

| <<boost-urls-segments_encoded_base-size,`size`>> 
| Return the number of segments

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


This base class is used by the library    to provide common member functions for    containers&period; This cannot be instantiated    directly&semi; Instead, use one of the    containers or functions&colon;


=== Containers

* segments&lowbar;ref
    
* segments&lowbar;view
    
* segments&lowbar;encoded&lowbar;ref
    
* segments&lowbar;encoded&lowbar;view




A Bidirectional iterator to a path segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L102[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----




== Description


Objects of this type allow iteration        through the segments in the path&period;        Strings returned by iterators may        contain percent escapes&period;        The values returned are read&hyphen;only&semi;        changes to segments must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators        are dereferenced refer to the underlying        character buffer&period;        Ownership is not transferred&semi; the caller        is responsible for ensuring that the        lifetime of the buffer extends until        it is no longer referenced by any        container or iterator&period;




Return the last segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L304[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
back() const noexcept;
----

== Description


This function returns a string with the        last segment of the path without any        leading or trailing &apos;&sol;&apos; separators&period;        The returned string may contain        percent escapes&period;


=== Preconditions

[,cpp]
----
this->empty() == false
----

=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).encoded_segments().back() == "file.txt" );
----

=== Preconditions

[,cpp]
----
this->empty() == false
----

=== Effects

[,cpp]
----
return *--end();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return an iterator to the beginning

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L317[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
begin() const noexcept;
----

== Description



=== Complexity

Linear in `this&hyphen;&gt;front()&period;size()` or        constant if `this&hyphen;&gt;empty()`&period;


=== Exception Safety

Throws nothing&period;




Return the referenced character buffer&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L181[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
buffer() const noexcept;
----

== Description


This function returns the character        buffer referenced by the view&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).encoded_segments().buffer() == "/path/to/file.txt" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return true if there are no segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L218[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( ! url_view( "/index.htm" ).encoded_segments().empty() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return an iterator to the end

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L329[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
end() const noexcept;
----

== Description



=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the first segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L267[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
front() const noexcept;
----

== Description


This function returns a string with the        first segment of the path without any        leading or trailing &apos;&sol;&apos; separators&period;        The returned string may contain        percent escapes&period;


=== Preconditions

[,cpp]
----
this->empty() == false
----

=== Effects

[,cpp]
----
return *begin();
----

=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).encoded_segments().front() == "path" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Returns true if this references an absolute path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L201[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;absolute() const noexcept;
----

== Description


Absolute paths always start with a        forward slash (&apos;&sol;&apos;)&period;


=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).encoded_segments().is_absolute() == true );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the maximum number of characters possible

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L154[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
static
std::size&lowbar;t
max&lowbar;size() noexcept;
----

== Description


This represents the largest number of        characters that are possible in a path,        not including any null terminator&period;


=== Exception Safety

Throws nothing&period;




== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L45[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>>(&sol;&ast; implementation-defined &ast;&sol;::path&lowbar;ref const& ref) noexcept;
----

[.small]#<<boost-urls-segments_encoded_base,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>>() = default;
----

[.small]#<<boost-urls-segments_encoded_base,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>>(<<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>> const&) = default;
----

[.small]#<<boost-urls-segments_encoded_base,_» more..._>>#


Return the number of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L235[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
size() const noexcept;
----

== Description



=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).encoded_segments().size() == 3 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




A Bidirectional iterator to a path segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L106[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = <<boost-urls-segments_encoded_base-iterator,iterator>>;
----

== Description


Objects of this type allow iteration        through the segments in the path&period;        Strings returned by iterators may        contain percent escapes&period;        The values returned are read&hyphen;only&semi;        changes to segments must be made        through the container instead, if the        container supports modification&period;

The strings produced when iterators        are dereferenced refer to the underlying        character buffer&period;        Ownership is not transferred&semi; the caller        is responsible for ensuring that the        lifetime of the buffer extends until        it is no longer referenced by any        container or iterator&period;




The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L129[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;




A signed integer type used to represent differences&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L137[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using difference&lowbar;type = std::ptrdiff&lowbar;t;
----


The reference type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L126[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>;
----

== Description


This is the type of value returned when        iterators of the view are dereferenced&period;




An unsigned integer type used to represent size&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L133[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using size&lowbar;type = std::size&lowbar;t;
----


The value type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L119[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = std::string;
----

== Description


Values of this type represent a segment        where unique ownership is retained by        making a copy&period;


=== Example

[,cpp]
----
segments_encoded_base::value_type ps( url_view( "/path/to/file.txt" ).encoded_segments().back() );
----



A view representing path segments in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L88[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class segments&lowbar;encoded&lowbar;ref
    : public <<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_encoded_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-segments_encoded_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-segments_encoded_base-iterator,`iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_encoded_base-reference,`reference`>> 
| The reference type

| <<boost-urls-segments_encoded_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type used to represent size&period;

| <<boost-urls-segments_encoded_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_ref-assign,`assign`>> 
| Assign segments


| <<boost-urls-segments_encoded_base-back,`back`>> 
| Return the last segment

| <<boost-urls-segments_encoded_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-segments_encoded_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-segments_encoded_ref-clear,`clear`>> 
| Clear the contents of the container

| <<boost-urls-segments_encoded_base-empty,`empty`>> 
| Return true if there are no segments

| <<boost-urls-segments_encoded_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-segments_encoded_ref-erase,`erase`>> 
| Erase segments


| <<boost-urls-segments_encoded_base-front,`front`>> 
| Return the first segment

| <<boost-urls-segments_encoded_ref-insert,`insert`>> 
| Insert segments


| <<boost-urls-segments_encoded_base-is_absolute,`is&lowbar;absolute`>> 
| Returns true if this references an absolute path&period;

| <<boost-urls-segments_encoded_ref-2conversion,`operator segments&lowbar;encoded&lowbar;view`>> 
| Conversion

| <<boost-urls-segments_encoded_ref-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-segments_encoded_ref-pop_back,`pop&lowbar;back`>> 
| Remove the last segment

| <<boost-urls-segments_encoded_ref-push_back,`push&lowbar;back`>> 
| Append a segment

| <<boost-urls-segments_encoded_ref-replace,`replace`>> 
| Replace segments


| <<boost-urls-segments_encoded_ref-2constructor-0a,`segments&lowbar;encoded&lowbar;ref`>>         [.small]#[constructor]#
| Constructor

| <<boost-urls-segments_encoded_base-size,`size`>> 
| Return the number of segments

| <<boost-urls-segments_encoded_ref-url,`url`>> 
| Return the referenced url

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


Objects of this type are used to interpret    the path as a bidirectional view of segments,    where each segment is a string which may    contain percent&hyphen;escapes&period;

The view does not retain ownership of the    elements and instead references the original    character buffer&period; The caller is responsible    for ensuring that the lifetime of the buffer    extends until it is no longer referenced&period;

The view is modifiable&semi; calling non&hyphen;const    members causes changes to the referenced    url&period;


=== Example

[,cpp]
----
url u( "/path/to/file.txt" );

segments_encoded_ref ps = u.encoded_segments();
----
The strings returned when iterators are    dereferenced have type xref:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]    and may contain percent&hyphen;escapes&period;

Reserved characters in inputs are    automatically escaped&period;    Escapes in inputs are preserved&period;

Exceptions are thrown on invalid inputs&period;


=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;    Modifications made through the container    invalidate some or all iterators&colon; 

* push&lowbar;back
 &colon; Only 
`end()`
&period;
* assign
, 
clear
,        
operator&equals;
 &colon; All elements&period;
* erase
 &colon; Erased elements and all        elements after (including 
`end()`
)&period;
* insert
 &colon; All elements at or after        the insertion point (including 
`end()`
)&period;
* replace
 &colon; Modified        elements and all elements
        after (including 
`end()`
)&period;



== See Also


xref:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view],        xref:#boost-urls-segments_view[segments&lowbar;view],        xref:#boost-urls-segments_ref[segments&lowbar;ref]&period;





Assign segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L320[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
<<boost-urls-segments_encoded_ref-assign-0e,assign>>(std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-segments_encoded_ref-assign-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-segments_encoded_ref-assign-0b,assign>>(
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-segments_encoded_ref-assign-0b,_» more..._>>#

== Description


The existing contents are replaced        by a copy of the contents of the        initializer list&period;        Reserved characters in the list are        automatically escaped&period;        Escapes in the list are preserved&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by the list may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Example

[,cpp]
----
url u;

u.segments().assign( {"path", "to", "file.txt"} );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *init*
| The list of segments to assign&period;


| *first*
| The first element in the range&period;


| *last*
| One past the last element in the range&period;


|===


Assign segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L360[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
assign(
    FwdIt first,
    FwdIt last);
----

== Description


The existing contents are replaced        by a copy of the contents of the range&period;        Reserved characters in the range are        automatically escaped&period;        Escapes in the range are preserved&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by the range may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, pct_string_view >::value == true
----

=== Complexity

Linear in `std&colon;&colon;distance( first, last ) &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *first*
| The first element in the range&period;


| *last*
| One past the last element in the range&period;


|===


Assign segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L320[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
assign(std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

== Description


The existing contents are replaced        by a copy of the contents of the        initializer list&period;        Reserved characters in the list are        automatically escaped&period;        Escapes in the list are preserved&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by the list may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Example

[,cpp]
----
url u;

u.segments().assign( {"path", "to", "file.txt"} );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *init*
| The list of segments to assign&period;


|===


Clear the contents of the container

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L278[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
clear() noexcept;
----

== Description


All iterators are invalidated&period;


=== Effects

[,cpp]
----
this->url().set_encoded_path( "" );
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Throws nothing&period;




Erase segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L531[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-erase-006,erase>>(<<boost-urls-segments_encoded_base-iterator,iterator>> pos) noexcept;
----

[.small]#<<boost-urls-segments_encoded_ref-erase-006,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-erase-00a,erase>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> first,
    <<boost-urls-segments_encoded_base-iterator,iterator>> last) noexcept;
----

[.small]#<<boost-urls-segments_encoded_ref-erase-00a,_» more..._>>#

== Description


This function removes a segment&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


| *first,*
| last The range of        segments to erase&period;


|===


Erase segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L531[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
erase(<<boost-urls-segments_encoded_base-iterator,iterator>> pos) noexcept;
----

== Description


This function removes a segment&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the element&period;


|===


Erase segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L557[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
erase(
    <<boost-urls-segments_encoded_base-iterator,iterator>> first,
    <<boost-urls-segments_encoded_base-iterator,iterator>> last) noexcept;
----

== Description


This function removes a range of segments        from the container&period;

All iterators that are equal to        `first` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed range&period;



== Parameters


|===
| Name | Description

| *first,*
| last The range of        segments to erase&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L399[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-insert-04e,insert>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

[.small]#<<boost-urls-segments_encoded_ref-insert-04e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-insert-0d,insert>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-segments_encoded_ref-insert-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-insert-07,insert>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-segments_encoded_ref-insert-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-insert-07,insert>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::input&lowbar;iterator&lowbar;tag) = delete;
----

[.small]#<<boost-urls-segments_encoded_ref-insert-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-insert-07,insert>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::forward&lowbar;iterator&lowbar;tag);
----

[.small]#<<boost-urls-segments_encoded_ref-insert-07,_» more..._>>#

== Description


This function inserts a segment        before the specified position&period;        Reserved characters in the segment are        automatically escaped&period;        Escapes in the segment are preserved&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The segment contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the inserted        segment&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the segment is inserted&period; This may        be equal to `end()`&period;


| *s*
| The segment to insert&period;


| *init*
| The list of segments to insert&period;


| *first*
| The first element in the range to insert&period;


| *last*
| One past the last element in the range to insert&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L503[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_encoded_base-iterator,iterator>>
insert(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

== Description


This function inserts the segments in        a range before the specified position&period;        Reserved characters in the range are        automatically escaped&period;        Escapes in the range are preserved&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
None of the character buffers referenced        by the range may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, pct_string_view >::value == true
----

=== Complexity

Linear in `std&colon;&colon;distance( first, last ) &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        segment inserted, or `before` if        `init&period;empty()`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the range is inserted&period; This may        be equal to `end()`&period;


| *first*
| The first element in the range to insert&period;


| *last*
| One past the last element in the range to insert&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L399[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
insert(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function inserts a segment        before the specified position&period;        Reserved characters in the segment are        automatically escaped&period;        Escapes in the segment are preserved&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The segment contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the inserted        segment&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the segment is inserted&period; This may        be equal to `end()`&period;


| *s*
| The segment to insert&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L452[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
insert(
    <<boost-urls-segments_encoded_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

== Description


This function inserts the segments        in an initializer list before the        specified position&period;        Reserved characters in the list are        automatically escaped&period;        Escapes in the list are preserved&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
None of the character buffers referenced        by the list may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Example

[,cpp]
----
url u( "/file.txt" );

u.encoded_segments().insert( u.encoded_segments().begin(), { "path", "to" } );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        element inserted, or `before` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the list is inserted&period; This may        be equal to `end()`&period;


| *init*
| The list of segments to insert&period;


|===


Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L221[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator <<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>() const noexcept;
----

== See Also


xref:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view]&period;





Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L159[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>&
<<boost-urls-segments_encoded_ref-operator_assign-02c,operator&equals;>>(<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>> const& other);
----

[.small]#<<boost-urls-segments_encoded_ref-operator_assign-02c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>&
<<boost-urls-segments_encoded_ref-operator_assign-02e,operator&equals;>>(<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>> const& other);
----

[.small]#<<boost-urls-segments_encoded_ref-operator_assign-02e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>&
<<boost-urls-segments_encoded_ref-operator_assign-08,operator&equals;>>(std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-segments_encoded_ref-operator_assign-08,_» more..._>>#

== Description


The existing contents are replaced        by a copy of the other segments&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `other` may overlap the buffer of the        underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *other*
| The segments to assign&period;


| *init*
| The list of segments to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L159[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>&
operator&equals;(<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>> const& other);
----

== Description


The existing contents are replaced        by a copy of the other segments&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `other` may overlap the buffer of the        underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The segments to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L164[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>&
operator&equals;(<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>> const& other);
----

== Description


The existing contents are replaced        by a copy of the other segments&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `other` may overlap the buffer of the        underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The segments to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L211[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>&
operator&equals;(std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

== Description


The existing contents are replaced        by a copy of the contents of the        initializer list&period;        Reserved characters in the list are        automatically escaped&period;        Escapes in the list are preserved&period;

All iterators are invalidated&period;


=== Example

[,cpp]
----
url u;

u.encoded_segments() = {"path", "to", "file.txt"};
----

=== Preconditions

None of the character buffers referenced        by the list may overlap the character buffer        of the underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( init.begin(), init.end() );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *init*
| The list of segments to assign&period;


|===


Remove the last segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L774[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
pop&lowbar;back() noexcept;
----

== Description


This function removes the last segment        from the container&period;

Iterators to the last segment as well        as all end iterators are invalidated&period;


=== Preconditions

[,cpp]
----
!this->empty()
----

=== Exception Safety

Throws nothing&period;




Append a segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L753[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
push&lowbar;back(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function appends a segment to        the end of the path&period;        Reserved characters in the string are        automatically escaped&period;        Escapes in the string are preserved&period;

All end iterators are invalidated&period;


=== Postconditions

[,cpp]
----
this->back() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The string contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The segment to append&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L590[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-replace-07,replace>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> pos,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

[.small]#<<boost-urls-segments_encoded_ref-replace-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-replace-06,replace>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> from,
    <<boost-urls-segments_encoded_base-iterator,iterator>> to,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

[.small]#<<boost-urls-segments_encoded_ref-replace-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-replace-08,replace>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> from,
    <<boost-urls-segments_encoded_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

[.small]#<<boost-urls-segments_encoded_ref-replace-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_encoded_base-iterator,iterator>>
<<boost-urls-segments_encoded_ref-replace-0f,replace>>(
    <<boost-urls-segments_encoded_base-iterator,iterator>> from,
    <<boost-urls-segments_encoded_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-segments_encoded_ref-replace-0f,_» more..._>>#

== Description


This function replaces the segment at        the specified position&period;        Reserved characters in the string are        automatically escaped&period;        Escapes in the string are preserved&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The string contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the replaced segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the segment&period;


| *s*
| The string to assign&period;


| *from*
| The first element in the range of segments to replace&period;


| *to*
| One past the last element in the range of segments to replace&period;


| *init*
| The list of segments to assign&period;


| *first*
| The first element in the new range of segments&period;


| *last*
| One past the last element in the new range of segments&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L717[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_encoded_base-iterator,iterator>>
replace(
    <<boost-urls-segments_encoded_base-iterator,iterator>> from,
    <<boost-urls-segments_encoded_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

== Description


This function replaces a range of        segments with annother range of segments&period;        Reserved characters in the new range are        automatically escaped&period;        Escapes in the new range are preserved&period;

All iterators that are equal to        `from` or come after are invalidated&period;


=== Preconditions

None of the character buffers referenced        by the new range may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Complexity

Linear in `std&colon;&colon;distance( first, last ) &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        segment inserted, or one past `to` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *from*
| The first element in the range of segments to replace&period;


| *to*
| One past the last element in the range of segments to replace&period;


| *first*
| The first element in the new range of segments&period;


| *last*
| One past the last element in the new range of segments&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L590[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
replace(
    <<boost-urls-segments_encoded_base-iterator,iterator>> pos,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function replaces the segment at        the specified position&period;        Reserved characters in the string are        automatically escaped&period;        Escapes in the string are preserved&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the replaced segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the segment&period;


| *s*
| The string to assign&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L626[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
replace(
    <<boost-urls-segments_encoded_base-iterator,iterator>> from,
    <<boost-urls-segments_encoded_base-iterator,iterator>> to,
    <<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function replaces a range of        segments with one segment&period;        Reserved characters in the string are        automatically escaped&period;        Escapes in the string are preserved&period;

All iterators that are equal to        `from` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The string contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the new segment&period;



== Parameters


|===
| Name | Description

| *from*
| The first element in the range of segments to replace&period;


| *to*
| One past the last element in the range of segments to replace&period;


| *s*
| The string to assign&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L672[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_base-iterator,iterator>>
replace(
    <<boost-urls-segments_encoded_base-iterator,iterator>> from,
    <<boost-urls-segments_encoded_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt; init);
----

== Description


This function replaces a range of        segments with a list of segments in        an initializer list&period;        Reserved characters in the list are        automatically escaped&period;        Escapes in the list are preserved&period;

All iterators that are equal to        `from` or come after are invalidated&period;


=== Preconditions

None of the character buffers referenced        by the list may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the first        segment inserted, or one past `to` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *from*
| The first element in the range of segments to replace&period;


| *to*
| One past the last element in the range of segments to replace&period;


| *init*
| The list of segments to assign&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L95[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>(<<boost-urls-url_base,url&lowbar;base>>& u) noexcept;
----

[.small]#<<boost-urls-segments_encoded_ref,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_encoded_ref-2constructor-0a,segments&lowbar;encoded&lowbar;ref>>(<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>> const& other) = default;
----

[.small]#<<boost-urls-segments_encoded_ref-2constructor-0a,_» more..._>>#

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L127[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
segments&lowbar;encoded&lowbar;ref(<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>> const& other) = default;
----

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


|===


Return the referenced url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L245[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
url() const noexcept;
----

== Description


This function returns the url referenced        by the view&period;


=== Example

[,cpp]
----
url u( "/path/to/file.txt" );

assert( &u.encoded_segments().url() == &u );
----

=== Exception Safety

Throws nothing&period;




A view representing path segments in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L61[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class segments&lowbar;encoded&lowbar;view
    : public <<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_encoded_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-segments_encoded_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-segments_encoded_base-iterator,`iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_encoded_base-reference,`reference`>> 
| The reference type

| <<boost-urls-segments_encoded_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type used to represent size&period;

| <<boost-urls-segments_encoded_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-back,`back`>> 
| Return the last segment

| <<boost-urls-segments_encoded_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-segments_encoded_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-segments_encoded_base-empty,`empty`>> 
| Return true if there are no segments

| <<boost-urls-segments_encoded_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-segments_encoded_base-front,`front`>> 
| Return the first segment

| <<boost-urls-segments_encoded_base-is_absolute,`is&lowbar;absolute`>> 
| Returns true if this references an absolute path&period;

| <<boost-urls-segments_encoded_view-2conversion,`operator segments&lowbar;view`>> 
| Conversion

| <<boost-urls-segments_encoded_view-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-segments_encoded_view-2constructor,`segments&lowbar;encoded&lowbar;view`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-segments_encoded_base-size,`size`>> 
| Return the number of segments

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_encoded_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===
== Friends

[cols=1]
|===
| Name 

| <<boost-urls-segments_encoded_view-08friend-01,`parse&lowbar;path`>> 
|===



== Description


Objects of this type are used to interpret    the path as a bidirectional view of segment    strings&period;

The view does not retain ownership of the    elements and instead references the original    character buffer&period; The caller is responsible    for ensuring that the lifetime of the buffer    extends until it is no longer referenced&period;


=== Example

[,cpp]
----
url_view u( "/path/to/file.txt" );

segments_encoded_view ps = u.encoded_segments();

assert( ps.buffer().data() == u.buffer().data() );
----
Strings produced when elements are returned    have type xref:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view] and represent    encoded strings&period; Strings passed to member    functions may contain percent escapes, and    throw exceptions on invalid inputs&period;


=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;



== See Also


xref:#boost-urls-segments_view[segments&lowbar;view],        xref:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref],        xref:#boost-urls-segments_ref[segments&lowbar;ref]&period;





Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L226[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator <<boost-urls-segments_view,segments&lowbar;view>>() const noexcept;
----

== Description


This conversion returns a new view which        references the same underlying character        buffer, and whose iterators and members        return ordinary strings with decoding        applied to any percent escapes&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Example

[,cpp]
----
segments_view ps = parse_path( "/path/to/file.txt" ).value();
----

=== Postconditions

[,cpp]
----
segments_view( *this ).buffer().data() == this->buffer().data()
----

=== Complexity

Constant


=== Exception Safety

Throws nothing




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L192[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>&
operator&equals;(<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>> const&) = default;
----

== Description


After assignment, both views        reference the same underlying character        buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L67[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>(&sol;&ast; implementation-defined &ast;&sol;::path&lowbar;ref const& ref) noexcept;
----

[.small]#<<boost-urls-segments_encoded_view,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_encoded_view-2constructor-0c,segments&lowbar;encoded&lowbar;view>>() = default;
----

[.small]#<<boost-urls-segments_encoded_view-2constructor-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_encoded_view-2constructor-0b,segments&lowbar;encoded&lowbar;view>>(<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>> const&) noexcept = default;
----

[.small]#<<boost-urls-segments_encoded_view-2constructor-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_view-2constructor-02,segments&lowbar;encoded&lowbar;view>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-segments_encoded_view-2constructor-02,_» more..._>>#

== Description


Default&hyphen;constructed segments have        zero elements&period;


=== Example

[,cpp]
----
segments_encoded_view ps;
----

=== Effects

[,cpp]
----
return segments_encoded_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid path&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L92[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
segments&lowbar;encoded&lowbar;view() = default;
----

== Description


Default&hyphen;constructed segments have        zero elements&period;


=== Example

[,cpp]
----
segments_encoded_view ps;
----

=== Effects

[,cpp]
----
return segments_encoded_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L115[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
segments&lowbar;encoded&lowbar;view(<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>> const&) noexcept = default;
----

== Description


After construction, both views        reference the same character buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L167[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
segments&lowbar;encoded&lowbar;view(core::string&lowbar;view s);
----

== Description


This function constructs segments from        a valid path string, which can contain        percent escapes&period;        Upon construction, the view references        the character buffer pointed to by `s`&period;        caller is responsible for ensuring        that the lifetime of the buffer        extends until the view is destroyed&period;


=== Example

[,cpp]
----
segments_encoded_view ps( "/path/to/file.txt" );
----

=== Effects

[,cpp]
----
return parse_path( s ).value();
----

=== Postconditions

[,cpp]
----
this->buffer().data() == s.data()
----

=== Complexity

Linear in `s`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
path = [ "/" ] [ segment *( "/" segment ) ]

segment = *pchar
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid path&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L232[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
system::result&lt;<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>&gt;
parse&lowbar;path(core::string&lowbar;view s) noexcept;
----


A view representing path segments in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L85[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class segments&lowbar;ref
    : public <<boost-urls-segments_base,segments&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-segments_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-segments_base-iterator,`iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_base-reference,`reference`>> 
| The reference type

| <<boost-urls-segments_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type used to represent size&period;

| <<boost-urls-segments_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_ref-assign,`assign`>> 
| Assign segments


| <<boost-urls-segments_base-back,`back`>> 
| Return the last segment

| <<boost-urls-segments_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-segments_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-segments_ref-clear,`clear`>> 
| Clear the contents of the container

| <<boost-urls-segments_base-empty,`empty`>> 
| Return true if there are no segments

| <<boost-urls-segments_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-segments_ref-erase,`erase`>> 
| Erase segments


| <<boost-urls-segments_base-front,`front`>> 
| Return the first segment

| <<boost-urls-segments_ref-insert,`insert`>> 
| Insert segments


| <<boost-urls-segments_base-is_absolute,`is&lowbar;absolute`>> 
| Returns true if this references an absolute path&period;

| <<boost-urls-segments_ref-2conversion,`operator segments&lowbar;view`>> 
| Conversion

| <<boost-urls-segments_ref-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-segments_ref-pop_back,`pop&lowbar;back`>> 
| Remove the last segment

| <<boost-urls-segments_ref-push_back,`push&lowbar;back`>> 
| Append a segment

| <<boost-urls-segments_ref-replace,`replace`>> 
| Replace segments


| <<boost-urls-segments_ref-2constructor-09,`segments&lowbar;ref`>>         [.small]#[constructor]#
| Constructor

| <<boost-urls-segments_base-size,`size`>> 
| Return the number of segments

| <<boost-urls-segments_ref-url,`url`>> 
| Return the referenced url

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


Objects of this type are used to interpret    the path as a bidirectional view of segments,    where each segment is a string with percent    escapes automatically decoded&period;

The view does not retain ownership of the    elements and instead references the original    character buffer&period; The caller is responsible    for ensuring that the lifetime of the buffer    extends until it is no longer referenced&period;

The view is modifiable&semi; calling non&hyphen;const    members causes changes to the referenced    url&period;


=== Example

[,cpp]
----
url u( "/path/to/file.txt" );

segments_ref ps = u.segments();
----
Percent escapes in strings returned when    dereferencing iterators are automatically    decoded&period;    Reserved characters in strings supplied    to modifier functions are automatically    percent&hyphen;escaped&period;


=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;    Modifications made through the container    invalidate some or all iterators&colon; 

* push&lowbar;back
 &colon; Only 
`end()`
&period;
* assign
, 
clear
,        
operator&equals;
 &colon; All elements&period;
* erase
 &colon; Erased elements and all        elements after (including 
`end()`
)&period;
* insert
 &colon; All elements at or after        the insertion point (including 
`end()`
)&period;
* replace
 &colon; Modified        elements and all elements
        after (including 
`end()`
)&period;



== See Also


xref:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref],        xref:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view],        xref:#boost-urls-segments_view[segments&lowbar;view]&period;





Assign segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L307[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
<<boost-urls-segments_ref-assign-08,assign>>(std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#<<boost-urls-segments_ref-assign-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
<<boost-urls-segments_ref-assign-0d,assign>>(
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-segments_ref-assign-0d,_» more..._>>#

== Description


The existing contents are replaced        by a copy of the contents of the        initializer list&period;        Reserved characters in the list are        automatically escaped&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `init` may overlap the character buffer        of the underlying url, or else the behavior        is undefined&period;


=== Example

[,cpp]
----
url u;

u.segments().assign( { "path", "to", "file.txt" } );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *init*
| The list of segments to assign&period;


| *first*
| The beginning of the range of segments to assign&period;


| *last*
| The end of the range of segments to assign&period;


|===


Assign segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L342[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
assign(
    FwdIt first,
    FwdIt last);
----

== Description


The existing contents are replaced        by a copy of the contents of the range&period;        Reserved characters in the range are        automatically escaped&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by the range may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, core::string_view >::value == true
----

=== Complexity

Linear in `std&colon;&colon;distance( first, last ) &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *first*
| The beginning of the range of segments to assign&period;


| *last*
| The end of the range of segments to assign&period;


|===


Assign segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L307[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
assign(std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

== Description


The existing contents are replaced        by a copy of the contents of the        initializer list&period;        Reserved characters in the list are        automatically escaped&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `init` may overlap the character buffer        of the underlying url, or else the behavior        is undefined&period;


=== Example

[,cpp]
----
url u;

u.segments().assign( { "path", "to", "file.txt" } );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *init*
| The list of segments to assign&period;


|===


Clear the contents of the container

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L270[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
clear() noexcept;
----

== Description


All iterators are invalidated&period;


=== Effects

[,cpp]
----
this->url().set_encoded_path( "" );
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Throws nothing&period;




Erase segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L497[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-erase-0af2,erase>>(<<boost-urls-segments_base-iterator,iterator>> pos) noexcept;
----

[.small]#<<boost-urls-segments_ref-erase-0af2,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-erase-0af5,erase>>(
    <<boost-urls-segments_base-iterator,iterator>> first,
    <<boost-urls-segments_base-iterator,iterator>> last) noexcept;
----

[.small]#<<boost-urls-segments_ref-erase-0af5,_» more..._>>#

== Description


This function removes a segment&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the segment&period;


| *first*
| The beginning of the range to remove&period;


| *last*
| The end of the range to remove&period;


|===


Erase segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L497[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
erase(<<boost-urls-segments_base-iterator,iterator>> pos) noexcept;
----

== Description


This function removes a segment&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the segment&period;


|===


Erase segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L522[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
erase(
    <<boost-urls-segments_base-iterator,iterator>> first,
    <<boost-urls-segments_base-iterator,iterator>> last) noexcept;
----

== Description


This function removes a range of segments&period;

All iterators that are equal to        `first` or come after are invalidated&period;


=== Complexity

Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


An iterator to one past        the removed range&period;



== Parameters


|===
| Name | Description

| *first*
| The beginning of the range to remove&period;


| *last*
| The end of the range to remove&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L376[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-insert-050,insert>>(
    <<boost-urls-segments_base-iterator,iterator>> before,
    core::string&lowbar;view s);
----

[.small]#<<boost-urls-segments_ref-insert-050,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-insert-09,insert>>(
    <<boost-urls-segments_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#<<boost-urls-segments_ref-insert-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-insert-07,insert>>(
    <<boost-urls-segments_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-segments_ref-insert-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-insert-07,insert>>(
    <<boost-urls-segments_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::input&lowbar;iterator&lowbar;tag) = delete;
----

[.small]#<<boost-urls-segments_ref-insert-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-insert-07,insert>>(
    <<boost-urls-segments_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last,
    std::forward&lowbar;iterator&lowbar;tag);
----

[.small]#<<boost-urls-segments_ref-insert-07,_» more..._>>#

== Description


This function inserts a segment        before the specified position&period;        Reserved characters in the segment are        automatically escaped&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the inserted        segment&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the segment is inserted&period; This may        be equal to `end()`&period;


| *s*
| The segment to insert&period;


| *init*
| The list of segments to insert&period;


| *first*
| The beginning of the range of segments to insert&period;


| *last*
| The end of the range of segments to insert&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L469[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_base-iterator,iterator>>
insert(
    <<boost-urls-segments_base-iterator,iterator>> before,
    FwdIt first,
    FwdIt last);
----

== Description


This function inserts the segments in        a range before the specified position&period;        Reserved characters in the list are        automatically escaped&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
None of the character buffers referenced        by the range may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, core::string_view >::value == true
----

=== Complexity

Linear in `std&colon;&colon;distance( first, last ) &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        segment inserted, or `before` if        `init&period;empty()`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the range is inserted&period; This may        be equal to `end()`&period;


| *first*
| The beginning of the range of segments to insert&period;


| *last*
| The end of the range of segments to insert&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L376[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
insert(
    <<boost-urls-segments_base-iterator,iterator>> before,
    core::string&lowbar;view s);
----

== Description


This function inserts a segment        before the specified position&period;        Reserved characters in the segment are        automatically escaped&period;

All iterators that are equal to        `before` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the inserted        segment&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the segment is inserted&period; This may        be equal to `end()`&period;


| *s*
| The segment to insert&period;


|===


Insert segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L424[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
insert(
    <<boost-urls-segments_base-iterator,iterator>> before,
    std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

== Description


This function inserts the segments        in an initializer list before the        specified position&period;        Reserved characters in the list are        percent&hyphen;escaped in the result&period;

All iterators that are equal to        `before` or come after are invalidated&period;

[NOTE]
None of the character buffers referenced        by the list may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Example

[,cpp]
----
url u( "/file.txt" );

u.segments().insert( u.segments().begin(), { "path", "to" } );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resource()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        element inserted, or `before` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the list is inserted&period; This may        be equal to `end()`&period;


| *init*
| The list of segments to insert&period;


|===


Conversion

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L213[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator <<boost-urls-segments_view,segments&lowbar;view>>() const noexcept;
----

== See Also


xref:#boost-urls-segments_view[segments&lowbar;view]&period;





Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L156[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_ref,segments&lowbar;ref>>&
<<boost-urls-segments_ref-operator_assign-0d,operator&equals;>>(<<boost-urls-segments_ref,segments&lowbar;ref>> const& other);
----

[.small]#<<boost-urls-segments_ref-operator_assign-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_ref,segments&lowbar;ref>>&
<<boost-urls-segments_ref-operator_assign-08,operator&equals;>>(<<boost-urls-segments_view,segments&lowbar;view>> const& other);
----

[.small]#<<boost-urls-segments_ref-operator_assign-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_ref,segments&lowbar;ref>>&
<<boost-urls-segments_ref-operator_assign-0f,operator&equals;>>(std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#<<boost-urls-segments_ref-operator_assign-0f,_» more..._>>#

== Description


The existing contents are replaced        by a copy of the other segments&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `other` may overlap the buffer of the        underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The segments to assign&period;


| *init*
| The list of segments to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L156[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_ref,segments&lowbar;ref>>&
operator&equals;(<<boost-urls-segments_ref,segments&lowbar;ref>> const& other);
----

== Description


The existing contents are replaced        by a copy of the other segments&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `other` may overlap the buffer of the        underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The segments to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L161[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_ref,segments&lowbar;ref>>&
operator&equals;(<<boost-urls-segments_view,segments&lowbar;view>> const& other);
----

== Description


The existing contents are replaced        by a copy of the other segments&period;

All iterators are invalidated&period;

[NOTE]
None of the character buffers referenced        by `other` may overlap the buffer of the        underlying url, or else the behavior        is undefined&period;


=== Effects

[,cpp]
----
this->assign( other.begin(), other.end() );
----

=== Complexity

Linear in `other&period;buffer()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *other*
| The segments to assign&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L203[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_ref,segments&lowbar;ref>>&
operator&equals;(std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

== Description


The existing contents are replaced        by a copy of the contents of the        initializer list&period;        Reserved characters in the list are        automatically escaped&period;

All iterators are invalidated&period;


=== Example

[,cpp]
----
url u;

u.segments() = { "path", "to", "file.txt" };
----

=== Preconditions

None of the character buffers referenced        by the list may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Effects

[,cpp]
----
this->assign( init.begin(), init.end() );
----

=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;query()&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;fragment()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *init*
| The list of segments to assign&period;


|===


Remove the last segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L716[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
pop&lowbar;back() noexcept;
----

== Description


This function removes the last segment        from the container&period;

Iterators to the last segment as well        as all end iterators are invalidated&period;


=== Preconditions

[,cpp]
----
not this->empty()
----

=== Exception Safety

Throws nothing&period;




Append a segment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L695[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
push&lowbar;back(core::string&lowbar;view s);
----

== Description


This function appends a segment to        the end of the path&period;        Reserved characters in the string are        automatically escaped&period;

All end iterators are invalidated&period;


=== Postconditions

[,cpp]
----
this->back() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *s*
| The segment to append&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L554[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-replace-05,replace>>(
    <<boost-urls-segments_base-iterator,iterator>> pos,
    core::string&lowbar;view s);
----

[.small]#<<boost-urls-segments_ref-replace-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-replace-04,replace>>(
    <<boost-urls-segments_base-iterator,iterator>> from,
    <<boost-urls-segments_base-iterator,iterator>> to,
    core::string&lowbar;view s);
----

[.small]#<<boost-urls-segments_ref-replace-04,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-replace-02,replace>>(
    <<boost-urls-segments_base-iterator,iterator>> from,
    <<boost-urls-segments_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#<<boost-urls-segments_ref-replace-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_base-iterator,iterator>>
<<boost-urls-segments_ref-replace-07,replace>>(
    <<boost-urls-segments_base-iterator,iterator>> from,
    <<boost-urls-segments_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

[.small]#<<boost-urls-segments_ref-replace-07,_» more..._>>#

== Description


This function replaces the segment at        the specified position&period;        Reserved characters in the string are        automatically escaped&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the replaced segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the segment&period;


| *s*
| The string to assign&period;


| *from*
| The beginning of the range of segments to replace&period;


| *to*
| The end of the range of segments to replace&period;


| *init*
| The list of segments to assign&period;


| *first*
| The beginning of the range of segments to assign&period;


| *last*
| The end of the range of segments to assign&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L666[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
<<boost-urls-segments_base-iterator,iterator>>
replace(
    <<boost-urls-segments_base-iterator,iterator>> from,
    <<boost-urls-segments_base-iterator,iterator>> to,
    FwdIt first,
    FwdIt last);
----

== Description


This function replaces a range of        segments with annother range of segments&period;        Reserved characters in the new range are        automatically escaped&period;

All iterators that are equal to        `from` or come after are invalidated&period;


=== Preconditions

None of the character buffers referenced        by the new range may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Complexity

Linear in `std&colon;&colon;distance( first, last ) &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        segment inserted, or one past `to` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *from*
| The beginning of the range of segments to replace&period;


| *to*
| The end of the range of segments to replace&period;


| *first*
| The beginning of the range of segments to assign&period;


| *last*
| The end of the range of segments to assign&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L554[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
replace(
    <<boost-urls-segments_base-iterator,iterator>> pos,
    core::string&lowbar;view s);
----

== Description


This function replaces the segment at        the specified position&period;        Reserved characters in the string are        automatically escaped&period;

All iterators that are equal to        `pos` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the replaced segment&period;



== Parameters


|===
| Name | Description

| *pos*
| An iterator to the segment&period;


| *s*
| The string to assign&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L585[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
replace(
    <<boost-urls-segments_base-iterator,iterator>> from,
    <<boost-urls-segments_base-iterator,iterator>> to,
    core::string&lowbar;view s);
----

== Description


This function replaces a range of        segments with one segment&period;        Reserved characters in the string are        automatically escaped&period;

All iterators that are equal to        `from` or come after are invalidated&period;


=== Complexity

Linear in `s&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the new segment&period;



== Parameters


|===
| Name | Description

| *from*
| The beginning of the range of segments to replace&period;


| *to*
| The end of the range of segments to replace&period;


| *s*
| The string to assign&period;


|===


Replace segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L626[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_base-iterator,iterator>>
replace(
    <<boost-urls-segments_base-iterator,iterator>> from,
    <<boost-urls-segments_base-iterator,iterator>> to,
    std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

== Description


This function replaces a range of        segments with a list of segments in        an initializer list&period;        Reserved characters in the list are        automatically escaped&period;

All iterators that are equal to        `from` or come after are invalidated&period;


=== Preconditions

None of the character buffers referenced        by the list may overlap the character        buffer of the underlying url, or else        the behavior is undefined&period;


=== Complexity

Linear in `init&period;size() &plus; this&hyphen;&gt;url()&period;encoded&lowbar;resouce()&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Return Value


An iterator to the first        segment inserted, or one past `to` if        `init&period;size() &equals;&equals; 0`&period;



== Parameters


|===
| Name | Description

| *from*
| The beginning of the range of segments to replace&period;


| *to*
| The end of the range of segments to replace&period;


| *init*
| The list of segments to assign&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L93[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_ref,segments&lowbar;ref>>(<<boost-urls-url_base,url&lowbar;base>>& u) noexcept;
----

[.small]#<<boost-urls-segments_ref,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_ref-2constructor-09,segments&lowbar;ref>>(<<boost-urls-segments_ref,segments&lowbar;ref>> const& other) = default;
----

[.small]#<<boost-urls-segments_ref-2constructor-09,_» more..._>>#

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L124[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
segments&lowbar;ref(<<boost-urls-segments_ref,segments&lowbar;ref>> const& other) = default;
----

== Description


After construction, both views        reference the same url&period; Ownership is not        transferred&semi; the caller is responsible        for ensuring the lifetime of the url        extends until it is no longer        referenced&period;


=== Postconditions

[,cpp]
----
&this->url() == &other.url();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The other view&period;


|===


Return the referenced url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L237[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
url() const noexcept;
----

== Description


This function returns the url referenced        by the view&period;


=== Example

[,cpp]
----
url u( "/path/to/file.txt" );

assert( &u.segments().url() == &u );
----

=== Exception Safety

Throws nothing&period;




A view representing path segments in a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L55[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class segments&lowbar;view
    : public <<boost-urls-segments_base,segments&lowbar;base>>;
----

== Types

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-const_iterator,`const&lowbar;iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_base-const_reference,`const&lowbar;reference`>> 
| The reference type

| <<boost-urls-segments_base-difference_type,`difference&lowbar;type`>> 
| A signed integer type used to represent differences&period;

| <<boost-urls-segments_base-iterator,`iterator`>> 
| A Bidirectional iterator to a path segment

| <<boost-urls-segments_base-reference,`reference`>> 
| The reference type

| <<boost-urls-segments_base-size_type,`size&lowbar;type`>> 
| An unsigned integer type used to represent size&period;

| <<boost-urls-segments_base-value_type,`value&lowbar;type`>> 
| The value type

|===
== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-back,`back`>> 
| Return the last segment

| <<boost-urls-segments_base-begin,`begin`>> 
| Return an iterator to the beginning

| <<boost-urls-segments_base-buffer,`buffer`>> 
| Return the referenced character buffer&period;

| <<boost-urls-segments_base-empty,`empty`>> 
| Return true if there are no segments

| <<boost-urls-segments_base-end,`end`>> 
| Return an iterator to the end

| <<boost-urls-segments_base-front,`front`>> 
| Return the first segment

| <<boost-urls-segments_base-is_absolute,`is&lowbar;absolute`>> 
| Returns true if this references an absolute path&period;

| <<boost-urls-segments_view-operator_assign,`operator&equals;`>> 
| Assignment

| <<boost-urls-segments_view-2constructor,`segments&lowbar;view`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-segments_base-size,`size`>> 
| Return the number of segments

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-segments_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===



== Description


Objects of this type are used to interpret    the path as a bidirectional view of segment    strings&period;

The view does not retain ownership of the    elements and instead references the original    character buffer&period; The caller is responsible    for ensuring that the lifetime of the buffer    extends until it is no longer referenced&period;


=== Example

[,cpp]
----
url_view u( "/path/to/file.txt" );

segments_view ps = u.segments();

assert( ps.buffer().data() == u.buffer().data() );
----
Percent escapes in strings returned when    dereferencing iterators are automatically    decoded&period;


=== Iterator Invalidation

Changes to the underlying character buffer    can invalidate iterators which reference it&period;



== See Also


xref:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view],        xref:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref],        xref:#boost-urls-segments_ref[segments&lowbar;ref]&period;





Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L188[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_view,segments&lowbar;view>>&
operator&equals;(<<boost-urls-segments_view,segments&lowbar;view>> const& other) = default;
----

== Description


After assignment, both views        reference the same underlying character        buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L62[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_view,segments&lowbar;view>>(&sol;&ast; implementation-defined &ast;&sol;::path&lowbar;ref const& ref) noexcept;
----

[.small]#<<boost-urls-segments_view,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_view-2constructor-0c,segments&lowbar;view>>() = default;
----

[.small]#<<boost-urls-segments_view-2constructor-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
<<boost-urls-segments_view-2constructor-0d,segments&lowbar;view>>(<<boost-urls-segments_view,segments&lowbar;view>> const& other) = default;
----

[.small]#<<boost-urls-segments_view-2constructor-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_view-2constructor-0e,segments&lowbar;view>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-segments_view-2constructor-0e,_» more..._>>#

== Description


Default&hyphen;constructed segments have        zero elements&period;


=== Example

[,cpp]
----
segments_view ps;
----

=== Effects

[,cpp]
----
return segments_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid path&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L87[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
segments&lowbar;view() = default;
----

== Description


Default&hyphen;constructed segments have        zero elements&period;


=== Example

[,cpp]
----
segments_view ps;
----

=== Effects

[,cpp]
----
return segments_view( "" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L111[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
segments&lowbar;view(<<boost-urls-segments_view,segments&lowbar;view>> const& other) = default;
----

== Description


After construction, viewss        reference the same underlying character        buffer&period;

Ownership is not transferred&semi; the caller        is responsible for ensuring the lifetime        of the buffer extends until it is no        longer referenced&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant


=== Exception Safety

Throws nothing




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L163[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
segments&lowbar;view(core::string&lowbar;view s);
----

== Description


This function constructs segments from        a valid path string, which can contain        percent escapes&period;        Upon construction, the view references        the character buffer pointed to by `s`&period;        caller is responsible for ensuring        that the lifetime of the buffer        extends until the view is destroyed&period;


=== Example

[,cpp]
----
segments_view ps( "/path/to/file.txt" );
----

=== Effects

[,cpp]
----
return parse_path( s ).value();
----

=== Postconditions

[,cpp]
----
this->buffer().data() == s.data()
----

=== Complexity

Linear in `s`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
path = [ "/" ] [ segment *( "/" segment ) ]

segment = *pchar
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid path&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


A modifiable container for a URL&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L106[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::size&lowbar;t Capacity&gt;
class static&lowbar;url
    : public <<boost-urls-static_url_base,static&lowbar;url&lowbar;base>>;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-authority,`authority`>> 
| Return the authority

| <<boost-urls-url_view_base-buffer,`buffer`>> 
| Return the url string

| <<boost-urls-url_base-c_str,`c&lowbar;str`>> 
| Return the url as a null&hyphen;terminated string

| <<boost-urls-url_base-capacity,`capacity`>> 
| Return the number of characters that can be stored without reallocating

| <<boost-urls-url_base-clear,`clear`>> 
| Clear the contents while preserving the capacity

| <<boost-urls-url_view_base-compare,`compare`>> 
| Return the result of comparing this with another url

| <<boost-urls-url_view_base-data,`data`>> 
| Return a pointer to the url&apos;s character buffer

| <<boost-urls-url_view_base-empty,`empty`>> 
| Return true if the url is empty

| <<boost-urls-url_view_base-encoded_authority,`encoded&lowbar;authority`>> 
| Return the authority&period;

| <<boost-urls-url_view_base-encoded_fragment,`encoded&lowbar;fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-encoded_host,`encoded&lowbar;host`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_address,`encoded&lowbar;host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_and_port,`encoded&lowbar;host&lowbar;and&lowbar;port`>> 
| Return the host and port

| <<boost-urls-url_view_base-encoded_host_name,`encoded&lowbar;host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-encoded_origin,`encoded&lowbar;origin`>> 
| Return the origin

| <<boost-urls-url_base-encoded_params,`encoded&lowbar;params`>> 
| Return the query as a container of parameters


| <<boost-urls-url_view_base-encoded_password,`encoded&lowbar;password`>> 
| Return the password

| <<boost-urls-url_view_base-encoded_path,`encoded&lowbar;path`>> 
| Return the path

| <<boost-urls-url_view_base-encoded_query,`encoded&lowbar;query`>> 
| Return the query

| <<boost-urls-url_view_base-encoded_resource,`encoded&lowbar;resource`>> 
| Return the resource

| <<boost-urls-url_base-encoded_segments,`encoded&lowbar;segments`>> 
| Return the path as a container of segments


| <<boost-urls-url_view_base-encoded_target,`encoded&lowbar;target`>> 
| Return the target

| <<boost-urls-url_view_base-encoded_user,`encoded&lowbar;user`>> 
| Return the user

| <<boost-urls-url_view_base-encoded_userinfo,`encoded&lowbar;userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-encoded_zone_id,`encoded&lowbar;zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url_view_base-fragment,`fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-has_authority,`has&lowbar;authority`>> 
| Return true if an authority is present

| <<boost-urls-url_view_base-has_fragment,`has&lowbar;fragment`>> 
| Return true if a fragment is present

| <<boost-urls-url_view_base-has_password,`has&lowbar;password`>> 
| Return true if a password is present

| <<boost-urls-url_view_base-has_port,`has&lowbar;port`>> 
| Return true if a port is present

| <<boost-urls-url_view_base-has_query,`has&lowbar;query`>> 
| Return true if a query is present

| <<boost-urls-url_view_base-has_scheme,`has&lowbar;scheme`>> 
| Return true a scheme is present

| <<boost-urls-url_view_base-has_userinfo,`has&lowbar;userinfo`>> 
| Return true if a userinfo is present

| <<boost-urls-url_view_base-host,`host`>> 
| Return the host

| <<boost-urls-url_view_base-host_address,`host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-host_ipv4_address,`host&lowbar;ipv4&lowbar;address`>> 
| Return the host IPv4 address

| <<boost-urls-url_view_base-host_ipv6_address,`host&lowbar;ipv6&lowbar;address`>> 
| Return the host IPv6 address

| <<boost-urls-url_view_base-host_ipvfuture,`host&lowbar;ipvfuture`>> 
| Return the host IPvFuture address

| <<boost-urls-url_view_base-host_name,`host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-host_type,`host&lowbar;type`>> 
| Return the host type

| <<boost-urls-url_view_base-is_path_absolute,`is&lowbar;path&lowbar;absolute`>> 
| Return true if the path is absolute

| <<boost-urls-static_url-normalize,`normalize`>> 
| Normalize the URL components


| <<boost-urls-static_url-normalize_authority,`normalize&lowbar;authority`>> 
| Normalize the URL authority


| <<boost-urls-static_url-normalize_fragment,`normalize&lowbar;fragment`>> 
| Normalize the URL fragment


| <<boost-urls-static_url-normalize_path,`normalize&lowbar;path`>> 
| Normalize the URL path


| <<boost-urls-static_url-normalize_query,`normalize&lowbar;query`>> 
| Normalize the URL query


| <<boost-urls-static_url-normalize_scheme,`normalize&lowbar;scheme`>> 
| Normalize the URL scheme


| <<boost-urls-url_view_base-2conversion,`operator core::string&lowbar;view`>> 
| Return the URL as a core&colon;&colon;string&lowbar;view

| <<boost-urls-static_url-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-url_base-params,`params`>> 
| Return the query as a container of parameters

xref:#boost-urls-url_view_base-params-05[url&lowbar;view&lowbar;base&colon;&colon;params]


| <<boost-urls-url_view_base-password,`password`>> 
| Return the password

| <<boost-urls-url_view_base-path,`path`>> 
| Return the path

| <<boost-urls-url_view_base-persist,`persist`>> 
| Return a shared, persistent copy of the url

| <<boost-urls-url_view_base-port,`port`>> 
| Return the port

| <<boost-urls-url_view_base-port_number,`port&lowbar;number`>> 
| Return the port

| <<boost-urls-url_view_base-query,`query`>> 
| Return the query

| <<boost-urls-static_url-remove_authority,`remove&lowbar;authority`>> 
| Remove the authority


| <<boost-urls-static_url-remove_fragment,`remove&lowbar;fragment`>> 
| Remove the fragment


| <<boost-urls-static_url-remove_origin,`remove&lowbar;origin`>> 
| Remove the origin component


| <<boost-urls-static_url-remove_password,`remove&lowbar;password`>> 
| Remove the password


| <<boost-urls-static_url-remove_port,`remove&lowbar;port`>> 
| Remove the port


| <<boost-urls-static_url-remove_query,`remove&lowbar;query`>> 
| Remove the query


| <<boost-urls-static_url-remove_scheme,`remove&lowbar;scheme`>> 
| Remove the scheme


| <<boost-urls-static_url-remove_userinfo,`remove&lowbar;userinfo`>> 
| Remove the userinfo


| <<boost-urls-url_base-reserve,`reserve`>> 
| Adjust the capacity without changing the size

| <<boost-urls-url_base-resolve,`resolve`>> 
| Resolve a URL reference against this base URL

| <<boost-urls-url_view_base-scheme,`scheme`>> 
| Return the scheme

| <<boost-urls-url_view_base-scheme_id,`scheme&lowbar;id`>> 
| Return the scheme

| <<boost-urls-url_base-segments,`segments`>> 
| Return the path as a container of segments


| <<boost-urls-static_url-set_encoded_authority,`set&lowbar;encoded&lowbar;authority`>> 
| Set the authority


| <<boost-urls-static_url-set_encoded_fragment,`set&lowbar;encoded&lowbar;fragment`>> 
| Set the fragment&period;


| <<boost-urls-static_url-set_encoded_host,`set&lowbar;encoded&lowbar;host`>> 
| Set the host


| <<boost-urls-static_url-set_encoded_host_address,`set&lowbar;encoded&lowbar;host&lowbar;address`>> 
| Set the host to an address


| <<boost-urls-static_url-set_encoded_host_name,`set&lowbar;encoded&lowbar;host&lowbar;name`>> 
| Set the host to a name


| <<boost-urls-url_base-set_encoded_params,`set&lowbar;encoded&lowbar;params`>> 
| Set the query params

| <<boost-urls-static_url-set_encoded_password,`set&lowbar;encoded&lowbar;password`>> 
| Set the password&period;


| <<boost-urls-static_url-set_encoded_path,`set&lowbar;encoded&lowbar;path`>> 
| Set the path&period;


| <<boost-urls-static_url-set_encoded_query,`set&lowbar;encoded&lowbar;query`>> 
| Set the query


| <<boost-urls-static_url-set_encoded_user,`set&lowbar;encoded&lowbar;user`>> 
| Set the user


| <<boost-urls-static_url-set_encoded_userinfo,`set&lowbar;encoded&lowbar;userinfo`>> 
| Set the userinfo&period;


| <<boost-urls-static_url-set_fragment,`set&lowbar;fragment`>> 
| Set the fragment&period;


| <<boost-urls-static_url-set_host,`set&lowbar;host`>> 
| Set the host


| <<boost-urls-static_url-set_host_address,`set&lowbar;host&lowbar;address`>> 
| Set the host to an address


| <<boost-urls-static_url-set_host_ipv4,`set&lowbar;host&lowbar;ipv4`>> 
| Set the host to an address


| <<boost-urls-static_url-set_host_ipv6,`set&lowbar;host&lowbar;ipv6`>> 
| Set the host to an address


| <<boost-urls-static_url-set_host_ipvfuture,`set&lowbar;host&lowbar;ipvfuture`>> 
| Set the host to an address


| <<boost-urls-static_url-set_host_name,`set&lowbar;host&lowbar;name`>> 
| Set the host to a name


| <<boost-urls-static_url-set_params,`set&lowbar;params`>> 
| Set the query params


| <<boost-urls-static_url-set_password,`set&lowbar;password`>> 
| Set the password&period;


| <<boost-urls-static_url-set_path,`set&lowbar;path`>> 
| Set the path&period;


| <<boost-urls-url_base-set_path_absolute,`set&lowbar;path&lowbar;absolute`>> 
| Set if the path is absolute

| <<boost-urls-static_url-set_port,`set&lowbar;port`>> 
| Set the port


| <<boost-urls-static_url-set_port_number,`set&lowbar;port&lowbar;number`>> 
| Set the port


| <<boost-urls-static_url-set_query,`set&lowbar;query`>> 
| Set the query


| <<boost-urls-static_url-set_scheme,`set&lowbar;scheme`>> 
| Set the scheme


| <<boost-urls-static_url-set_scheme_id,`set&lowbar;scheme&lowbar;id`>> 
| Set the scheme


| <<boost-urls-static_url-set_user,`set&lowbar;user`>> 
| Set the user


| <<boost-urls-static_url-set_userinfo,`set&lowbar;userinfo`>> 
| Set the userinfo


| <<boost-urls-url_view_base-size,`size`>> 
| Return the number of characters in the url

| <<boost-urls-static_url-2constructor,`static&lowbar;url`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-url_view_base-user,`user`>> 
| Return the user

| <<boost-urls-url_view_base-userinfo,`userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-zone_id,`zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-static_url-2destructor,`&#126;static&lowbar;url`>> [.small]#[destructor]# [.small]#[virtual]#
| Destructor

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-08friend-02,`operator!&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-05,`operator&lt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-0ff,`operator&lt;&lt;`>> 
| Format the url to the output stream

| <<boost-urls-url_view_base-08friend-04a,`operator&lt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-07c,`operator&equals;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-073,`operator&gt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-06,`operator&gt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_base-08friend,`resolve`>> 
| 

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-digest,`digest`>> 
| Calculate a hash of the url

|===


== Description


This container owns a url, represented    by an inline, null&hyphen;terminated character    buffer with fixed capacity&period;    The contents may be inspected and modified,    and the implementation maintains a useful    invariant&colon; changes to the url always    leave it in a valid state&period;


=== Example

[,cpp]
----
static_url< 1024 > u( "https://www.example.com" );
----

=== Invariants

[,cpp]
----
this->capacity() == Capacity + 1
----


== Template Parameters


|===
| Name | Description

| *Capacity*
| The maximum capacity    in characters, not including the    null terminator&period;


|===

== See Also


xref:#boost-urls-url[url],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Normalize the URL components

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L425[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
normalize();
----

== Description


Applies Syntax&hyphen;based normalization to        all components of the URL&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L429[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
normalize&lowbar;authority();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL authority&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L435[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
normalize&lowbar;fragment();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL fragment&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL path

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L431[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
normalize&lowbar;path();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL path&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period; Redundant        path&hyphen;segments are removed&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L433[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
normalize&lowbar;query();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL query&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L427[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
normalize&lowbar;scheme();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL scheme&period;

The scheme is normalized to lowercase&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L298[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
<<boost-urls-static_url-operator_assign-06,operator&equals;>>(<<boost-urls-static_url,static&lowbar;url>> const& u) noexcept;
----

[.small]#<<boost-urls-static_url-operator_assign-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
<<boost-urls-static_url-operator_assign-0c,operator&equals;>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

[.small]#<<boost-urls-static_url-operator_assign-0c,_» more..._>>#

== Description


The contents of `u` are copied and        the previous contents of `this` are        discarded&period;        Capacity remains unchanged&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| Capacity would be exceeded&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L298[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
operator&equals;(<<boost-urls-static_url,static&lowbar;url>> const& u) noexcept;
----

== Description


The contents of `u` are copied and        the previous contents of `this` are        discarded&period;        Capacity remains unchanged&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L330[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
operator&equals;(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

== Description


The contents of `u` are copied and        the previous contents of `this` are        discarded&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Exception thrown if capacity exceeded&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| Capacity would be exceeded&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Remove the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L354[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;authority();
----

== Description


This function removes the authority,        which includes the userinfo, host, and        a port if present&period;


=== Example

[,cpp]
----
assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[            3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_authority[set&lowbar;encoded&lowbar;authority]&period;





Remove the fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L415[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;fragment() noexcept;
----

== Description


This function removes the fragment&period;        An empty fragment is distinct from        having no fragment&period;


=== Example

[,cpp]
----
assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == false && this->encoded_fragment() == ""
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_encoded_fragment[set&lowbar;encoded&lowbar;fragment],            xref:#boost-urls-url_base-set_fragment[set&lowbar;fragment]&period;





Remove the origin component

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L422[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;origin();
----

== Description


This function removes the origin, which        consists of the scheme and authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" );
----

=== Postconditions

[,cpp]
----
this->scheme_id() == scheme::none && this->has_authority() == false
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;




Remove the password

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L371[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;password() noexcept;
----

== Description


This function removes the password from        the userinfo if a password exists&period; If        there is no userinfo or no authority,        the call has no effect&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" );
----

=== Postconditions

[,cpp]
----
this->has_password() == false && this->encoded_password().empty() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_password[set&lowbar;password],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Remove the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L396[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;port() noexcept;
----

== Description


If a port exists, it is removed&period; The rest        of the authority is unchanged&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" );
----

=== Postconditions

[,cpp]
----
this->has_port() == false && this->port_number() == 0 && this->port() == ""
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Remove the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L412[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;query() noexcept;
----

== Description


If a query is present, it is removed&period;        An empty query is distinct from having        no query&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" );
----

=== Postconditions

[,cpp]
----
this->has_query() == false && this->params().empty()
----

=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Remove the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L349[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;scheme();
----

== Description


This function removes the scheme if it        is present&period;


=== Example

[,cpp]
----
assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" );
----

=== Postconditions

[,cpp]
----
this->has_scheme() == false && this->scheme_id() == scheme::none
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_scheme[set&lowbar;scheme]&period;





Remove the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L361[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
remove&lowbar;userinfo() noexcept;
----

== Description


This function removes the userinfo if        present, without removing any authority&period;


=== Example

[,cpp]
----
assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false );
----

=== Postconditions

[,cpp]
----
this->has_userinfo() == false && this->encoded_userinfo().empty == true
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_userinfo[set&lowbar;encoded&lowbar;userinfo],            xref:#boost-urls-url_base-set_userinfo[set&lowbar;userinfo]&period;





Set the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L352[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;authority(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the authority        to the specified string&period;        The string may contain percent&hyphen;escapes&period;


=== Example

[,cpp]
----
assert( url().set_encoded_authority( "My%20Computer" ).has_authority() );
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[            3&period;2&period; Authority (rfc3986)]
        



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;eror`
| The string contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The authority string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_authority[remove&lowbar;authority]&period;





Set the fragment&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L419[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;fragment(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the fragment to the        specified string, which may contain        percent&hyphen;escapes and which may be empty&period;        An empty fragment is distinct from        having no fragment&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == true && this->fragment() == decode_view( s )
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_fragment[set&lowbar;fragment]&period;





Set the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L376[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;host(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address        enclosed in square brackets, then the
        host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture        address enclosed in square brackets, then
        the host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string&period; This string can contain percent
        escapes, or can be empty&period;        Escapes in the string are preserved,
        and reserved characters in the string        are percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L380[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;host&lowbar;address(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string&period; This string can contain percent
        escapes, or can be empty&period;        Escapes in the string are preserved,
        and reserved characters in the string        are percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255

IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal

IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to a name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L390[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;host&lowbar;name(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


The host is set to the specified string,        which may contain percent&hyphen;escapes and        can be empty&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name]&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the password&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L369[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;password(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the password in        the userinfo to the string, which        may contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" );
----

=== Postconditions

[,cpp]
----
this->has_password() == true
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period; This string may        contain any characters, including nulls&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L403[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;path(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the path to the        string, which may contain percent&hyphen;escapes        and can be empty&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;

[NOTE]
The library may adjust the final result        to ensure that no other parts of the url        is semantically affected&period;


=== Example

[,cpp]
----
url u( "http://www.example.com" );

u.set_encoded_path( "path/to/file.txt" );

assert( u.encoded_path() == "/path/to/file.txt" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-segments-04[segments],            xref:#boost-urls-url_base-set_path[set&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Set the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L408[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;query(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This sets the query to the string, which        may contain percent&hyphen;escapes and can be        empty&period;        An empty query is distinct from having        no query&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true && this->query() == decode_view( s );
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L365[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;user(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the user part of the        userinfo the the string, which may        contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_userinfo() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_password[set&lowbar;password],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the userinfo&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L359[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;encoded&lowbar;userinfo(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


The userinfo is set to the given string,        which may contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;        The effects on the user and password        depend on the presence of a colon (&apos;&colon;&apos;)        in the string&colon;

* If an unescaped colon exists, the        characters up to the colon become
        the user and the rest of the characters        after the colon become the password&period;
        In this case 
has&lowbar;password
 returns        true&period; Otherwise,
* If there is no colon, the user is        set to the string&period; The function
        
has&lowbar;password
 returns false&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_userinfo[remove&lowbar;userinfo],            xref:#boost-urls-url_base-set_userinfo[set&lowbar;userinfo]&period;





Set the fragment&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L417[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;fragment(core::string&lowbar;view s);
----

== Description


This function sets the fragment to the        specified string, which may be empty&period;        An empty fragment is distinct from        having no fragment&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == true && this->fragment() == s
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_encoded_fragment[set&lowbar;encoded&lowbar;fragment]&period;





Set the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L374[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;host(core::string&lowbar;view s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address        enclosed in square brackets, then the
        host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture        address enclosed in square brackets, then
        the host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string, which may be empty&period;
        Reserved characters in the string are        percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L378[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;host&lowbar;address(core::string&lowbar;view s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string, which may be empty&period;
        Reserved characters in the string are        percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255

IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal

IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L382[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;host&lowbar;ipv4(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr);
----

== Description


The host is set to the specified IPv4        address&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv4]&period;


=== Example

[,cpp]
----
assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" );
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *addr*
| The address to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L384[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;host&lowbar;ipv6(<<boost-urls-ipv6_address,ipv6&lowbar;address>> const& addr);
----

== Description


The host is set to the specified IPv6        address&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv6]&period;


=== Example

[,cpp]
----
assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *addr*
| The address to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L386[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;host&lowbar;ipvfuture(core::string&lowbar;view s);
----

== Description


The host is set to the specified IPvFuture        string&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipvfuture]&period;


=== Example

[,cpp]
----
assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to a name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L388[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;host&lowbar;name(core::string&lowbar;view s);
----

== Description


The host is set to the specified string,        which may be empty&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name]&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture]&period;





Set the query params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L410[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;params(
    std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; ps,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opts = &lcub;&rcub;);
----

== Description


This sets the query params to the list        of param&lowbar;view, which can be empty&period;

An empty list of params is distinct from        having no params&period;

Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Complexity

Linear&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
            >3.4.  Query (rfc3986)</a>
        @li <a href=[&colon;&sol;&sol;en&period;wikipedia&period;org&sol;wiki&sol;Query&lowbar;string&quot;            &gt;Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *ps*
| The params to set&period;


| *opts*
| The options for encoding&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the password&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L367[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;password(core::string&lowbar;view s);
----

== Description


This function sets the password in        the userinfo to the string&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" );
----

=== Postconditions

[,cpp]
----
this->has_password() == true && this->password() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period; This string may        contain any characters, including nulls&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L401[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;path(core::string&lowbar;view s);
----

== Description


This function sets the path to the        string, which may be empty&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;

[NOTE]
The library may adjust the final result        to ensure that no other parts of the url        is semantically affected&period;

[NOTE]
This function does not encode &apos;&sol;&apos; chars, which        are unreserved for paths but reserved for        path segments&period; If a path segment should include        encoded &apos;&sol;&apos;s to differentiate it from path separators,        the functions xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path] or xref:#boost-urls-url_base-segments-04[segments]        should be used instead&period;


=== Example

[,cpp]
----
url u( "http://www.example.com" );

u.set_path( "path/to/file.txt" );

assert( u.path() == "/path/to/file.txt" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-segments-04[segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Set the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L394[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;port(core::string&lowbar;view s);
----

== Description


This port is set to the string, which        must contain only digits or be empty&period;        An empty port string is distinct from        having no port&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" );
----

=== Postconditions

[,cpp]
----
this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n)
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` does not contain a valid port&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The port string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_port[remove&lowbar;port],            xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Set the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L392[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;port&lowbar;number(std::uint16&lowbar;t n);
----

== Description


The port is set to the specified integer&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_port() == true && this->port_number() == n
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== Parameters


|===
| Name | Description

| *n*
| The port number to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_port[remove&lowbar;port],            xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Set the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L406[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;query(core::string&lowbar;view s);
----

== Description


This sets the query to the string, which        can be empty&period;        An empty query is distinct from having        no query&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true && this->query() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query]&period;





Set the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L345[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;scheme(core::string&lowbar;view s);
----

== Description


The scheme is set to the specified        string, which must contain a valid        scheme without any trailing colon        (&apos;&colon;&apos;)&period;        Note that schemes are case&hyphen;insensitive,        and the canonical form is lowercased&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid scheme&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The scheme to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_scheme[remove&lowbar;scheme]&period;





Set the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L347[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;scheme&lowbar;id(<<boost-urls,urls>>::<<boost-urls-scheme,scheme>> id);
----

== Description


This function sets the scheme to the specified        known xref:#boost-urls-scheme[urls&colon;&colon;scheme] id, which may not be        xref:#boost-urls-scheme[scheme&colon;&colon;unknown] or else an exception is        thrown&period; If the id is xref:#boost-urls-scheme[scheme&colon;&colon;none], this        function behaves as if xref:#boost-urls-url_base-remove_scheme[remove&lowbar;scheme]        were called&period;


=== Example

[,cpp]
----
assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" );
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The scheme is invalid&period;


|===

== Parameters


|===
| Name | Description

| *id*
| The scheme to set&period;


|===


Set the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L363[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;user(core::string&lowbar;view s);
----

== Description


This function sets the user part of the        userinfo to the string&period;        Any special or reserved characters in the        string are automatically percent&hyphen;encoded&period;


=== Example

[,cpp]
----
assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_userinfo() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_password[set&lowbar;password]&period;





Set the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L357[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url,static&lowbar;url>>&
set&lowbar;userinfo(core::string&lowbar;view s);
----

== Description


The userinfo is set to the given string,        which may contain percent&hyphen;escapes&period;        Any special or reserved characters in the        string are automatically percent&hyphen;encoded&period;        The effects on the user and password        depend on the presence of a colon (&apos;&colon;&apos;)        in the string&colon;

* If an unescaped colon exists, the        characters up to the colon become
        the user and the rest of the characters        after the colon become the password&period;
        In this case 
has&lowbar;password
 returns        true&period; Otherwise,
* If there is no colon, the user is        set to the string&period; The function
        
has&lowbar;password
 returns false&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_userinfo[remove&lowbar;userinfo],            xref:#boost-urls-url_base-set_encoded_userinfo[set&lowbar;encoded&lowbar;userinfo]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L165[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url-2constructor-098,static&lowbar;url>>() noexcept;
----

[.small]#<<boost-urls-static_url-2constructor-098,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-static_url-2constructor-08,static&lowbar;url>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-static_url-2constructor-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url-2constructor-09f,static&lowbar;url>>(<<boost-urls-static_url,static&lowbar;url>> const& u) noexcept;
----

[.small]#<<boost-urls-static_url-2constructor-09f,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url-2constructor-0b,static&lowbar;url>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

[.small]#<<boost-urls-static_url-2constructor-0b,_» more..._>>#

== Description


Default constructed urls contain        a zero&hyphen;length string&period; This matches        the grammar for a relative&hyphen;ref with        an empty path and no query or        fragment&period;


=== Example

[,cpp]
----
static_url< 1024 > u;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input does not contain a valid url&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


| *u*
| The url to copy&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L165[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static&lowbar;url() noexcept;
----

== Description


Default constructed urls contain        a zero&hyphen;length string&period; This matches        the grammar for a relative&hyphen;ref with        an empty path and no query or        fragment&period;


=== Example

[,cpp]
----
static_url< 1024 > u;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L217[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
static&lowbar;url(core::string&lowbar;view s);
----

== Description


This function constructs a url from        the string `s`, which must contain a        valid _URI_ or _relative&hyphen;ref_        or else an exception is thrown&period;        The new url retains ownership by        making a copy of the passed string&period;


=== Example

[,cpp]
----
static_url< 1024 > u( "https://www.example.com" );
----

=== Effects

[,cpp]
----
return static_url( parse_uri_reference( s ).value() );
----

=== Postconditions

[,cpp]
----
this->buffer().data() != s.data()
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4&period;1&period; URI Reference]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input does not contain a valid url&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L243[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static&lowbar;url(<<boost-urls-static_url,static&lowbar;url>> const& u) noexcept;
----

== Description


The newly constructed object contains        a copy of `u`&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer.data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Exception thrown if maximum size exceeded&period;



== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L271[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static&lowbar;url(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

== Description


The newly constructed object contains        a copy of `u`&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer.data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Exception thrown if capacity exceeded&period;



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| Capacity would be exceeded&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L130[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
&#126;static&lowbar;url() = default;
----

== Description


Any params, segments, iterators, or        views which reference this object are        invalidated&period; The underlying character        buffer is destroyed, invalidating all        references to it&period;




Common implementation for all static URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L52[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class static&lowbar;url&lowbar;base
    : public <<boost-urls-url_base,url&lowbar;base>>;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-authority,`authority`>> 
| Return the authority

| <<boost-urls-url_view_base-buffer,`buffer`>> 
| Return the url string

| <<boost-urls-url_base-c_str,`c&lowbar;str`>> 
| Return the url as a null&hyphen;terminated string

| <<boost-urls-url_base-capacity,`capacity`>> 
| Return the number of characters that can be stored without reallocating

| <<boost-urls-url_base-clear,`clear`>> 
| Clear the contents while preserving the capacity

| <<boost-urls-url_view_base-compare,`compare`>> 
| Return the result of comparing this with another url

| <<boost-urls-url_view_base-data,`data`>> 
| Return a pointer to the url&apos;s character buffer

| <<boost-urls-url_view_base-empty,`empty`>> 
| Return true if the url is empty

| <<boost-urls-url_view_base-encoded_authority,`encoded&lowbar;authority`>> 
| Return the authority&period;

| <<boost-urls-url_view_base-encoded_fragment,`encoded&lowbar;fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-encoded_host,`encoded&lowbar;host`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_address,`encoded&lowbar;host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_and_port,`encoded&lowbar;host&lowbar;and&lowbar;port`>> 
| Return the host and port

| <<boost-urls-url_view_base-encoded_host_name,`encoded&lowbar;host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-encoded_origin,`encoded&lowbar;origin`>> 
| Return the origin

| <<boost-urls-url_base-encoded_params,`encoded&lowbar;params`>> 
| Return the query as a container of parameters


| <<boost-urls-url_view_base-encoded_password,`encoded&lowbar;password`>> 
| Return the password

| <<boost-urls-url_view_base-encoded_path,`encoded&lowbar;path`>> 
| Return the path

| <<boost-urls-url_view_base-encoded_query,`encoded&lowbar;query`>> 
| Return the query

| <<boost-urls-url_view_base-encoded_resource,`encoded&lowbar;resource`>> 
| Return the resource

| <<boost-urls-url_base-encoded_segments,`encoded&lowbar;segments`>> 
| Return the path as a container of segments


| <<boost-urls-url_view_base-encoded_target,`encoded&lowbar;target`>> 
| Return the target

| <<boost-urls-url_view_base-encoded_user,`encoded&lowbar;user`>> 
| Return the user

| <<boost-urls-url_view_base-encoded_userinfo,`encoded&lowbar;userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-encoded_zone_id,`encoded&lowbar;zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url_view_base-fragment,`fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-has_authority,`has&lowbar;authority`>> 
| Return true if an authority is present

| <<boost-urls-url_view_base-has_fragment,`has&lowbar;fragment`>> 
| Return true if a fragment is present

| <<boost-urls-url_view_base-has_password,`has&lowbar;password`>> 
| Return true if a password is present

| <<boost-urls-url_view_base-has_port,`has&lowbar;port`>> 
| Return true if a port is present

| <<boost-urls-url_view_base-has_query,`has&lowbar;query`>> 
| Return true if a query is present

| <<boost-urls-url_view_base-has_scheme,`has&lowbar;scheme`>> 
| Return true a scheme is present

| <<boost-urls-url_view_base-has_userinfo,`has&lowbar;userinfo`>> 
| Return true if a userinfo is present

| <<boost-urls-url_view_base-host,`host`>> 
| Return the host

| <<boost-urls-url_view_base-host_address,`host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-host_ipv4_address,`host&lowbar;ipv4&lowbar;address`>> 
| Return the host IPv4 address

| <<boost-urls-url_view_base-host_ipv6_address,`host&lowbar;ipv6&lowbar;address`>> 
| Return the host IPv6 address

| <<boost-urls-url_view_base-host_ipvfuture,`host&lowbar;ipvfuture`>> 
| Return the host IPvFuture address

| <<boost-urls-url_view_base-host_name,`host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-host_type,`host&lowbar;type`>> 
| Return the host type

| <<boost-urls-url_view_base-is_path_absolute,`is&lowbar;path&lowbar;absolute`>> 
| Return true if the path is absolute

| <<boost-urls-url_base-normalize,`normalize`>> 
| Normalize the URL components

| <<boost-urls-url_base-normalize_authority,`normalize&lowbar;authority`>> 
| Normalize the URL authority

| <<boost-urls-url_base-normalize_fragment,`normalize&lowbar;fragment`>> 
| Normalize the URL fragment

| <<boost-urls-url_base-normalize_path,`normalize&lowbar;path`>> 
| Normalize the URL path

| <<boost-urls-url_base-normalize_query,`normalize&lowbar;query`>> 
| Normalize the URL query

| <<boost-urls-url_base-normalize_scheme,`normalize&lowbar;scheme`>> 
| Normalize the URL scheme

| <<boost-urls-url_view_base-2conversion,`operator core::string&lowbar;view`>> 
| Return the URL as a core&colon;&colon;string&lowbar;view

| <<boost-urls-url_base-params,`params`>> 
| Return the query as a container of parameters

xref:#boost-urls-url_view_base-params-05[url&lowbar;view&lowbar;base&colon;&colon;params]


| <<boost-urls-url_view_base-password,`password`>> 
| Return the password

| <<boost-urls-url_view_base-path,`path`>> 
| Return the path

| <<boost-urls-url_view_base-persist,`persist`>> 
| Return a shared, persistent copy of the url

| <<boost-urls-url_view_base-port,`port`>> 
| Return the port

| <<boost-urls-url_view_base-port_number,`port&lowbar;number`>> 
| Return the port

| <<boost-urls-url_view_base-query,`query`>> 
| Return the query

| <<boost-urls-url_base-remove_authority,`remove&lowbar;authority`>> 
| Remove the authority

| <<boost-urls-url_base-remove_fragment,`remove&lowbar;fragment`>> 
| Remove the fragment

| <<boost-urls-url_base-remove_origin,`remove&lowbar;origin`>> 
| Remove the origin component

| <<boost-urls-url_base-remove_password,`remove&lowbar;password`>> 
| Remove the password

| <<boost-urls-url_base-remove_port,`remove&lowbar;port`>> 
| Remove the port

| <<boost-urls-url_base-remove_query,`remove&lowbar;query`>> 
| Remove the query

| <<boost-urls-url_base-remove_scheme,`remove&lowbar;scheme`>> 
| Remove the scheme

| <<boost-urls-url_base-remove_userinfo,`remove&lowbar;userinfo`>> 
| Remove the userinfo

| <<boost-urls-url_base-reserve,`reserve`>> 
| Adjust the capacity without changing the size

| <<boost-urls-url_base-resolve,`resolve`>> 
| Resolve a URL reference against this base URL

| <<boost-urls-url_view_base-scheme,`scheme`>> 
| Return the scheme

| <<boost-urls-url_view_base-scheme_id,`scheme&lowbar;id`>> 
| Return the scheme

| <<boost-urls-url_base-segments,`segments`>> 
| Return the path as a container of segments


| <<boost-urls-url_base-set_encoded_authority,`set&lowbar;encoded&lowbar;authority`>> 
| Set the authority

| <<boost-urls-url_base-set_encoded_fragment,`set&lowbar;encoded&lowbar;fragment`>> 
| Set the fragment&period;

| <<boost-urls-url_base-set_encoded_host,`set&lowbar;encoded&lowbar;host`>> 
| Set the host

| <<boost-urls-url_base-set_encoded_host_address,`set&lowbar;encoded&lowbar;host&lowbar;address`>> 
| Set the host to an address

| <<boost-urls-url_base-set_encoded_host_name,`set&lowbar;encoded&lowbar;host&lowbar;name`>> 
| Set the host to a name

| <<boost-urls-url_base-set_encoded_params,`set&lowbar;encoded&lowbar;params`>> 
| Set the query params

| <<boost-urls-url_base-set_encoded_password,`set&lowbar;encoded&lowbar;password`>> 
| Set the password&period;

| <<boost-urls-url_base-set_encoded_path,`set&lowbar;encoded&lowbar;path`>> 
| Set the path&period;

| <<boost-urls-url_base-set_encoded_query,`set&lowbar;encoded&lowbar;query`>> 
| Set the query

| <<boost-urls-url_base-set_encoded_user,`set&lowbar;encoded&lowbar;user`>> 
| Set the user

| <<boost-urls-url_base-set_encoded_userinfo,`set&lowbar;encoded&lowbar;userinfo`>> 
| Set the userinfo&period;

| <<boost-urls-url_base-set_fragment,`set&lowbar;fragment`>> 
| Set the fragment&period;

| <<boost-urls-url_base-set_host,`set&lowbar;host`>> 
| Set the host

| <<boost-urls-url_base-set_host_address,`set&lowbar;host&lowbar;address`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_ipv4,`set&lowbar;host&lowbar;ipv4`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_ipv6,`set&lowbar;host&lowbar;ipv6`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_ipvfuture,`set&lowbar;host&lowbar;ipvfuture`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_name,`set&lowbar;host&lowbar;name`>> 
| Set the host to a name

| <<boost-urls-url_base-set_params,`set&lowbar;params`>> 
| Set the query params

| <<boost-urls-url_base-set_password,`set&lowbar;password`>> 
| Set the password&period;

| <<boost-urls-url_base-set_path,`set&lowbar;path`>> 
| Set the path&period;

| <<boost-urls-url_base-set_path_absolute,`set&lowbar;path&lowbar;absolute`>> 
| Set if the path is absolute

| <<boost-urls-url_base-set_port,`set&lowbar;port`>> 
| Set the port

| <<boost-urls-url_base-set_port_number,`set&lowbar;port&lowbar;number`>> 
| Set the port

| <<boost-urls-url_base-set_query,`set&lowbar;query`>> 
| Set the query

| <<boost-urls-url_base-set_scheme,`set&lowbar;scheme`>> 
| Set the scheme

| <<boost-urls-url_base-set_scheme_id,`set&lowbar;scheme&lowbar;id`>> 
| Set the scheme

| <<boost-urls-url_base-set_user,`set&lowbar;user`>> 
| Set the user

| <<boost-urls-url_base-set_userinfo,`set&lowbar;userinfo`>> 
| Set the userinfo

| <<boost-urls-url_view_base-size,`size`>> 
| Return the number of characters in the url

| <<boost-urls-url_view_base-user,`user`>> 
| Return the user

| <<boost-urls-url_view_base-userinfo,`userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-zone_id,`zone&lowbar;id`>> 
| Return the IPv6 Zone ID

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-08friend-02,`operator!&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-05,`operator&lt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-0ff,`operator&lt;&lt;`>> 
| Format the url to the output stream

| <<boost-urls-url_view_base-08friend-04a,`operator&lt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-07c,`operator&equals;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-073,`operator&gt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-06,`operator&gt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_base-08friend,`resolve`>> 
| 

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-digest,`digest`>> 
| Calculate a hash of the url

|===


== Description


This base class is used by the library    to provide common functionality for    static URLs&period; Users should not use this    class directly&period; Instead, construct an    instance of one of the containers    or call a parsing function&period;


=== Containers

* url
        
* url&lowbar;view
        
* static&lowbar;url


=== Parsing Functions

* parse&lowbar;absolute&lowbar;uri
        
* parse&lowbar;origin&lowbar;form
        
* parse&lowbar;relative&lowbar;ref
        
* parse&lowbar;uri
        
* parse&lowbar;uri&lowbar;reference




== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L60[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url_base,static&lowbar;url&lowbar;base>>(
    char* buf,
    std::size&lowbar;t cap) noexcept;
----

[.small]#<<boost-urls-static_url_base,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-static_url_base,static&lowbar;url&lowbar;base>>(
    char* buf,
    std::size&lowbar;t cap,
    core::string&lowbar;view s);
----

[.small]#<<boost-urls-static_url_base,_» more..._>>#


A modifiable container for a URL&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L63[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class url
    : public <<boost-urls-url_base,url&lowbar;base>>;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-authority,`authority`>> 
| Return the authority

| <<boost-urls-url_view_base-buffer,`buffer`>> 
| Return the url string

| <<boost-urls-url_base-c_str,`c&lowbar;str`>> 
| Return the url as a null&hyphen;terminated string

| <<boost-urls-url_base-capacity,`capacity`>> 
| Return the number of characters that can be stored without reallocating

| <<boost-urls-url_base-clear,`clear`>> 
| Clear the contents while preserving the capacity

| <<boost-urls-url_view_base-compare,`compare`>> 
| Return the result of comparing this with another url

| <<boost-urls-url_view_base-data,`data`>> 
| Return a pointer to the url&apos;s character buffer

| <<boost-urls-url_view_base-empty,`empty`>> 
| Return true if the url is empty

| <<boost-urls-url_view_base-encoded_authority,`encoded&lowbar;authority`>> 
| Return the authority&period;

| <<boost-urls-url_view_base-encoded_fragment,`encoded&lowbar;fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-encoded_host,`encoded&lowbar;host`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_address,`encoded&lowbar;host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_and_port,`encoded&lowbar;host&lowbar;and&lowbar;port`>> 
| Return the host and port

| <<boost-urls-url_view_base-encoded_host_name,`encoded&lowbar;host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-encoded_origin,`encoded&lowbar;origin`>> 
| Return the origin

| <<boost-urls-url_base-encoded_params,`encoded&lowbar;params`>> 
| Return the query as a container of parameters


| <<boost-urls-url_view_base-encoded_password,`encoded&lowbar;password`>> 
| Return the password

| <<boost-urls-url_view_base-encoded_path,`encoded&lowbar;path`>> 
| Return the path

| <<boost-urls-url_view_base-encoded_query,`encoded&lowbar;query`>> 
| Return the query

| <<boost-urls-url_view_base-encoded_resource,`encoded&lowbar;resource`>> 
| Return the resource

| <<boost-urls-url_base-encoded_segments,`encoded&lowbar;segments`>> 
| Return the path as a container of segments


| <<boost-urls-url_view_base-encoded_target,`encoded&lowbar;target`>> 
| Return the target

| <<boost-urls-url_view_base-encoded_user,`encoded&lowbar;user`>> 
| Return the user

| <<boost-urls-url_view_base-encoded_userinfo,`encoded&lowbar;userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-encoded_zone_id,`encoded&lowbar;zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url_view_base-fragment,`fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-has_authority,`has&lowbar;authority`>> 
| Return true if an authority is present

| <<boost-urls-url_view_base-has_fragment,`has&lowbar;fragment`>> 
| Return true if a fragment is present

| <<boost-urls-url_view_base-has_password,`has&lowbar;password`>> 
| Return true if a password is present

| <<boost-urls-url_view_base-has_port,`has&lowbar;port`>> 
| Return true if a port is present

| <<boost-urls-url_view_base-has_query,`has&lowbar;query`>> 
| Return true if a query is present

| <<boost-urls-url_view_base-has_scheme,`has&lowbar;scheme`>> 
| Return true a scheme is present

| <<boost-urls-url_view_base-has_userinfo,`has&lowbar;userinfo`>> 
| Return true if a userinfo is present

| <<boost-urls-url_view_base-host,`host`>> 
| Return the host

| <<boost-urls-url_view_base-host_address,`host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-host_ipv4_address,`host&lowbar;ipv4&lowbar;address`>> 
| Return the host IPv4 address

| <<boost-urls-url_view_base-host_ipv6_address,`host&lowbar;ipv6&lowbar;address`>> 
| Return the host IPv6 address

| <<boost-urls-url_view_base-host_ipvfuture,`host&lowbar;ipvfuture`>> 
| Return the host IPvFuture address

| <<boost-urls-url_view_base-host_name,`host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-host_type,`host&lowbar;type`>> 
| Return the host type

| <<boost-urls-url_view_base-is_path_absolute,`is&lowbar;path&lowbar;absolute`>> 
| Return true if the path is absolute

| <<boost-urls-url-normalize,`normalize`>> 
| Normalize the URL components


| <<boost-urls-url-normalize_authority,`normalize&lowbar;authority`>> 
| Normalize the URL authority


| <<boost-urls-url-normalize_fragment,`normalize&lowbar;fragment`>> 
| Normalize the URL fragment


| <<boost-urls-url-normalize_path,`normalize&lowbar;path`>> 
| Normalize the URL path


| <<boost-urls-url-normalize_query,`normalize&lowbar;query`>> 
| Normalize the URL query


| <<boost-urls-url-normalize_scheme,`normalize&lowbar;scheme`>> 
| Normalize the URL scheme


| <<boost-urls-url_view_base-2conversion,`operator core::string&lowbar;view`>> 
| Return the URL as a core&colon;&colon;string&lowbar;view

| <<boost-urls-url-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-url_base-params,`params`>> 
| Return the query as a container of parameters

xref:#boost-urls-url_view_base-params-05[url&lowbar;view&lowbar;base&colon;&colon;params]


| <<boost-urls-url_view_base-password,`password`>> 
| Return the password

| <<boost-urls-url_view_base-path,`path`>> 
| Return the path

| <<boost-urls-url_view_base-persist,`persist`>> 
| Return a shared, persistent copy of the url

| <<boost-urls-url_view_base-port,`port`>> 
| Return the port

| <<boost-urls-url_view_base-port_number,`port&lowbar;number`>> 
| Return the port

| <<boost-urls-url_view_base-query,`query`>> 
| Return the query

| <<boost-urls-url-remove_authority,`remove&lowbar;authority`>> 
| Remove the authority


| <<boost-urls-url-remove_fragment,`remove&lowbar;fragment`>> 
| Remove the fragment


| <<boost-urls-url-remove_origin,`remove&lowbar;origin`>> 
| Remove the origin component


| <<boost-urls-url-remove_password,`remove&lowbar;password`>> 
| Remove the password


| <<boost-urls-url-remove_port,`remove&lowbar;port`>> 
| Remove the port


| <<boost-urls-url-remove_query,`remove&lowbar;query`>> 
| Remove the query


| <<boost-urls-url-remove_scheme,`remove&lowbar;scheme`>> 
| Remove the scheme


| <<boost-urls-url-remove_userinfo,`remove&lowbar;userinfo`>> 
| Remove the userinfo


| <<boost-urls-url_base-reserve,`reserve`>> 
| Adjust the capacity without changing the size

| <<boost-urls-url_base-resolve,`resolve`>> 
| Resolve a URL reference against this base URL

| <<boost-urls-url_view_base-scheme,`scheme`>> 
| Return the scheme

| <<boost-urls-url_view_base-scheme_id,`scheme&lowbar;id`>> 
| Return the scheme

| <<boost-urls-url_base-segments,`segments`>> 
| Return the path as a container of segments


| <<boost-urls-url-set_encoded_authority,`set&lowbar;encoded&lowbar;authority`>> 
| Set the authority


| <<boost-urls-url-set_encoded_fragment,`set&lowbar;encoded&lowbar;fragment`>> 
| Set the fragment&period;


| <<boost-urls-url-set_encoded_host,`set&lowbar;encoded&lowbar;host`>> 
| Set the host


| <<boost-urls-url-set_encoded_host_address,`set&lowbar;encoded&lowbar;host&lowbar;address`>> 
| Set the host to an address


| <<boost-urls-url-set_encoded_host_name,`set&lowbar;encoded&lowbar;host&lowbar;name`>> 
| Set the host to a name


| <<boost-urls-url-set_encoded_params,`set&lowbar;encoded&lowbar;params`>> 
| Set the query params


| <<boost-urls-url-set_encoded_password,`set&lowbar;encoded&lowbar;password`>> 
| Set the password&period;


| <<boost-urls-url-set_encoded_path,`set&lowbar;encoded&lowbar;path`>> 
| Set the path&period;


| <<boost-urls-url-set_encoded_query,`set&lowbar;encoded&lowbar;query`>> 
| Set the query


| <<boost-urls-url-set_encoded_user,`set&lowbar;encoded&lowbar;user`>> 
| Set the user


| <<boost-urls-url-set_encoded_userinfo,`set&lowbar;encoded&lowbar;userinfo`>> 
| Set the userinfo&period;


| <<boost-urls-url-set_fragment,`set&lowbar;fragment`>> 
| Set the fragment&period;


| <<boost-urls-url-set_host,`set&lowbar;host`>> 
| Set the host


| <<boost-urls-url-set_host_address,`set&lowbar;host&lowbar;address`>> 
| Set the host to an address


| <<boost-urls-url-set_host_ipv4,`set&lowbar;host&lowbar;ipv4`>> 
| Set the host to an address


| <<boost-urls-url-set_host_ipv6,`set&lowbar;host&lowbar;ipv6`>> 
| Set the host to an address


| <<boost-urls-url-set_host_ipvfuture,`set&lowbar;host&lowbar;ipvfuture`>> 
| Set the host to an address


| <<boost-urls-url-set_host_name,`set&lowbar;host&lowbar;name`>> 
| Set the host to a name


| <<boost-urls-url-set_params,`set&lowbar;params`>> 
| Set the query params


| <<boost-urls-url-set_password,`set&lowbar;password`>> 
| Set the password&period;


| <<boost-urls-url-set_path,`set&lowbar;path`>> 
| Set the path&period;


| <<boost-urls-url_base-set_path_absolute,`set&lowbar;path&lowbar;absolute`>> 
| Set if the path is absolute

| <<boost-urls-url-set_port,`set&lowbar;port`>> 
| Set the port


| <<boost-urls-url-set_port_number,`set&lowbar;port&lowbar;number`>> 
| Set the port


| <<boost-urls-url-set_query,`set&lowbar;query`>> 
| Set the query


| <<boost-urls-url-set_scheme,`set&lowbar;scheme`>> 
| Set the scheme


| <<boost-urls-url-set_scheme_id,`set&lowbar;scheme&lowbar;id`>> 
| Set the scheme


| <<boost-urls-url-set_user,`set&lowbar;user`>> 
| Set the user


| <<boost-urls-url-set_userinfo,`set&lowbar;userinfo`>> 
| Set the userinfo


| <<boost-urls-url_view_base-size,`size`>> 
| Return the number of characters in the url

| <<boost-urls-url-swap,`swap`>> 
| Swap the contents&period;

| <<boost-urls-url-2constructor,`url`>>         [.small]#[constructor]#
| Constructor


| <<boost-urls-url_view_base-user,`user`>> 
| Return the user

| <<boost-urls-url_view_base-userinfo,`userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-zone_id,`zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url-2destructor,`&#126;url`>> [.small]#[destructor]# [.small]#[virtual]#
| Destructor

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-08friend-02,`operator!&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-05,`operator&lt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-0ff,`operator&lt;&lt;`>> 
| Format the url to the output stream

| <<boost-urls-url_view_base-08friend-04a,`operator&lt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-07c,`operator&equals;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-073,`operator&gt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-06,`operator&gt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_base-08friend,`resolve`>> 
| 

| <<boost-urls-url-08friend-0c,`swap`>> 
| Swap

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-digest,`digest`>> 
| Calculate a hash of the url

|===


== Description


This container owns a url, represented    by a null&hyphen;terminated character buffer    which is managed by performing dymamic    memory allocations as needed&period;    The contents may be inspected and modified,    and the implementation maintains a useful    invariant&colon; changes to the url always    leave it in a valid state&period;


=== Exception Safety

* Functions marked 
`noexcept`
 provide the    no&hyphen;throw guarantee, otherwise&colon;
* Functions which throw offer the strong    exception safety guarantee&period;


=== 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)&colon; Generic Syntax (rfc3986)]



== See Also


xref:#boost-urls-parse_absolute_uri[parse&lowbar;absolute&lowbar;uri],        xref:#boost-urls-parse_relative_ref[parse&lowbar;relative&lowbar;ref],        xref:#boost-urls-parse_uri[parse&lowbar;uri],        xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference],        xref:#boost-urls-url_base-08friend[resolve]&period;





Normalize the URL components

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L492[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
normalize();
----

== Description


Applies Syntax&hyphen;based normalization to        all components of the URL&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L496[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
normalize&lowbar;authority();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL authority&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L502[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
normalize&lowbar;fragment();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL fragment&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL path

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L498[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
normalize&lowbar;path();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL path&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period; Redundant        path&hyphen;segments are removed&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L500[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
normalize&lowbar;query();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL query&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L494[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
normalize&lowbar;scheme();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL scheme&period;

The scheme is normalized to lowercase&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L271[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
<<boost-urls-url-operator_assign-09,operator&equals;>>(<<boost-urls-url,url>>&& u) noexcept;
----

[.small]#<<boost-urls-url-operator_assign-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
<<boost-urls-url-operator_assign-0b,operator&equals;>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

[.small]#<<boost-urls-url-operator_assign-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
<<boost-urls-url-operator_assign-06,operator&equals;>>(<<boost-urls-url,url>> const& u);
----

[.small]#<<boost-urls-url-operator_assign-06,_» more..._>>#

== Description


The contents of `u` are transferred to        `this`, including the underlying        character buffer&period; The previous contents        of `this` are destroyed&period;        After assignment, the moved&hyphen;from        object is as if default constructed&period;


=== Postconditions

[,cpp]
----
u.empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to assign from&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L271[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
operator&equals;(<<boost-urls-url,url>>&& u) noexcept;
----

== Description


The contents of `u` are transferred to        `this`, including the underlying        character buffer&period; The previous contents        of `this` are destroyed&period;        After assignment, the moved&hyphen;from        object is as if default constructed&period;


=== Postconditions

[,cpp]
----
u.empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *u*
| The url to assign from&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L297[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
operator&equals;(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

== Description


The contents of `u` are copied and        the previous contents of `this` are        destroyed&period;        Capacity is preserved, or increases&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L326[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
operator&equals;(<<boost-urls-url,url>> const& u);
----

== Description


The contents of `u` are copied and        the previous contents of `this` are        destroyed&period;        Capacity is preserved, or increases&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Remove the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L419[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;authority();
----

== Description


This function removes the authority,        which includes the userinfo, host, and        a port if present&period;


=== Example

[,cpp]
----
assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[            3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_authority[set&lowbar;encoded&lowbar;authority]&period;





Remove the fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L482[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;fragment() noexcept;
----

== Description


This function removes the fragment&period;        An empty fragment is distinct from        having no fragment&period;


=== Example

[,cpp]
----
assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == false && this->encoded_fragment() == ""
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_encoded_fragment[set&lowbar;encoded&lowbar;fragment],            xref:#boost-urls-url_base-set_fragment[set&lowbar;fragment]&period;





Remove the origin component

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L489[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;origin();
----

== Description


This function removes the origin, which        consists of the scheme and authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" );
----

=== Postconditions

[,cpp]
----
this->scheme_id() == scheme::none && this->has_authority() == false
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;




Remove the password

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L436[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;password() noexcept;
----

== Description


This function removes the password from        the userinfo if a password exists&period; If        there is no userinfo or no authority,        the call has no effect&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" );
----

=== Postconditions

[,cpp]
----
this->has_password() == false && this->encoded_password().empty() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_password[set&lowbar;password],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Remove the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L461[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;port() noexcept;
----

== Description


If a port exists, it is removed&period; The rest        of the authority is unchanged&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" );
----

=== Postconditions

[,cpp]
----
this->has_port() == false && this->port_number() == 0 && this->port() == ""
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Remove the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L479[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;query() noexcept;
----

== Description


If a query is present, it is removed&period;        An empty query is distinct from having        no query&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" );
----

=== Postconditions

[,cpp]
----
this->has_query() == false && this->params().empty()
----

=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Remove the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L414[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;scheme();
----

== Description


This function removes the scheme if it        is present&period;


=== Example

[,cpp]
----
assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" );
----

=== Postconditions

[,cpp]
----
this->has_scheme() == false && this->scheme_id() == scheme::none
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_scheme[set&lowbar;scheme]&period;





Remove the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L426[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
remove&lowbar;userinfo() noexcept;
----

== Description


This function removes the userinfo if        present, without removing any authority&period;


=== Example

[,cpp]
----
assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false );
----

=== Postconditions

[,cpp]
----
this->has_userinfo() == false && this->encoded_userinfo().empty == true
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_userinfo[set&lowbar;encoded&lowbar;userinfo],            xref:#boost-urls-url_base-set_userinfo[set&lowbar;userinfo]&period;





Set the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L417[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;authority(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the authority        to the specified string&period;        The string may contain percent&hyphen;escapes&period;


=== Example

[,cpp]
----
assert( url().set_encoded_authority( "My%20Computer" ).has_authority() );
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[            3&period;2&period; Authority (rfc3986)]
        



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;eror`
| The string contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The authority string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_authority[remove&lowbar;authority]&period;





Set the fragment&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L486[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;fragment(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the fragment to the        specified string, which may contain        percent&hyphen;escapes and which may be empty&period;        An empty fragment is distinct from        having no fragment&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == true && this->fragment() == decode_view( s )
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_fragment[set&lowbar;fragment]&period;





Set the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L441[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;host(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address        enclosed in square brackets, then the
        host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture        address enclosed in square brackets, then
        the host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string&period; This string can contain percent
        escapes, or can be empty&period;        Escapes in the string are preserved,
        and reserved characters in the string        are percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L445[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;host&lowbar;address(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string&period; This string can contain percent
        escapes, or can be empty&period;        Escapes in the string are preserved,
        and reserved characters in the string        are percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255

IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal

IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to a name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L455[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;host&lowbar;name(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


The host is set to the specified string,        which may contain percent&hyphen;escapes and        can be empty&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name]&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the query params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L477[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;params(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; ps);
----

== Description


This sets the query params to the elements        in the list, which may contain        percent&hyphen;escapes and can be empty&period;

An empty list of params is distinct from        having no query&period;

Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_params( {"id", "42"} ).encoded_query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true
----

=== Complexity

Linear&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| some element in `ps` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *ps*
| The params to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_params[set&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the password&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L434[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;password(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the password in        the userinfo to the string, which        may contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" );
----

=== Postconditions

[,cpp]
----
this->has_password() == true
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period; This string may        contain any characters, including nulls&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L468[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;path(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the path to the        string, which may contain percent&hyphen;escapes        and can be empty&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;

[NOTE]
The library may adjust the final result        to ensure that no other parts of the url        is semantically affected&period;


=== Example

[,cpp]
----
url u( "http://www.example.com" );

u.set_encoded_path( "path/to/file.txt" );

assert( u.encoded_path() == "/path/to/file.txt" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-segments-04[segments],            xref:#boost-urls-url_base-set_path[set&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Set the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L473[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;query(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This sets the query to the string, which        may contain percent&hyphen;escapes and can be        empty&period;        An empty query is distinct from having        no query&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true && this->query() == decode_view( s );
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L430[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;user(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the user part of the        userinfo the the string, which may        contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_userinfo() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_password[set&lowbar;password],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the userinfo&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L424[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;encoded&lowbar;userinfo(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


The userinfo is set to the given string,        which may contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;        The effects on the user and password        depend on the presence of a colon (&apos;&colon;&apos;)        in the string&colon;

* If an unescaped colon exists, the        characters up to the colon become
        the user and the rest of the characters        after the colon become the password&period;
        In this case 
has&lowbar;password
 returns        true&period; Otherwise,
* If there is no colon, the user is        set to the string&period; The function
        
has&lowbar;password
 returns false&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_userinfo[remove&lowbar;userinfo],            xref:#boost-urls-url_base-set_userinfo[set&lowbar;userinfo]&period;





Set the fragment&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L484[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;fragment(core::string&lowbar;view s);
----

== Description


This function sets the fragment to the        specified string, which may be empty&period;        An empty fragment is distinct from        having no fragment&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == true && this->fragment() == s
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_encoded_fragment[set&lowbar;encoded&lowbar;fragment]&period;





Set the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L439[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;host(core::string&lowbar;view s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address        enclosed in square brackets, then the
        host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture        address enclosed in square brackets, then
        the host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string, which may be empty&period;
        Reserved characters in the string are        percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L443[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;host&lowbar;address(core::string&lowbar;view s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string, which may be empty&period;
        Reserved characters in the string are        percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255

IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal

IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L447[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;host&lowbar;ipv4(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr);
----

== Description


The host is set to the specified IPv4        address&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv4]&period;


=== Example

[,cpp]
----
assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" );
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *addr*
| The address to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L449[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;host&lowbar;ipv6(<<boost-urls-ipv6_address,ipv6&lowbar;address>> const& addr);
----

== Description


The host is set to the specified IPv6        address&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv6]&period;


=== Example

[,cpp]
----
assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *addr*
| The address to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L451[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;host&lowbar;ipvfuture(core::string&lowbar;view s);
----

== Description


The host is set to the specified IPvFuture        string&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipvfuture]&period;


=== Example

[,cpp]
----
assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to a name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L453[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;host&lowbar;name(core::string&lowbar;view s);
----

== Description


The host is set to the specified string,        which may be empty&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name]&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture]&period;





Set the query params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L475[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;params(
    std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; ps,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opts = &lcub;&rcub;);
----

== Description


This sets the query params to the list        of param&lowbar;view, which can be empty&period;

An empty list of params is distinct from        having no params&period;

Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Complexity

Linear&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
            >3.4.  Query (rfc3986)</a>
        @li <a href=[&colon;&sol;&sol;en&period;wikipedia&period;org&sol;wiki&sol;Query&lowbar;string&quot;            &gt;Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *ps*
| The params to set&period;


| *opts*
| The options for encoding&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the password&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L432[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;password(core::string&lowbar;view s);
----

== Description


This function sets the password in        the userinfo to the string&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" );
----

=== Postconditions

[,cpp]
----
this->has_password() == true && this->password() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period; This string may        contain any characters, including nulls&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L466[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;path(core::string&lowbar;view s);
----

== Description


This function sets the path to the        string, which may be empty&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;

[NOTE]
The library may adjust the final result        to ensure that no other parts of the url        is semantically affected&period;

[NOTE]
This function does not encode &apos;&sol;&apos; chars, which        are unreserved for paths but reserved for        path segments&period; If a path segment should include        encoded &apos;&sol;&apos;s to differentiate it from path separators,        the functions xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path] or xref:#boost-urls-url_base-segments-04[segments]        should be used instead&period;


=== Example

[,cpp]
----
url u( "http://www.example.com" );

u.set_path( "path/to/file.txt" );

assert( u.path() == "/path/to/file.txt" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-segments-04[segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Set the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L459[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;port(core::string&lowbar;view s);
----

== Description


This port is set to the string, which        must contain only digits or be empty&period;        An empty port string is distinct from        having no port&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" );
----

=== Postconditions

[,cpp]
----
this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n)
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` does not contain a valid port&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The port string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_port[remove&lowbar;port],            xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Set the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L457[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;port&lowbar;number(std::uint16&lowbar;t n);
----

== Description


The port is set to the specified integer&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_port() == true && this->port_number() == n
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== Parameters


|===
| Name | Description

| *n*
| The port number to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_port[remove&lowbar;port],            xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Set the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L471[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;query(core::string&lowbar;view s);
----

== Description


This sets the query to the string, which        can be empty&period;        An empty query is distinct from having        no query&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true && this->query() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query]&period;





Set the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L410[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;scheme(core::string&lowbar;view s);
----

== Description


The scheme is set to the specified        string, which must contain a valid        scheme without any trailing colon        (&apos;&colon;&apos;)&period;        Note that schemes are case&hyphen;insensitive,        and the canonical form is lowercased&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid scheme&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The scheme to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_scheme[remove&lowbar;scheme]&period;





Set the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L412[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;scheme&lowbar;id(<<boost-urls,urls>>::<<boost-urls-scheme,scheme>> id);
----

== Description


This function sets the scheme to the specified        known xref:#boost-urls-scheme[urls&colon;&colon;scheme] id, which may not be        xref:#boost-urls-scheme[scheme&colon;&colon;unknown] or else an exception is        thrown&period; If the id is xref:#boost-urls-scheme[scheme&colon;&colon;none], this        function behaves as if xref:#boost-urls-url_base-remove_scheme[remove&lowbar;scheme]        were called&period;


=== Example

[,cpp]
----
assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" );
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The scheme is invalid&period;


|===

== Parameters


|===
| Name | Description

| *id*
| The scheme to set&period;


|===


Set the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L428[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;user(core::string&lowbar;view s);
----

== Description


This function sets the user part of the        userinfo to the string&period;        Any special or reserved characters in the        string are automatically percent&hyphen;encoded&period;


=== Example

[,cpp]
----
assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_userinfo() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_password[set&lowbar;password]&period;





Set the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L422[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>&
set&lowbar;userinfo(core::string&lowbar;view s);
----

== Description


The userinfo is set to the given string,        which may contain percent&hyphen;escapes&period;        Any special or reserved characters in the        string are automatically percent&hyphen;encoded&period;        The effects on the user and password        depend on the presence of a colon (&apos;&colon;&apos;)        in the string&colon;

* If an unescaped colon exists, the        characters up to the colon become
        the user and the rest of the characters        after the colon become the password&period;
        In this case 
has&lowbar;password
 returns        true&period; Otherwise,
* If there is no colon, the user is        set to the string&period; The function
        
has&lowbar;password
 returns false&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_userinfo[remove&lowbar;userinfo],            xref:#boost-urls-url_base-set_encoded_userinfo[set&lowbar;encoded&lowbar;userinfo]&period;





Swap the contents&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L360[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
<<boost-urls-url-swap,swap>>(<<boost-urls-url,url>>& other) noexcept;
----

[.small]#<<boost-urls-url-swap,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
void
swap(
    <<boost-urls-url,url>>& v0,
    <<boost-urls-url,url>>& v1) noexcept;
----

[.small]#<<boost-urls-url-08friend-0c,_» more..._>>#

== Description


Exchanges the contents of this url with another        url&period; All views, iterators and references remain valid&period;

If `this &equals;&equals; &amp;other`, this function call has no effect&period;


=== Example

[,cpp]
----
url u1( "https://www.example.com" );
url u2( "https://www.boost.org" );
u1.swap(u2);
assert(u1 == "https://www.boost.org" );
assert(u2 == "https://www.example.com" );
----

=== Complexity

Constant


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The object to swap with


| *v0*
| The first object to swap


| *v1*
| The second object to swap


|===


Swap the contents&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L360[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(<<boost-urls-url,url>>& other) noexcept;
----

== Description


Exchanges the contents of this url with another        url&period; All views, iterators and references remain valid&period;

If `this &equals;&equals; &amp;other`, this function call has no effect&period;


=== Example

[,cpp]
----
url u1( "https://www.example.com" );
url u2( "https://www.boost.org" );
u1.swap(u2);
assert(u1 == "https://www.boost.org" );
assert(u2 == "https://www.example.com" );
----

=== Complexity

Constant


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *other*
| The object to swap with


|===


Swap

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L397[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
void
swap(
    <<boost-urls-url,url>>& v0,
    <<boost-urls-url,url>>& v1) noexcept;
----

== Description


Exchanges the contents of `v0` with another `v1`&period;        All views, iterators and references remain        valid&period;

If `&amp;v0 &equals;&equals; &amp;v1`, this function call has no effect&period;


=== Example

[,cpp]
----
url u1( "https://www.example.com" );
url u2( "https://www.boost.org" );
std::swap(u1, u2);
assert(u1 == "https://www.boost.org" );
assert(u2 == "https://www.example.com" );
----

=== Effects

[,cpp]
----
v0.swap( v1 );
----

=== Complexity

Constant


=== Exception Safety

Throws nothing



== Parameters


|===
| Name | Description

| *v0*
| The first object to swap


| *v1*
| The second object to swap


|===

== See Also


xref:#boost-urls-url-swap[url&colon;&colon;swap] 





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L120[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url-2constructor-0f0,url>>() noexcept;
----

[.small]#<<boost-urls-url-2constructor-0f0,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-url-2constructor-002,url>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-url-2constructor-002,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url-2constructor-01,url>>(<<boost-urls-url,url>>&& u) noexcept;
----

[.small]#<<boost-urls-url-2constructor-01,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url-2constructor-001,url>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

[.small]#<<boost-urls-url-2constructor-001,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url-2constructor-0f7,url>>(<<boost-urls-url,url>> const& u);
----

[.small]#<<boost-urls-url-2constructor-0f7,_» more..._>>#

== Description


Default constructed urls contain        a zero&hyphen;length string&period; This matches        the grammar for a relative&hyphen;ref with        an empty path and no query or        fragment&period;


=== Example

[,cpp]
----
url u;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input does not contain a valid url&period;


| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


| *u*
| The url to move from&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L120[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url() noexcept;
----

== Description


Default constructed urls contain        a zero&hyphen;length string&period; This matches        the grammar for a relative&hyphen;ref with        an empty path and no query or        fragment&period;


=== Example

[,cpp]
----
url u;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L169[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
url(core::string&lowbar;view s);
----

== Description


This function constructs a URL from        the string `s`, which must contain a        valid _URI_ or _relative&hyphen;ref_        or else an exception is thrown&period;        The new url retains ownership by        allocating a copy of the passed string&period;


=== Example

[,cpp]
----
url u( "https://www.example.com" );
----

=== Effects

[,cpp]
----
return url( parse_uri_reference( s ).value() );
----

=== Postconditions

[,cpp]
----
this->buffer().data() != s.data()
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4&period;1&period; URI Reference]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input does not contain a valid url&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L194[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url(<<boost-urls-url,url>>&& u) noexcept;
----

== Description


The contents of `u` are transferred        to the newly constructed object,        which includes the underlying        character buffer&period;        After construction, the moved&hyphen;from        object is as if default constructed&period;


=== Postconditions

[,cpp]
----
u.empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *u*
| The url to move from&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L217[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

== Description


The newly constructed object        contains a copy of `u`&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L243[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url(<<boost-urls-url,url>> const& u);
----

== Description


The newly constructed object        contains a copy of `u`&period;


=== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----

=== Complexity

Linear in `u&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===


Destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L85[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
&#126;url();
----

== Description


Any params, segments, iterators, or        views which reference this object are        invalidated&period; The underlying character        buffer is destroyed, invalidating all        references to it&period;




Common functionality for containers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L63[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class url&lowbar;base
    : public <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>>;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-authority,`authority`>> 
| Return the authority

| <<boost-urls-url_view_base-buffer,`buffer`>> 
| Return the url string

| <<boost-urls-url_base-c_str,`c&lowbar;str`>> 
| Return the url as a null&hyphen;terminated string

| <<boost-urls-url_base-capacity,`capacity`>> 
| Return the number of characters that can be stored without reallocating

| <<boost-urls-url_base-clear,`clear`>> 
| Clear the contents while preserving the capacity

| <<boost-urls-url_view_base-compare,`compare`>> 
| Return the result of comparing this with another url

| <<boost-urls-url_view_base-data,`data`>> 
| Return a pointer to the url&apos;s character buffer

| <<boost-urls-url_view_base-empty,`empty`>> 
| Return true if the url is empty

| <<boost-urls-url_view_base-encoded_authority,`encoded&lowbar;authority`>> 
| Return the authority&period;

| <<boost-urls-url_view_base-encoded_fragment,`encoded&lowbar;fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-encoded_host,`encoded&lowbar;host`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_address,`encoded&lowbar;host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_and_port,`encoded&lowbar;host&lowbar;and&lowbar;port`>> 
| Return the host and port

| <<boost-urls-url_view_base-encoded_host_name,`encoded&lowbar;host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-encoded_origin,`encoded&lowbar;origin`>> 
| Return the origin

| <<boost-urls-url_base-encoded_params,`encoded&lowbar;params`>> 
| Return the query as a container of parameters


| <<boost-urls-url_view_base-encoded_password,`encoded&lowbar;password`>> 
| Return the password

| <<boost-urls-url_view_base-encoded_path,`encoded&lowbar;path`>> 
| Return the path

| <<boost-urls-url_view_base-encoded_query,`encoded&lowbar;query`>> 
| Return the query

| <<boost-urls-url_view_base-encoded_resource,`encoded&lowbar;resource`>> 
| Return the resource

| <<boost-urls-url_base-encoded_segments,`encoded&lowbar;segments`>> 
| Return the path as a container of segments


| <<boost-urls-url_view_base-encoded_target,`encoded&lowbar;target`>> 
| Return the target

| <<boost-urls-url_view_base-encoded_user,`encoded&lowbar;user`>> 
| Return the user

| <<boost-urls-url_view_base-encoded_userinfo,`encoded&lowbar;userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-encoded_zone_id,`encoded&lowbar;zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url_view_base-fragment,`fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-has_authority,`has&lowbar;authority`>> 
| Return true if an authority is present

| <<boost-urls-url_view_base-has_fragment,`has&lowbar;fragment`>> 
| Return true if a fragment is present

| <<boost-urls-url_view_base-has_password,`has&lowbar;password`>> 
| Return true if a password is present

| <<boost-urls-url_view_base-has_port,`has&lowbar;port`>> 
| Return true if a port is present

| <<boost-urls-url_view_base-has_query,`has&lowbar;query`>> 
| Return true if a query is present

| <<boost-urls-url_view_base-has_scheme,`has&lowbar;scheme`>> 
| Return true a scheme is present

| <<boost-urls-url_view_base-has_userinfo,`has&lowbar;userinfo`>> 
| Return true if a userinfo is present

| <<boost-urls-url_view_base-host,`host`>> 
| Return the host

| <<boost-urls-url_view_base-host_address,`host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-host_ipv4_address,`host&lowbar;ipv4&lowbar;address`>> 
| Return the host IPv4 address

| <<boost-urls-url_view_base-host_ipv6_address,`host&lowbar;ipv6&lowbar;address`>> 
| Return the host IPv6 address

| <<boost-urls-url_view_base-host_ipvfuture,`host&lowbar;ipvfuture`>> 
| Return the host IPvFuture address

| <<boost-urls-url_view_base-host_name,`host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-host_type,`host&lowbar;type`>> 
| Return the host type

| <<boost-urls-url_view_base-is_path_absolute,`is&lowbar;path&lowbar;absolute`>> 
| Return true if the path is absolute

| <<boost-urls-url_base-normalize,`normalize`>> 
| Normalize the URL components

| <<boost-urls-url_base-normalize_authority,`normalize&lowbar;authority`>> 
| Normalize the URL authority

| <<boost-urls-url_base-normalize_fragment,`normalize&lowbar;fragment`>> 
| Normalize the URL fragment

| <<boost-urls-url_base-normalize_path,`normalize&lowbar;path`>> 
| Normalize the URL path

| <<boost-urls-url_base-normalize_query,`normalize&lowbar;query`>> 
| Normalize the URL query

| <<boost-urls-url_base-normalize_scheme,`normalize&lowbar;scheme`>> 
| Normalize the URL scheme

| <<boost-urls-url_view_base-2conversion,`operator core::string&lowbar;view`>> 
| Return the URL as a core&colon;&colon;string&lowbar;view

| <<boost-urls-url_base-params,`params`>> 
| Return the query as a container of parameters

xref:#boost-urls-url_view_base-params-05[url&lowbar;view&lowbar;base&colon;&colon;params]


| <<boost-urls-url_view_base-password,`password`>> 
| Return the password

| <<boost-urls-url_view_base-path,`path`>> 
| Return the path

| <<boost-urls-url_view_base-persist,`persist`>> 
| Return a shared, persistent copy of the url

| <<boost-urls-url_view_base-port,`port`>> 
| Return the port

| <<boost-urls-url_view_base-port_number,`port&lowbar;number`>> 
| Return the port

| <<boost-urls-url_view_base-query,`query`>> 
| Return the query

| <<boost-urls-url_base-remove_authority,`remove&lowbar;authority`>> 
| Remove the authority

| <<boost-urls-url_base-remove_fragment,`remove&lowbar;fragment`>> 
| Remove the fragment

| <<boost-urls-url_base-remove_origin,`remove&lowbar;origin`>> 
| Remove the origin component

| <<boost-urls-url_base-remove_password,`remove&lowbar;password`>> 
| Remove the password

| <<boost-urls-url_base-remove_port,`remove&lowbar;port`>> 
| Remove the port

| <<boost-urls-url_base-remove_query,`remove&lowbar;query`>> 
| Remove the query

| <<boost-urls-url_base-remove_scheme,`remove&lowbar;scheme`>> 
| Remove the scheme

| <<boost-urls-url_base-remove_userinfo,`remove&lowbar;userinfo`>> 
| Remove the userinfo

| <<boost-urls-url_base-reserve,`reserve`>> 
| Adjust the capacity without changing the size

| <<boost-urls-url_base-resolve,`resolve`>> 
| Resolve a URL reference against this base URL

| <<boost-urls-url_view_base-scheme,`scheme`>> 
| Return the scheme

| <<boost-urls-url_view_base-scheme_id,`scheme&lowbar;id`>> 
| Return the scheme

| <<boost-urls-url_base-segments,`segments`>> 
| Return the path as a container of segments


| <<boost-urls-url_base-set_encoded_authority,`set&lowbar;encoded&lowbar;authority`>> 
| Set the authority

| <<boost-urls-url_base-set_encoded_fragment,`set&lowbar;encoded&lowbar;fragment`>> 
| Set the fragment&period;

| <<boost-urls-url_base-set_encoded_host,`set&lowbar;encoded&lowbar;host`>> 
| Set the host

| <<boost-urls-url_base-set_encoded_host_address,`set&lowbar;encoded&lowbar;host&lowbar;address`>> 
| Set the host to an address

| <<boost-urls-url_base-set_encoded_host_name,`set&lowbar;encoded&lowbar;host&lowbar;name`>> 
| Set the host to a name

| <<boost-urls-url_base-set_encoded_params,`set&lowbar;encoded&lowbar;params`>> 
| Set the query params

| <<boost-urls-url_base-set_encoded_password,`set&lowbar;encoded&lowbar;password`>> 
| Set the password&period;

| <<boost-urls-url_base-set_encoded_path,`set&lowbar;encoded&lowbar;path`>> 
| Set the path&period;

| <<boost-urls-url_base-set_encoded_query,`set&lowbar;encoded&lowbar;query`>> 
| Set the query

| <<boost-urls-url_base-set_encoded_user,`set&lowbar;encoded&lowbar;user`>> 
| Set the user

| <<boost-urls-url_base-set_encoded_userinfo,`set&lowbar;encoded&lowbar;userinfo`>> 
| Set the userinfo&period;

| <<boost-urls-url_base-set_fragment,`set&lowbar;fragment`>> 
| Set the fragment&period;

| <<boost-urls-url_base-set_host,`set&lowbar;host`>> 
| Set the host

| <<boost-urls-url_base-set_host_address,`set&lowbar;host&lowbar;address`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_ipv4,`set&lowbar;host&lowbar;ipv4`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_ipv6,`set&lowbar;host&lowbar;ipv6`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_ipvfuture,`set&lowbar;host&lowbar;ipvfuture`>> 
| Set the host to an address

| <<boost-urls-url_base-set_host_name,`set&lowbar;host&lowbar;name`>> 
| Set the host to a name

| <<boost-urls-url_base-set_params,`set&lowbar;params`>> 
| Set the query params

| <<boost-urls-url_base-set_password,`set&lowbar;password`>> 
| Set the password&period;

| <<boost-urls-url_base-set_path,`set&lowbar;path`>> 
| Set the path&period;

| <<boost-urls-url_base-set_path_absolute,`set&lowbar;path&lowbar;absolute`>> 
| Set if the path is absolute

| <<boost-urls-url_base-set_port,`set&lowbar;port`>> 
| Set the port

| <<boost-urls-url_base-set_port_number,`set&lowbar;port&lowbar;number`>> 
| Set the port

| <<boost-urls-url_base-set_query,`set&lowbar;query`>> 
| Set the query

| <<boost-urls-url_base-set_scheme,`set&lowbar;scheme`>> 
| Set the scheme

| <<boost-urls-url_base-set_scheme_id,`set&lowbar;scheme&lowbar;id`>> 
| Set the scheme

| <<boost-urls-url_base-set_user,`set&lowbar;user`>> 
| Set the user

| <<boost-urls-url_base-set_userinfo,`set&lowbar;userinfo`>> 
| Set the userinfo

| <<boost-urls-url_view_base-size,`size`>> 
| Return the number of characters in the url

| <<boost-urls-url_view_base-user,`user`>> 
| Return the user

| <<boost-urls-url_view_base-userinfo,`userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-zone_id,`zone&lowbar;id`>> 
| Return the IPv6 Zone ID

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-08friend-02,`operator!&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-05,`operator&lt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-0ff,`operator&lt;&lt;`>> 
| Format the url to the output stream

| <<boost-urls-url_view_base-08friend-04a,`operator&lt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-07c,`operator&equals;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-073,`operator&gt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-06,`operator&gt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_base-08friend,`resolve`>> 
| 

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-digest,`digest`>> 
| Calculate a hash of the url

|===


== Description


This base class is used by the library    to provide common member functions for    containers&period; This cannot be instantiated    directly&semi; Instead, use one of the    containers or functions&colon;


=== Containers

* url
        
* url&lowbar;view
        
* static&lowbar;url


=== Functions

* parse&lowbar;absolute&lowbar;uri
        
* parse&lowbar;origin&lowbar;form
        
* parse&lowbar;relative&lowbar;ref
        
* parse&lowbar;uri
        
* parse&lowbar;uri&lowbar;reference




Return the url as a null&hyphen;terminated string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L130[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
char const*
c&lowbar;str() const noexcept;
----

== Description


This function returns a pointer to a null        terminated string representing the url,        which may contain percent escapes&period;


=== Example

[,cpp]
----
assert( std::strlen( url( "http://www.example.com" ).c_str() ) == 22 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the number of characters that can be stored without reallocating

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L147[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
capacity() const noexcept;
----

== Description


This does not include the null terminator,        which is always present&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Clear the contents while preserving the capacity

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L166[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
clear() noexcept;
----

== Description



=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

No&hyphen;throw guarantee&period;




Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2174[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>>
<<boost-urls-url_base-encoded_params-02,encoded&lowbar;params>>() const noexcept;
----

[.small]#<<boost-urls-url_base-encoded_params-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>>
<<boost-urls-url_base-encoded_params-06,encoded&lowbar;params>>() noexcept;
----

[.small]#<<boost-urls-url_base-encoded_params-06,_» more..._>>#

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;


=== Example

[,cpp]
----
params_encoded_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )
query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_query[encoded&lowbar;query],            xref:#boost-urls-url_view_base-has_query[has&lowbar;query],            xref:#boost-urls-url_view_base-params-05[params],            xref:#boost-urls-url_view_base-query[query]&period;





Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2174[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>>
encoded&lowbar;params() const noexcept;
----

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;


=== Example

[,cpp]
----
params_encoded_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )
query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_query[encoded&lowbar;query],            xref:#boost-urls-url_view_base-has_query[has&lowbar;query],            xref:#boost-urls-url_view_base-params-05[params],            xref:#boost-urls-url_view_base-query[query]&period;





Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2224[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_ref,params&lowbar;encoded&lowbar;ref>>
encoded&lowbar;params() noexcept;
----

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
params_encoded_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1946[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>
<<boost-urls-url_base-encoded_segments-0e8,encoded&lowbar;segments>>() noexcept;
----

[.small]#<<boost-urls-url_base-encoded_segments-0e8,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>
<<boost-urls-url_base-encoded_segments-0e5,encoded&lowbar;segments>>() const noexcept;
----

[.small]#<<boost-urls-url_base-encoded_segments-0e5,_» more..._>>#

== Description


This function returns a bidirectional        view of segments over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
url u( "http://example.com/path/to/file.txt" );

segments_encoded_ref sv = u.encoded_segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path[set&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1946[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_ref,segments&lowbar;encoded&lowbar;ref>>
encoded&lowbar;segments() noexcept;
----

== Description


This function returns a bidirectional        view of segments over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
url u( "http://example.com/path/to/file.txt" );

segments_encoded_ref sv = u.encoded_segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path[set&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1950[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>
encoded&lowbar;segments() const noexcept;
----

== Description


This function returns a bidirectional        view of strings over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;


=== Example

[,cpp]
----
segments_encoded_view sv = url_view( "/path/to/file.txt" ).encoded_segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-is_path_absolute[is&lowbar;path&lowbar;absolute],            xref:#boost-urls-url_view_base-encoded_path[encoded&lowbar;path],            xref:#boost-urls-url_view_base-path[path],            xref:#boost-urls-url_view_base-segments[segments],            xref:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view]&period;





Normalize the URL components

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2576[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
normalize();
----

== Description


Applies Syntax&hyphen;based normalization to        all components of the URL&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2617[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
normalize&lowbar;authority();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL authority&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2684[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
normalize&lowbar;fragment();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL fragment&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL path

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2640[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
normalize&lowbar;path();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL path&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period; Redundant        path&hyphen;segments are removed&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2662[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
normalize&lowbar;query();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL query&period;

Percent&hyphen;encoding triplets are normalized        to uppercase letters&period; Percent&hyphen;encoded        octets that correspond to unreserved        characters are decoded&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Normalize the URL scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2595[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
normalize&lowbar;scheme();
----

== Description


Applies Syntax&hyphen;based normalization to the        URL scheme&period;

The scheme is normalized to lowercase&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]




Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2110[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>
<<boost-urls-url_base-params-03,params>>() noexcept;
----

[.small]#<<boost-urls-url_base-params-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view,params&lowbar;view>>
<<boost-urls-url_base-params-0b,params>>() const noexcept;
----

[.small]#<<boost-urls-url_base-params-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>
<<boost-urls-url_base-params-0c,params>>(<<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) noexcept;
----

[.small]#<<boost-urls-url_base-params-0c,_» more..._>>#

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
params_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *opt*
| The options for decoding&period; If        this parameter is omitted, the `space&lowbar;as&lowbar;plus`        is used&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2110[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>
params() noexcept;
----

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
params_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





xref:#boost-urls-url_view_base-params-05[url&lowbar;view&lowbar;base&colon;&colon;params]

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2114[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view,params&lowbar;view>>
params() const noexcept;
----


Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2170[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_ref,params&lowbar;ref>>
params(<<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) noexcept;
----

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
encoding_opts opt;
opt.space_as_plus = true;
params_ref pv = url( "/sql?id=42&name=jane+doe&page+size=20" ).params(opt);
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *opt*
| The options for decoding&period; If        this parameter is omitted, the `space&lowbar;as&lowbar;plus`        is used&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Remove the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L437[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;authority();
----

== Description


This function removes the authority,        which includes the userinfo, host, and        a port if present&period;


=== Example

[,cpp]
----
assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[            3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_authority[set&lowbar;encoded&lowbar;authority]&period;





Remove the fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2427[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;fragment() noexcept;
----

== Description


This function removes the fragment&period;        An empty fragment is distinct from        having no fragment&period;


=== Example

[,cpp]
----
assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == false && this->encoded_fragment() == ""
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_encoded_fragment[set&lowbar;encoded&lowbar;fragment],            xref:#boost-urls-url_base-set_fragment[set&lowbar;fragment]&period;





Remove the origin component

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2553[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;origin();
----

== Description


This function removes the origin, which        consists of the scheme and authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" );
----

=== Postconditions

[,cpp]
----
this->scheme_id() == scheme::none && this->has_authority() == false
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;




Remove the password

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L872[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;password() noexcept;
----

== Description


This function removes the password from        the userinfo if a password exists&period; If        there is no userinfo or no authority,        the call has no effect&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" );
----

=== Postconditions

[,cpp]
----
this->has_password() == false && this->encoded_password().empty() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_password[set&lowbar;password],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Remove the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1637[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;port() noexcept;
----

== Description


If a port exists, it is removed&period; The rest        of the authority is unchanged&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" );
----

=== Postconditions

[,cpp]
----
this->has_port() == false && this->port_number() == 0 && this->port() == ""
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Remove the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2382[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;query() noexcept;
----

== Description


If a query is present, it is removed&period;        An empty query is distinct from having        no query&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" );
----

=== Postconditions

[,cpp]
----
this->has_query() == false && this->params().empty()
----

=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Remove the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L350[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;scheme();
----

== Description


This function removes the scheme if it        is present&period;


=== Example

[,cpp]
----
assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" );
----

=== Postconditions

[,cpp]
----
this->has_scheme() == false && this->scheme_id() == scheme::none
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_scheme[set&lowbar;scheme]&period;





Remove the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L610[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
remove&lowbar;userinfo() noexcept;
----

== Description


This function removes the userinfo if        present, without removing any authority&period;


=== Example

[,cpp]
----
assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false );
----

=== Postconditions

[,cpp]
----
this->has_userinfo() == false && this->encoded_userinfo().empty == true
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_base-set_encoded_userinfo[set&lowbar;encoded&lowbar;userinfo],            xref:#boost-urls-url_base-set_userinfo[set&lowbar;userinfo]&period;





Adjust the capacity without changing the size

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L188[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
reserve(std::size&lowbar;t n);
----

== Description


This function adjusts the capacity        of the container in characters, without        affecting the current contents&period; Has        no effect if `n &lt;&equals; this&hyphen;&gt;capacity()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;



== Exceptions


|===
| Name | Thrown on

| `bad&lowbar;alloc`
| Allocation failure


|===

== Parameters


|===
| Name | Description

| *n*
| The capacity in characters,        excluding any null terminator&period;


|===


Resolve a URL reference against this base URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2784[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;void&gt;
<<boost-urls-url_base-resolve,resolve>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& ref);
----

[.small]#<<boost-urls-url_base-resolve,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
system::result&lt;void&gt;
resolve(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& base,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& ref,
    <<boost-urls-url_base,url&lowbar;base>>& dest);
----

[.small]#<<boost-urls-url_base-08friend,_» more..._>>#

== Description


This function attempts to resolve a URL        reference `ref` against this base URL        in a manner similar to that of a web browser        resolving an anchor tag&period;

This URL must satisfy the _URI_        grammar&period; In other words, it must contain        a scheme&period;

Relative references are only usable when        in the context of a base absolute URI&period;        This process of resolving a relative        _reference_ within the context of        a _base_ URI is defined in detail        in rfc3986 (see below)&period;

The resolution process works as if the        relative reference is appended to the base        URI and the result is normalized&period;

Given the input base URL, this function        resolves the relative reference        as if performing the following steps&colon;

* Ensure the base URI has at least a scheme        
* Normalizing the reference path        
* Merge base and reference paths        
* Normalize the merged path

This function places the result of the        resolution into this URL in place&period;

If an error occurs, the contents of        this URL are unspecified and a result        with an `system&colon;&colon;error&lowbar;code` is returned&period;

[NOTE]
Abnormal hrefs where the number of &quot;&period;&period;&quot;        segments exceeds the number of segments in        the base path are handled by including the        unmatched &quot;&period;&period;&quot; segments in the result, as described        in link:https://www.rfc-editor.org/errata/eid4547[Errata 4547]&period;


=== Example

[,cpp]
----
url base1( "/one/two/three" );
base1.resolve("four");
assert( base1.buffer() == "/one/two/four" );

url base2( "http://example.com/" )
base2.resolve("/one");
assert( base2.buffer() == "http://example.com/one" );

url base3( "http://example.com/one" );
base3.resolve("/two");
assert( base3.buffer() == "http://example.com/two" );

url base4( "http://a/b/c/d;p?q" );
base4.resolve("g#s");
assert( base4.buffer() == "http://a/b/c/g#s" );
----

=== BNF

[,cpp]
----
absolute-URI  = scheme ":" hier-part [ "?" query ]
----

=== Exception Safety

Basic guarantee&period;        Calls to allocate may throw&period;


=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-5[5&period; Reference Resolution (rfc3986)]



== Return Value


An empty result upon success,        otherwise an error code if `!base&period;has&lowbar;scheme()`&period;



== Parameters


|===
| Name | Description

| *ref*
| The URL reference to resolve&period;


|===

== See Also


xref:#boost-urls-url[url],            xref:#boost-urls-url_view[url&lowbar;view]&period;





Resolve a URL reference against this base URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2784[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;void&gt;
resolve(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& ref);
----

== Description


This function attempts to resolve a URL        reference `ref` against this base URL        in a manner similar to that of a web browser        resolving an anchor tag&period;

This URL must satisfy the _URI_        grammar&period; In other words, it must contain        a scheme&period;

Relative references are only usable when        in the context of a base absolute URI&period;        This process of resolving a relative        _reference_ within the context of        a _base_ URI is defined in detail        in rfc3986 (see below)&period;

The resolution process works as if the        relative reference is appended to the base        URI and the result is normalized&period;

Given the input base URL, this function        resolves the relative reference        as if performing the following steps&colon;

* Ensure the base URI has at least a scheme        
* Normalizing the reference path        
* Merge base and reference paths        
* Normalize the merged path

This function places the result of the        resolution into this URL in place&period;

If an error occurs, the contents of        this URL are unspecified and a result        with an `system&colon;&colon;error&lowbar;code` is returned&period;

[NOTE]
Abnormal hrefs where the number of &quot;&period;&period;&quot;        segments exceeds the number of segments in        the base path are handled by including the        unmatched &quot;&period;&period;&quot; segments in the result, as described        in link:https://www.rfc-editor.org/errata/eid4547[Errata 4547]&period;


=== Example

[,cpp]
----
url base1( "/one/two/three" );
base1.resolve("four");
assert( base1.buffer() == "/one/two/four" );

url base2( "http://example.com/" )
base2.resolve("/one");
assert( base2.buffer() == "http://example.com/one" );

url base3( "http://example.com/one" );
base3.resolve("/two");
assert( base3.buffer() == "http://example.com/two" );

url base4( "http://a/b/c/d;p?q" );
base4.resolve("g#s");
assert( base4.buffer() == "http://a/b/c/g#s" );
----

=== BNF

[,cpp]
----
absolute-URI  = scheme ":" hier-part [ "?" query ]
----

=== Exception Safety

Basic guarantee&period;        Calls to allocate may throw&period;


=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-5[5&period; Reference Resolution (rfc3986)]



== Return Value


An empty result upon success,        otherwise an error code if `!base&period;has&lowbar;scheme()`&period;



== Parameters


|===
| Name | Description

| *ref*
| The URL reference to resolve&period;


|===

== See Also


xref:#boost-urls-url[url],            xref:#boost-urls-url_view[url&lowbar;view]&period;





== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2788[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
system::result&lt;void&gt;
resolve(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& base,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& ref,
    <<boost-urls-url_base,url&lowbar;base>>& dest);
----


Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1885[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls,urls>>::<<boost-urls-segments_ref,segments&lowbar;ref>>
<<boost-urls-url_base-segments-0e,segments>>() noexcept;
----

[.small]#<<boost-urls-url_base-segments-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_view,segments&lowbar;view>>
<<boost-urls-url_base-segments-04,segments>>() const noexcept;
----

[.small]#<<boost-urls-url_base-segments-04,_» more..._>>#

== Description


This function returns a bidirectional        view of segments over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
url u( "http://example.com/path/to/file.txt" );

segments sv = u.segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path[set&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1885[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls,urls>>::<<boost-urls-segments_ref,segments&lowbar;ref>>
segments() noexcept;
----

== Description


This function returns a bidirectional        view of segments over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;        The container is modifiable&semi; changes        to the container are reflected in the        underlying URL&period;


=== Example

[,cpp]
----
url u( "http://example.com/path/to/file.txt" );

segments sv = u.segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path[set&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1889[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_view,segments&lowbar;view>>
segments() const noexcept;
----

== Description


This function returns a bidirectional        view of strings over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;


=== Example

[,cpp]
----
segments_view sv = url_view( "/path/to/file.txt" ).segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = [ "/" ] segment *( "/" segment )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-is_path_absolute[is&lowbar;path&lowbar;absolute],            xref:#boost-urls-url_view_base-encoded_path[encoded&lowbar;path],            xref:#boost-urls-url_view_base-encoded_segments[encoded&lowbar;segments]&period;            xref:#boost-urls-url_view_base-path[path],            xref:#boost-urls-segments_view[segments&lowbar;view]&period;





Set the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L395[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;authority(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the authority        to the specified string&period;        The string may contain percent&hyphen;escapes&period;


=== Example

[,cpp]
----
assert( url().set_encoded_authority( "My%20Computer" ).has_authority() );
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[            3&period;2&period; Authority (rfc3986)]
        



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;eror`
| The string contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The authority string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_authority[remove&lowbar;authority]&period;





Set the fragment&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2522[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;fragment(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the fragment to the        specified string, which may contain        percent&hyphen;escapes and which may be empty&period;        An empty fragment is distinct from        having no fragment&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == true && this->fragment() == decode_view( s )
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_fragment[set&lowbar;fragment]&period;





Set the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1039[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;host(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address        enclosed in square brackets, then the
        host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture        address enclosed in square brackets, then
        the host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string&period; This string can contain percent
        escapes, or can be empty&period;        Escapes in the string are preserved,
        and reserved characters in the string        are percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1240[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;host&lowbar;address(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string&period; This string can contain percent
        escapes, or can be empty&period;        Escapes in the string are preserved,
        and reserved characters in the string        are percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255

IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal

IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to a name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1512[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;host&lowbar;name(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


The host is set to the specified string,        which may contain percent&hyphen;escapes and        can be empty&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name]&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the query params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2340[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;params(std::initializer&lowbar;list&lt;<<boost-urls-param_pct_view,param&lowbar;pct&lowbar;view>>&gt; ps) noexcept;
----

== Description


This sets the query params to the elements        in the list, which may contain        percent&hyphen;escapes and can be empty&period;

An empty list of params is distinct from        having no query&period;

Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_params( {"id", "42"} ).encoded_query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true
----

=== Complexity

Linear&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| some element in `ps` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *ps*
| The params to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_params[set&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the password&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L821[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;password(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the password in        the userinfo to the string, which        may contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" );
----

=== Postconditions

[,cpp]
----
this->has_password() == true
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period; This string may        contain any characters, including nulls&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1830[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;path(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the path to the        string, which may contain percent&hyphen;escapes        and can be empty&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;

[NOTE]
The library may adjust the final result        to ensure that no other parts of the url        is semantically affected&period;


=== Example

[,cpp]
----
url u( "http://www.example.com" );

u.set_encoded_path( "path/to/file.txt" );

assert( u.encoded_path() == "/path/to/file.txt" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-segments-04[segments],            xref:#boost-urls-url_base-set_path[set&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Set the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2062[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;query(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This sets the query to the string, which        may contain percent&hyphen;escapes and can be        empty&period;        An empty query is distinct from having        no query&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true && this->query() == decode_view( s );
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L712[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;user(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


This function sets the user part of the        userinfo the the string, which may        contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_userinfo() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_password[set&lowbar;password],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the userinfo&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L569[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;encoded&lowbar;userinfo(<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>> s);
----

== Description


The userinfo is set to the given string,        which may contain percent&hyphen;escapes&period;        Escapes in the string are preserved,        and reserved characters in the string        are percent&hyphen;escaped in the result&period;        The effects on the user and password        depend on the presence of a colon (&apos;&colon;&apos;)        in the string&colon;

* If an unescaped colon exists, the        characters up to the colon become
        the user and the rest of the characters        after the colon become the password&period;
        In this case 
has&lowbar;password
 returns        true&period; Otherwise,
* If there is no colon, the user is        set to the string&period; The function
        
has&lowbar;password
 returns false&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_userinfo[remove&lowbar;userinfo],            xref:#boost-urls-url_base-set_userinfo[set&lowbar;userinfo]&period;





Set the fragment&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2471[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;fragment(core::string&lowbar;view s);
----

== Description


This function sets the fragment to the        specified string, which may be empty&period;        An empty fragment is distinct from        having no fragment&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" );
----

=== Postconditions

[,cpp]
----
this->has_fragment() == true && this->fragment() == s
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
fragment    = *( pchar / "/" / "?" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period;  Fragment]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_fragment[remove&lowbar;fragment],            xref:#boost-urls-url_base-set_encoded_fragment[set&lowbar;encoded&lowbar;fragment]&period;





Set the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L955[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;host(core::string&lowbar;view s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address        enclosed in square brackets, then the
        host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture        address enclosed in square brackets, then
        the host is set to that address&period;        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string, which may be empty&period;
        Reserved characters in the string are        percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1137[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;host&lowbar;address(core::string&lowbar;view s);
----

== Description


Depending on the contents of the passed        string, this function sets the host&colon;

* If the string is a valid IPv4 address,        then the host is set to the address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv4
&period;
* If the string is a valid IPv6 address,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipv6
&period;
* If the string is a valid IPvFuture,        then the host is set to that address&period;
        The host type is 
host&lowbar;type&colon;&colon;ipvfuture
&period;
* Otherwise, the host name is set to        the string, which may be empty&period;
        Reserved characters in the string are        percent&hyphen;escaped in the result&period;
        The host type is 
host&lowbar;type&colon;&colon;name
&period;

In all cases, when this function returns,        the URL contains an authority&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255

IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal

IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1296[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;host&lowbar;ipv4(<<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr);
----

== Description


The host is set to the specified IPv4        address&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv4]&period;


=== Example

[,cpp]
----
assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" );
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *addr*
| The address to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1360[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;host&lowbar;ipv6(<<boost-urls-ipv6_address,ipv6&lowbar;address>> const& addr);
----

== Description


The host is set to the specified IPv6        address&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv6]&period;


=== Example

[,cpp]
----
assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *addr*
| The address to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to an address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1412[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;host&lowbar;ipvfuture(core::string&lowbar;view s);
----

== Description


The host is set to the specified IPvFuture        string&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipvfuture]&period;


=== Example

[,cpp]
----
assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
IPvFuture     = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_name[set&lowbar;host&lowbar;name]&period;





Set the host to a name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1459[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;host&lowbar;name(core::string&lowbar;view s);
----

== Description


The host is set to the specified string,        which may be empty&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;        The host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name]&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[            3&period;2&period;2&period; Host (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-set_encoded_host[set&lowbar;encoded&lowbar;host],            xref:#boost-urls-url_base-set_encoded_host_address[set&lowbar;encoded&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_encoded_host_name[set&lowbar;encoded&lowbar;host&lowbar;name],            xref:#boost-urls-url_base-set_host[set&lowbar;host],            xref:#boost-urls-url_base-set_host_address[set&lowbar;host&lowbar;address],            xref:#boost-urls-url_base-set_host_ipv4[set&lowbar;host&lowbar;ipv4],            xref:#boost-urls-url_base-set_host_ipv6[set&lowbar;host&lowbar;ipv6],            xref:#boost-urls-url_base-set_host_ipvfuture[set&lowbar;host&lowbar;ipvfuture]&period;





Set the query params

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2278[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;params(
    std::initializer&lowbar;list&lt;<<boost-urls-param_view,param&lowbar;view>>&gt; ps,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opts = &lcub;&rcub;) noexcept;
----

== Description


This sets the query params to the list        of param&lowbar;view, which can be empty&period;

An empty list of params is distinct from        having no params&period;

Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== Complexity

Linear&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
            >3.4.  Query (rfc3986)</a>
        @li <a href=[&colon;&sol;&sol;en&period;wikipedia&period;org&sol;wiki&sol;Query&lowbar;string&quot;            &gt;Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *ps*
| The params to set&period;


| *opts*
| The options for encoding&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query],            xref:#boost-urls-url_base-set_query[set&lowbar;query]&period;





Set the password&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L764[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;password(core::string&lowbar;view s);
----

== Description


This function sets the password in        the userinfo to the string&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" );
----

=== Postconditions

[,cpp]
----
this->has_password() == true && this->password() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period; This string may        contain any characters, including nulls&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_user[set&lowbar;user]&period;





Set the path&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1765[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;path(core::string&lowbar;view s);
----

== Description


This function sets the path to the        string, which may be empty&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;

[NOTE]
The library may adjust the final result        to ensure that no other parts of the url        is semantically affected&period;

[NOTE]
This function does not encode &apos;&sol;&apos; chars, which        are unreserved for paths but reserved for        path segments&period; If a path segment should include        encoded &apos;&sol;&apos;s to differentiate it from path separators,        the functions xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path] or xref:#boost-urls-url_base-segments-04[segments]        should be used instead&period;


=== Example

[,cpp]
----
url u( "http://www.example.com" );

u.set_path( "path/to/file.txt" );

assert( u.path() == "/path/to/file.txt" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-segments-04[segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path_absolute[set&lowbar;path&lowbar;absolute]&period;





Set if the path is absolute

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1699[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
set&lowbar;path&lowbar;absolute(bool absolute);
----

== Description


This function adjusts the path to make        it absolute or not, depending on the        parameter&period;

[NOTE]
If an authority is present, the path        is always absolute&period; In this case, the        function has no effect&period;


=== Example

[,cpp]
----
url u( "path/to/file.txt" );
assert( u.set_path_absolute( true ) );
assert( u.buffer() == "/path/to/file.txt" );
----

=== Postconditions

[,cpp]
----
this->is_path_absolute() == true && this->encoded_path().front() == '/'
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Return Value


true on success&period;



== See Also


xref:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments],            xref:#boost-urls-url_base-segments-04[segments],            xref:#boost-urls-url_base-set_encoded_path[set&lowbar;encoded&lowbar;path],            xref:#boost-urls-url_base-set_path[set&lowbar;path]&period;





Set the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1599[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;port(core::string&lowbar;view s);
----

== Description


This port is set to the string, which        must contain only digits or be empty&period;        An empty port string is distinct from        having no port&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" );
----

=== Postconditions

[,cpp]
----
this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n)
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` does not contain a valid port&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The port string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_port[remove&lowbar;port],            xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Set the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1556[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;port&lowbar;number(std::uint16&lowbar;t n);
----

== Description


The port is set to the specified integer&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_port() == true && this->port_number() == n
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

port          = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3&period;2&period;3&period; Port (rfc3986)]



== Parameters


|===
| Name | Description

| *n*
| The port number to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_port[remove&lowbar;port],            xref:#boost-urls-url_base-set_port[set&lowbar;port]&period;





Set the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2007[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;query(core::string&lowbar;view s);
----

== Description


This sets the query to the string, which        can be empty&period;        An empty query is distinct from having        no query&period;        Reserved characters in the string are        percent&hyphen;escaped in the result&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" );
----

=== Postconditions

[,cpp]
----
this->has_query() == true && this->query() == s
----

=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params],            xref:#boost-urls-url_base-params-0c[params],            xref:#boost-urls-url_base-remove_query[remove&lowbar;query],            xref:#boost-urls-url_base-set_encoded_query[set&lowbar;encoded&lowbar;query]&period;





Set the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L244[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;scheme(core::string&lowbar;view s);
----

== Description


The scheme is set to the specified        string, which must contain a valid        scheme without any trailing colon        (&apos;&colon;&apos;)&period;        Note that schemes are case&hyphen;insensitive,        and the canonical form is lowercased&period;


=== Example

[,cpp]
----
assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid scheme&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The scheme to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_scheme[remove&lowbar;scheme]&period;





Set the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L279[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;scheme&lowbar;id(<<boost-urls,urls>>::<<boost-urls-scheme,scheme>> id);
----

== Description


This function sets the scheme to the specified        known xref:#boost-urls-scheme[urls&colon;&colon;scheme] id, which may not be        xref:#boost-urls-scheme[scheme&colon;&colon;unknown] or else an exception is        thrown&period; If the id is xref:#boost-urls-scheme[scheme&colon;&colon;none], this        function behaves as if xref:#boost-urls-url_base-remove_scheme[remove&lowbar;scheme]        were called&period;


=== Example

[,cpp]
----
assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" );
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;        Exceptions thrown on invalid input&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[            3&period;1&period; Scheme (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The scheme is invalid&period;


|===

== Parameters


|===
| Name | Description

| *id*
| The scheme to set&period;


|===


Set the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L659[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;user(core::string&lowbar;view s);
----

== Description


This function sets the user part of the        userinfo to the string&period;        Any special or reserved characters in the        string are automatically percent&hyphen;encoded&period;


=== Example

[,cpp]
----
assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" );
----

=== Postconditions

[,cpp]
----
this->has_authority() == true && this->has_userinfo() == true
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_password[remove&lowbar;password],            xref:#boost-urls-url_base-set_encoded_password[set&lowbar;encoded&lowbar;password],            xref:#boost-urls-url_base-set_encoded_user[set&lowbar;encoded&lowbar;user],            xref:#boost-urls-url_base-set_password[set&lowbar;password]&period;





Set the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L503[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_base,url&lowbar;base>>&
set&lowbar;userinfo(core::string&lowbar;view s);
----

== Description


The userinfo is set to the given string,        which may contain percent&hyphen;escapes&period;        Any special or reserved characters in the        string are automatically percent&hyphen;encoded&period;        The effects on the user and password        depend on the presence of a colon (&apos;&colon;&apos;)        in the string&colon;

* If an unescaped colon exists, the        characters up to the colon become
        the user and the rest of the characters        after the colon become the password&period;
        In this case 
has&lowbar;password
 returns        true&period; Otherwise,
* If there is no colon, the user is        set to the string&period; The function
        
has&lowbar;password
 returns false&period;

[NOTE]
The interpretation of the userinfo as        individual user and password components        is scheme&hyphen;dependent&period; Transmitting        passwords in URLs is deprecated&period;


=== Example

[,cpp]
----
assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" );
----

=== Complexity

Linear in `this&hyphen;&gt;size() &plus; s&period;size()`&period;


=== Exception Safety

Strong guarantee&period;        Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo      = [ [ user ] [ ':' password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[            3&period;2&period;1&period; User Information (rfc3986)]



== Parameters


|===
| Name | Description

| *s*
| The string to set&period;


|===

== See Also


xref:#boost-urls-url_base-remove_userinfo[remove&lowbar;userinfo],            xref:#boost-urls-url_base-set_encoded_userinfo[set&lowbar;encoded&lowbar;userinfo]&period;





A non&hyphen;owning reference to a valid URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L74[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class url&lowbar;view
    : public <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>>;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-authority,`authority`>> 
| Return the authority

| <<boost-urls-url_view_base-buffer,`buffer`>> 
| Return the url string

| <<boost-urls-url_view_base-compare,`compare`>> 
| Return the result of comparing this with another url

| <<boost-urls-url_view_base-data,`data`>> 
| Return a pointer to the url&apos;s character buffer

| <<boost-urls-url_view_base-empty,`empty`>> 
| Return true if the url is empty

| <<boost-urls-url_view_base-encoded_authority,`encoded&lowbar;authority`>> 
| Return the authority&period;

| <<boost-urls-url_view_base-encoded_fragment,`encoded&lowbar;fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-encoded_host,`encoded&lowbar;host`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_address,`encoded&lowbar;host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_and_port,`encoded&lowbar;host&lowbar;and&lowbar;port`>> 
| Return the host and port

| <<boost-urls-url_view_base-encoded_host_name,`encoded&lowbar;host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-encoded_origin,`encoded&lowbar;origin`>> 
| Return the origin

| <<boost-urls-url_view_base-encoded_params,`encoded&lowbar;params`>> 
| Return the query as a container of parameters

| <<boost-urls-url_view_base-encoded_password,`encoded&lowbar;password`>> 
| Return the password

| <<boost-urls-url_view_base-encoded_path,`encoded&lowbar;path`>> 
| Return the path

| <<boost-urls-url_view_base-encoded_query,`encoded&lowbar;query`>> 
| Return the query

| <<boost-urls-url_view_base-encoded_resource,`encoded&lowbar;resource`>> 
| Return the resource

| <<boost-urls-url_view_base-encoded_segments,`encoded&lowbar;segments`>> 
| Return the path as a container of segments

| <<boost-urls-url_view_base-encoded_target,`encoded&lowbar;target`>> 
| Return the target

| <<boost-urls-url_view_base-encoded_user,`encoded&lowbar;user`>> 
| Return the user

| <<boost-urls-url_view_base-encoded_userinfo,`encoded&lowbar;userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-encoded_zone_id,`encoded&lowbar;zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url_view_base-fragment,`fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-has_authority,`has&lowbar;authority`>> 
| Return true if an authority is present

| <<boost-urls-url_view_base-has_fragment,`has&lowbar;fragment`>> 
| Return true if a fragment is present

| <<boost-urls-url_view_base-has_password,`has&lowbar;password`>> 
| Return true if a password is present

| <<boost-urls-url_view_base-has_port,`has&lowbar;port`>> 
| Return true if a port is present

| <<boost-urls-url_view_base-has_query,`has&lowbar;query`>> 
| Return true if a query is present

| <<boost-urls-url_view_base-has_scheme,`has&lowbar;scheme`>> 
| Return true a scheme is present

| <<boost-urls-url_view_base-has_userinfo,`has&lowbar;userinfo`>> 
| Return true if a userinfo is present

| <<boost-urls-url_view_base-host,`host`>> 
| Return the host

| <<boost-urls-url_view_base-host_address,`host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-host_ipv4_address,`host&lowbar;ipv4&lowbar;address`>> 
| Return the host IPv4 address

| <<boost-urls-url_view_base-host_ipv6_address,`host&lowbar;ipv6&lowbar;address`>> 
| Return the host IPv6 address

| <<boost-urls-url_view_base-host_ipvfuture,`host&lowbar;ipvfuture`>> 
| Return the host IPvFuture address

| <<boost-urls-url_view_base-host_name,`host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-host_type,`host&lowbar;type`>> 
| Return the host type

| <<boost-urls-url_view_base-is_path_absolute,`is&lowbar;path&lowbar;absolute`>> 
| Return true if the path is absolute

| <<boost-urls-url_view_base-2conversion,`operator core::string&lowbar;view`>> 
| Return the URL as a core&colon;&colon;string&lowbar;view

| <<boost-urls-url_view-operator_assign,`operator&equals;`>> 
| Assignment


| <<boost-urls-url_view_base-params,`params`>> 
| Return the query as a container of parameters


| <<boost-urls-url_view_base-password,`password`>> 
| Return the password

| <<boost-urls-url_view_base-path,`path`>> 
| Return the path

| <<boost-urls-url_view_base-persist,`persist`>> 
| Return a shared, persistent copy of the url

| <<boost-urls-url_view_base-port,`port`>> 
| Return the port

| <<boost-urls-url_view_base-port_number,`port&lowbar;number`>> 
| Return the port

| <<boost-urls-url_view_base-query,`query`>> 
| Return the query

| <<boost-urls-url_view_base-scheme,`scheme`>> 
| Return the scheme

| <<boost-urls-url_view_base-scheme_id,`scheme&lowbar;id`>> 
| Return the scheme

| <<boost-urls-url_view_base-segments,`segments`>> 
| Return the path as a container of segments

| <<boost-urls-url_view_base-size,`size`>> 
| Return the number of characters in the url

| <<boost-urls-url_view-2constructor,`url&lowbar;view`>>         [.small]#[constructor]#
| Constructor

xref:#boost-urls-url_view-2constructor-00[url&lowbar;view(core&colon;&colon;string&lowbar;view)]


| <<boost-urls-url_view_base-user,`user`>> 
| Return the user

| <<boost-urls-url_view_base-userinfo,`userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-zone_id,`zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url_view-2destructor,`&#126;url&lowbar;view`>> [.small]#[destructor]#
| Destructor

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible


|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-08friend-02,`operator!&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-05,`operator&lt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-0ff,`operator&lt;&lt;`>> 
| Format the url to the output stream

| <<boost-urls-url_view_base-08friend-04a,`operator&lt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-07c,`operator&equals;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-073,`operator&gt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-06,`operator&gt;&equals;`>> 
| Return the result of comparing two URLs

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-digest,`digest`>> 
| Calculate a hash of the url

|===


== Description


Objects of this type represent valid URL    strings constructed from a parsed, external    character buffer whose storage is managed    by the caller&period; That is, it acts like a    `core&colon;&colon;string&lowbar;view` in terms of ownership&period;    The caller is responsible for ensuring    that the lifetime of the underlying    character buffer extends until it is no    longer referenced&period;


=== Example 1

Construction from a string parses the input    as a _URI&hyphen;reference_ and throws an    exception on error&period; Upon success, the    constructed object points to the passed    character buffer&semi; ownership is not    transferred&period;

[,cpp]
----
url_view u( "https://www.example.com/index.htm?text=none#a1" );
----

=== Example 2

Parsing functions like xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference]    return a result containing either a valid    xref:#boost-urls-url_view-2constructor-00[url&lowbar;view] upon succcess, otherwise they    contain an error&period; The error can be converted to    an exception by the caller if desired&colon;

[,cpp]
----
system::result< url_view > rv = parse_uri_reference( "https://www.example.com/index.htm?text=none#a1" );
----

=== BNF

[,cpp]
----
URI-reference = URI / relative-ref

URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://tools.ietf.org/html/rfc3986[Uniform Resource Identifier (URI)&colon; Generic Syntax (rfc3986)]



== See Also


xref:#boost-urls-parse_absolute_uri[parse&lowbar;absolute&lowbar;uri],        xref:#boost-urls-parse_origin_form[parse&lowbar;origin&lowbar;form],        xref:#boost-urls-parse_relative_ref[parse&lowbar;relative&lowbar;ref],        xref:#boost-urls-parse_uri[parse&lowbar;uri],        xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference]&period;





Return the maximum number of characters possible

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L331[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
static
std::size&lowbar;t
max&lowbar;size() noexcept;
----

== Description


This represents the largest number of        characters that are possible in a url,        not including any null terminator&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L283[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view,url&lowbar;view>>&
<<boost-urls-url_view-operator_assign-02,operator&equals;>>(<<boost-urls-url_view,url&lowbar;view>> const& other) noexcept;
----

[.small]#<<boost-urls-url_view-operator_assign-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view,url&lowbar;view>>&
<<boost-urls-url_view-operator_assign-0f,operator&equals;>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& other) noexcept;
----

[.small]#<<boost-urls-url_view-operator_assign-0f,_» more..._>>#

== Description


After assignment, both views        reference the same underlying character        buffer&period; Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L283[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view,url&lowbar;view>>&
operator&equals;(<<boost-urls-url_view,url&lowbar;view>> const& other) noexcept;
----

== Description


After assignment, both views        reference the same underlying character        buffer&period; Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Assignment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L310[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view,url&lowbar;view>>&
operator&equals;(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& other) noexcept;
----

== Description


After assignment, both views        reference the same underlying character        buffer&period; Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L89[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-url_view-2constructor-00,url&lowbar;view>>(&sol;&ast; implementation-defined &ast;&sol;::url&lowbar;impl const& impl) noexcept;
----

[.small]#<<boost-urls-url_view-2constructor-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view-2constructor-0c,url&lowbar;view>>() noexcept;
----

[.small]#<<boost-urls-url_view-2constructor-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view-2constructor-025,url&lowbar;view>>(core::string&lowbar;view s);
----

[.small]#<<boost-urls-url_view-2constructor-025,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class String&gt;
requires std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value &amp;&amp;
            !std&colon;&colon;is&lowbar;convertible&lt;
                String&ast;,
                url&lowbar;view&lowbar;base&ast;
                    &gt;&colon;&colon;value &amp;&amp; std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value &amp;&amp;
            !std&colon;&colon;is&lowbar;convertible&lt;
                String&ast;,
                url&lowbar;view&lowbar;base&ast;
                    &gt;&colon;&colon;value
<<boost-urls-url_view-2constructor-00,url&lowbar;view>>(String const& s);
----

[.small]#<<boost-urls-url_view-2constructor-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view-2constructor-024,url&lowbar;view>>(<<boost-urls-url_view,url&lowbar;view>> const& other) noexcept;
----

[.small]#<<boost-urls-url_view-2constructor-024,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view-2constructor-0a,url&lowbar;view>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& other) noexcept;
----

[.small]#<<boost-urls-url_view-2constructor-0a,_» more..._>>#

== Description


Default constructed views refer to        a string with zero length, which        always remains valid&period; This matches        the grammar for a relative&hyphen;ref with        an empty path and no query or        fragment&period;


=== Example

[,cpp]
----
url_view u;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


xref:#boost-urls-url_view-2constructor-00[url&lowbar;view(core&colon;&colon;string&lowbar;view)]

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L200[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class String&gt;
requires std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value &amp;&amp;
            !std&colon;&colon;is&lowbar;convertible&lt;
                String&ast;,
                url&lowbar;view&lowbar;base&ast;
                    &gt;&colon;&colon;value &amp;&amp; std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value &amp;&amp;
            !std&colon;&colon;is&lowbar;convertible&lt;
                String&ast;,
                url&lowbar;view&lowbar;base&ast;
                    &gt;&colon;&colon;value
url&lowbar;view(String const& s);
----


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L146[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url&lowbar;view() noexcept;
----

== Description


Default constructed views refer to        a string with zero length, which        always remains valid&period; This matches        the grammar for a relative&hyphen;ref with        an empty path and no query or        fragment&period;


=== Example

[,cpp]
----
url_view u;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L197[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url&lowbar;view(core::string&lowbar;view s);
----

== Description


This function constructs a URL from        the string `s`, which must contain a        valid _URI_ or _relative&hyphen;ref_        or else an exception is thrown&period; Upon        successful construction, the view        refers to the characters in the        buffer pointed to by `s`&period;        Ownership is not transferred&semi; The caller        is responsible for ensuring that the        lifetime of the buffer extends until        it is no longer referenced&period;


=== Example

[,cpp]
----
url_view u( "http://www.example.com/index.htm" );
----

=== Effects

[,cpp]
----
return parse_uri_reference( s ).value();
----

=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4&period;1&period; URI Reference]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===

== See Also


xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference]&period;





Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L239[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url&lowbar;view(<<boost-urls-url_view,url&lowbar;view>> const& other) noexcept;
----

== Description


After construction, both views        reference the same underlying character        buffer&period; Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L263[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url&lowbar;view(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& other) noexcept;
----

== Description


After construction, both views        reference the same underlying character        buffer&period; Ownership is not transferred&period;


=== Postconditions

[,cpp]
----
this->buffer().data() == other.buffer().data()
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Destructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view.hpp#L110[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
&#126;url&lowbar;view() = default;
----

== Description


Any params, segments, iterators, or        other views which reference the same        underlying character buffer remain        valid&period;




Common functionality for containers

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L65[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class url&lowbar;view&lowbar;base;
----

== Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-authority,`authority`>> 
| Return the authority

| <<boost-urls-url_view_base-buffer,`buffer`>> 
| Return the url string

| <<boost-urls-url_view_base-compare,`compare`>> 
| Return the result of comparing this with another url

| <<boost-urls-url_view_base-data,`data`>> 
| Return a pointer to the url&apos;s character buffer

| <<boost-urls-url_view_base-empty,`empty`>> 
| Return true if the url is empty

| <<boost-urls-url_view_base-encoded_authority,`encoded&lowbar;authority`>> 
| Return the authority&period;

| <<boost-urls-url_view_base-encoded_fragment,`encoded&lowbar;fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-encoded_host,`encoded&lowbar;host`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_address,`encoded&lowbar;host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-encoded_host_and_port,`encoded&lowbar;host&lowbar;and&lowbar;port`>> 
| Return the host and port

| <<boost-urls-url_view_base-encoded_host_name,`encoded&lowbar;host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-encoded_origin,`encoded&lowbar;origin`>> 
| Return the origin

| <<boost-urls-url_view_base-encoded_params,`encoded&lowbar;params`>> 
| Return the query as a container of parameters

| <<boost-urls-url_view_base-encoded_password,`encoded&lowbar;password`>> 
| Return the password

| <<boost-urls-url_view_base-encoded_path,`encoded&lowbar;path`>> 
| Return the path

| <<boost-urls-url_view_base-encoded_query,`encoded&lowbar;query`>> 
| Return the query

| <<boost-urls-url_view_base-encoded_resource,`encoded&lowbar;resource`>> 
| Return the resource

| <<boost-urls-url_view_base-encoded_segments,`encoded&lowbar;segments`>> 
| Return the path as a container of segments

| <<boost-urls-url_view_base-encoded_target,`encoded&lowbar;target`>> 
| Return the target

| <<boost-urls-url_view_base-encoded_user,`encoded&lowbar;user`>> 
| Return the user

| <<boost-urls-url_view_base-encoded_userinfo,`encoded&lowbar;userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-encoded_zone_id,`encoded&lowbar;zone&lowbar;id`>> 
| Return the IPv6 Zone ID

| <<boost-urls-url_view_base-fragment,`fragment`>> 
| Return the fragment

| <<boost-urls-url_view_base-has_authority,`has&lowbar;authority`>> 
| Return true if an authority is present

| <<boost-urls-url_view_base-has_fragment,`has&lowbar;fragment`>> 
| Return true if a fragment is present

| <<boost-urls-url_view_base-has_password,`has&lowbar;password`>> 
| Return true if a password is present

| <<boost-urls-url_view_base-has_port,`has&lowbar;port`>> 
| Return true if a port is present

| <<boost-urls-url_view_base-has_query,`has&lowbar;query`>> 
| Return true if a query is present

| <<boost-urls-url_view_base-has_scheme,`has&lowbar;scheme`>> 
| Return true a scheme is present

| <<boost-urls-url_view_base-has_userinfo,`has&lowbar;userinfo`>> 
| Return true if a userinfo is present

| <<boost-urls-url_view_base-host,`host`>> 
| Return the host

| <<boost-urls-url_view_base-host_address,`host&lowbar;address`>> 
| Return the host

| <<boost-urls-url_view_base-host_ipv4_address,`host&lowbar;ipv4&lowbar;address`>> 
| Return the host IPv4 address

| <<boost-urls-url_view_base-host_ipv6_address,`host&lowbar;ipv6&lowbar;address`>> 
| Return the host IPv6 address

| <<boost-urls-url_view_base-host_ipvfuture,`host&lowbar;ipvfuture`>> 
| Return the host IPvFuture address

| <<boost-urls-url_view_base-host_name,`host&lowbar;name`>> 
| Return the host name

| <<boost-urls-url_view_base-host_type,`host&lowbar;type`>> 
| Return the host type

| <<boost-urls-url_view_base-is_path_absolute,`is&lowbar;path&lowbar;absolute`>> 
| Return true if the path is absolute

| <<boost-urls-url_view_base-2conversion,`operator core::string&lowbar;view`>> 
| Return the URL as a core&colon;&colon;string&lowbar;view

| <<boost-urls-url_view_base-params,`params`>> 
| Return the query as a container of parameters


| <<boost-urls-url_view_base-password,`password`>> 
| Return the password

| <<boost-urls-url_view_base-path,`path`>> 
| Return the path

| <<boost-urls-url_view_base-persist,`persist`>> 
| Return a shared, persistent copy of the url

| <<boost-urls-url_view_base-port,`port`>> 
| Return the port

| <<boost-urls-url_view_base-port_number,`port&lowbar;number`>> 
| Return the port

| <<boost-urls-url_view_base-query,`query`>> 
| Return the query

| <<boost-urls-url_view_base-scheme,`scheme`>> 
| Return the scheme

| <<boost-urls-url_view_base-scheme_id,`scheme&lowbar;id`>> 
| Return the scheme

| <<boost-urls-url_view_base-segments,`segments`>> 
| Return the path as a container of segments

| <<boost-urls-url_view_base-size,`size`>> 
| Return the number of characters in the url

| <<boost-urls-url_view_base-user,`user`>> 
| Return the user

| <<boost-urls-url_view_base-userinfo,`userinfo`>> 
| Return the userinfo

| <<boost-urls-url_view_base-zone_id,`zone&lowbar;id`>> 
| Return the IPv6 Zone ID

|===
== Static Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-max_size,`max&lowbar;size`>> 
| Return the maximum number of characters possible

|===
== Friends

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-08friend-02,`operator!&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-05,`operator&lt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-0ff,`operator&lt;&lt;`>> 
| Format the url to the output stream

| <<boost-urls-url_view_base-08friend-04a,`operator&lt;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-07c,`operator&equals;&equals;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-073,`operator&gt;`>> 
| Return the result of comparing two URLs

| <<boost-urls-url_view_base-08friend-06,`operator&gt;&equals;`>> 
| Return the result of comparing two URLs

|===

== Protected Member Functions

[cols=2]
|===
| Name | Description 

| <<boost-urls-url_view_base-digest,`digest`>> 
| Calculate a hash of the url

|===


== Description


This base class is used by the library    to provide common member functions for    containers&period; This cannot be instantiated    directly&semi; Instead, use one of the    containers or functions&colon;


=== Containers

* url
        
* url&lowbar;view
        
* static&lowbar;url


=== Functions

* parse&lowbar;absolute&lowbar;uri
        
* parse&lowbar;origin&lowbar;form
        
* parse&lowbar;relative&lowbar;ref
        
* parse&lowbar;uri
        
* parse&lowbar;uri&lowbar;reference




Return the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L524[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-authority_view,authority&lowbar;view>>
authority() const noexcept;
----

== Description


This function returns the authority as        an xref:#boost-urls-authority_view[authority&lowbar;view]&period;


=== Example

[,cpp]
----
authority_view a = url_view( "https://www.example.com:8080/index.htm" ).authority();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_authority[encoded&lowbar;authority],            xref:#boost-urls-url_view_base-has_authority[has&lowbar;authority]&period;





Return the url string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L255[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
buffer() const noexcept;
----

== Description


This function returns the entire url,        which may contain percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com" ).buffer() == "http://www.example.com" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the result of comparing this with another url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2313[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
compare(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& other) const noexcept;
----

== Description


This function compares two URLs        according to Syntax&hyphen;Based comparison        algorithm&period;


=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


&hyphen;1 if `&ast;this &lt; other`, 0 if `this &equals;&equals; other`, and 1 if `this &gt; other`&period;




Return a pointer to the url&apos;s character buffer

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L233[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
char const*
data() const noexcept;
----

== Description


This function returns a pointer to        the first character of the url, which        is not guaranteed to be null&hyphen;terminated&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Calculate a hash of the url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L129[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
digest(std::size&lowbar;t salt = 0) const noexcept;
----

== Description


This function calculates a hash of the        url as if it were always normalized&period;


=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Throws nothing&period;



== Return Value


A hash value suitable for use        in hash&hyphen;based containers&period;



== Parameters


|===
| Name | Description

| *salt*
| An initial value to add to        the hash


|===


Return true if the url is empty

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L215[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
empty() const noexcept;
----

== Description


The empty string matches the        _relative&hyphen;ref_ grammar&period;


=== Example

[,cpp]
----
assert( url_view( "" ).empty() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

relative-part = "//" authority path-abempty
              / path-absolute
              / path-noscheme
              / path-empty
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period;  Relative Reference (rfc3986)]




Return the authority&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L559[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;authority() const noexcept;
----

== Description


If present, this function returns a        string representing the authority (which        may be empty)&period;        Otherwise it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "file://Network%20Drive/My%2DFiles" ).encoded_authority() == "Network%20Drive" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-authority[authority],            xref:#boost-urls-url_view_base-has_authority[has&lowbar;authority]&period;





Return the fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2156[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;fragment() const noexcept;
----

== Description


This function returns the fragment as a        string with percent&hyphen;escapes&period;        Ownership is not transferred&semi; the        string returned references the underlying        character buffer, which must remain valid        or else undefined behavior occurs&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com/index.htm#a%2D1" ).encoded_fragment() == "a%2D1" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
fragment        = *( pchar / "/" / "?" )

pchar           = unreserved / pct-encoded / sub-delims / ":" / "@"
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period; Fragment (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-fragment[fragment],            xref:#boost-urls-url_view_base-has_fragment[has&lowbar;fragment]&period;





Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1053[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host() const noexcept;
----

== Description


This function returns the host portion        of the authority as a string, or the        empty string if there is no authority&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).encoded_host() == "www%2droot.example.com" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1165[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host&lowbar;address() const noexcept;
----

== Description


The value returned by this function        depends on the type of host returned        from the function xref:#boost-urls-url_view_base-host_type[host&lowbar;type]&period;

* If the type is 
host&lowbar;type&colon;&colon;ipv4
,        then the IPv4 address string is returned&period;
* If the type is 
host&lowbar;type&colon;&colon;ipv6
,        then the IPv6 address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;ipvfuture
,        then the IPvFuture address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;name
,        then the host name string is returned&period;        Any percent&hyphen;escapes in the string are
        decoded first&period;
* If the type is 
host&lowbar;type&colon;&colon;none
,        then an empty string is returned&period;        The returned string may contain
        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).encoded_host_address() == "www%2droot.example.com" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host and port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2199[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host&lowbar;and&lowbar;port() const noexcept;
----

== Description


If an authority is present, this        function returns the host and optional        port as a string, which may be empty&period;        Otherwise it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com:8080/index.htm" ).encoded_host_and_port() == "www.example.com:8080" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period;  Host (rfc3986)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_port[has&lowbar;port],            xref:#boost-urls-url_view_base-port[port],            xref:#boost-urls-url_view_base-port_number[port&lowbar;number]&period;





Return the host name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1358[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;host&lowbar;name() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name],        this function returns the name as        a string&period;        Otherwise, if the host type is not an        name, it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).encoded_host_name() == "www%2droot.example.com" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the origin

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2227[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;origin() const noexcept;
----

== Description


If an authority is present, this        function returns the scheme and        authority portion of the url&period;        Otherwise, an empty string is        returned&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com:8080/index.htm?text=none#h1" ).encoded_origin() == "http://www.example.com:8080" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;



== See Also


xref:#boost-urls-url_view_base-encoded_resource[encoded&lowbar;resource],            xref:#boost-urls-url_view_base-encoded_target[encoded&lowbar;target]&period;





Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2013[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>>
encoded&lowbar;params() const noexcept;
----

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;


=== Example

[,cpp]
----
params_encoded_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )
query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_query[encoded&lowbar;query],            xref:#boost-urls-url_view_base-has_query[has&lowbar;query],            xref:#boost-urls-url_view_base-params-05[params],            xref:#boost-urls-url_view_base-query[query]&period;





Return the password

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L936[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;password() const noexcept;
----

== Description


This function returns the password portion        of the userinfo as a percent&hyphen;encoded string&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_password() == "pass" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_password[has&lowbar;password],            xref:#boost-urls-url_view_base-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-url_view_base-encoded_user[encoded&lowbar;user],            xref:#boost-urls-url_view_base-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-url_view_base-password[password],            xref:#boost-urls-url_view_base-user[user],            xref:#boost-urls-url_view_base-userinfo[userinfo]&period;





Return the path

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1698[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;path() const noexcept;
----

== Description


This function returns the path as a        string&period; The path may be empty&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "file:///Program%20Files/Games/config.ini" ).encoded_path() == "/Program%20Files/Games/config.ini" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-is_path_absolute[is&lowbar;path&lowbar;absolute],            xref:#boost-urls-url_view_base-encoded_segments[encoded&lowbar;segments]&period;            xref:#boost-urls-url_view_base-path[path],            xref:#boost-urls-url_view_base-segments[segments]&period;





Return the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1927[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;query() const noexcept;
----

== Description


If this contains a query, it is returned        as a string (which may be empty)&period;        Otherwise, an empty string is returned&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_query() == "id=42&name=jane%2Ddoe&page+size=20" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_params[encoded&lowbar;params],            xref:#boost-urls-url_view_base-has_query[has&lowbar;query],            xref:#boost-urls-url_view_base-params-05[params],            xref:#boost-urls-url_view_base-query[query]&period;





Return the resource

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2257[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;resource() const noexcept;
----

== Description


This function returns the resource, which        is the portion of the url that includes        only the path, query, and fragment&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com/index.html?query#frag" ).encoded_resource() == "/index.html?query#frag" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_origin[encoded&lowbar;origin],            xref:#boost-urls-url_view_base-encoded_target[encoded&lowbar;target]&period;





Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1786[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>
encoded&lowbar;segments() const noexcept;
----

== Description


This function returns a bidirectional        view of strings over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Strings returned when iterating the        range may contain percent escapes&period;


=== Example

[,cpp]
----
segments_encoded_view sv = url_view( "/path/to/file.txt" ).encoded_segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-is_path_absolute[is&lowbar;path&lowbar;absolute],            xref:#boost-urls-url_view_base-encoded_path[encoded&lowbar;path],            xref:#boost-urls-url_view_base-path[path],            xref:#boost-urls-url_view_base-segments[segments],            xref:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view]&period;





Return the target

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2287[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;target() const noexcept;
----

== Description


This function returns the target, which        is the portion of the url that includes        only the path and query&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com/index.html?query#frag" ).encoded_target() == "/index.html?query" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]
        
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_origin[encoded&lowbar;origin],            xref:#boost-urls-url_view_base-encoded_resource[encoded&lowbar;resource]&period;





Return the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L846[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;user() const noexcept;
----

== Description


If present, this function returns a        string representing the user (which        may be empty)&period;        Otherwise it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_user() == "jane%2Ddoe" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_password[has&lowbar;password],            xref:#boost-urls-url_view_base-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-url_view_base-encoded_password[encoded&lowbar;password],            xref:#boost-urls-url_view_base-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-url_view_base-password[password],            xref:#boost-urls-url_view_base-user[user],            xref:#boost-urls-url_view_base-userinfo[userinfo]&period;





Return the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L750[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;userinfo() const noexcept;
----

== Description


If present, this function returns a        string representing the userinfo (which        may be empty)&period;        Otherwise it returns an empty string&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_userinfo() == "jane%2Ddoe:pass" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_password[has&lowbar;password],            xref:#boost-urls-url_view_base-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-url_view_base-encoded_password[encoded&lowbar;password],            xref:#boost-urls-url_view_base-encoded_user[encoded&lowbar;user],            xref:#boost-urls-url_view_base-password[password],            xref:#boost-urls-url_view_base-user[user],            xref:#boost-urls-url_view_base-userinfo[userinfo]&period;





Return the IPv6 Zone ID

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1438[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>
encoded&lowbar;zone&lowbar;id() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv6],        this function returns the Zone ID as        a string&period; Otherwise an empty string is returned&period;        The returned string may contain        percent escapes&period;


=== Example

[,cpp]
----
assert( url_view( "http://[fe80::1%25eth0]/" ).encoded_zone_id() == "eth0" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture  ) "]"

ZoneID = 1*( unreserved / pct-encoded )

IPv6addrz = IPv6address "%25" ZoneID
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc6874[Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers]




Return the fragment

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2111[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
fragment(StringToken&& token = &lcub;&rcub;);
----

== Description


This function calculates the fragment        of the url, with percent escapes decoded        and without the leading pound sign (&apos;&num;&apos;)        whose presence indicates that the url        contains a fragment&period;

This function accepts an optional        _StringToken_ parameter which        controls the return type and behavior        of the function&colon;

* When called with no arguments,        the return type of the function is
        
`std&colon;&colon;string`
&period; Otherwise
* When called with a string token,        the behavior and return type of the
        function depends on the type of string        token being passed&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com/index.htm#a%2D1" ).fragment() == "a-1" );
----

=== Complexity

Linear in `this&hyphen;&gt;fragment()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;        String tokens may throw exceptions&period;


=== BNF

[,cpp]
----
fragment        = *( pchar / "/" / "?" )

fragment-part   = [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period; Fragment (rfc3986)]



== Parameters


|===
| Name | Description

| *token*
| An optional string token to        use&period; If this parameter is omitted, the        function returns a new `std&colon;&colon;string`&period;


|===

== See Also


xref:#boost-urls-url_view_base-encoded_fragment[encoded&lowbar;fragment],            xref:#boost-urls-url_view_base-has_fragment[has&lowbar;fragment]&period;





Return true if an authority is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L490[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;authority() const noexcept;
----

== Description


This function returns true if the url        contains an authority&period; The presence of        an authority is denoted by a double        slash (&quot;&sol;&sol;&quot;) at the beginning or after        the scheme&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com/index.htm" ).has_authority() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority       = [ userinfo "@" ] host [ ":" port ]

URI             = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

absolute-URI    = scheme ":" hier-part [ "?" query ]

URI-reference   = URI / relative-ref

relative-ref    = relative-part [ "?" query ] [ "#" fragment ]

hier-part       = "//" authority path-abempty
                ; (more...)

relative-part   = "//" authority path-abempty
                ; (more...)

----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-authority[authority],            xref:#boost-urls-url_view_base-encoded_authority[encoded&lowbar;authority]&period;





Return true if a fragment is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2054[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;fragment() const noexcept;
----

== Description


This function returns true if the url        contains a fragment&period;        An empty fragment is distinct from        no fragment&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com/index.htm#anchor" ).has_fragment() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3&period;5&period; Fragment (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_fragment[encoded&lowbar;fragment],            xref:#boost-urls-url_view_base-fragment[fragment]&period;





Return true if a password is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L644[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;password() const noexcept;
----

== Description


This function returns true if the        userinfo is present and contains        a password&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_password() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-url_view_base-encoded_password[encoded&lowbar;password],            xref:#boost-urls-url_view_base-encoded_user[encoded&lowbar;user],            xref:#boost-urls-url_view_base-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-url_view_base-password[password],            xref:#boost-urls-url_view_base-user[user],            xref:#boost-urls-url_view_base-userinfo[userinfo]&period;





Return true if a port is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1478[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;port() const noexcept;
----

== Description


This function returns true if an        authority is present and contains a port&period;


=== Example

[,cpp]
----
assert( url_view( "wss://www.example.com:443" ).has_port() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]

port        = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_host_and_port[encoded&lowbar;host&lowbar;and&lowbar;port],            xref:#boost-urls-url_view_base-port[port],            xref:#boost-urls-url_view_base-port_number[port&lowbar;number]&period;





Return true if a query is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1830[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;query() const noexcept;
----

== Description


This function returns true if this        contains a query&period; An empty query is        distinct from having no query&period;


=== Example

[,cpp]
----
assert( url_view( "/sql?id=42&col=name&page-size=20" ).has_query() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_params[encoded&lowbar;params],            xref:#boost-urls-url_view_base-encoded_query[encoded&lowbar;query],            xref:#boost-urls-url_view_base-params-05[params],            xref:#boost-urls-url_view_base-query[query]&period;





Return true a scheme is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L352[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;scheme() const noexcept;
----

== Description


This function returns true if this        contains a scheme&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com" ).has_scheme() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
URI             = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

absolute-URI    = scheme ":" hier-part [ "?" query ]

scheme          = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3&period;1&period; Scheme (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-scheme[scheme],            xref:#boost-urls-url_view_base-scheme_id[scheme&lowbar;id]&period;





Return true if a userinfo is present

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L604[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
has&lowbar;userinfo() const noexcept;
----

== Description


This function returns true if this        contains a userinfo&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_userinfo() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_password[has&lowbar;password],            xref:#boost-urls-url_view_base-encoded_password[encoded&lowbar;password],            xref:#boost-urls-url_view_base-encoded_user[encoded&lowbar;user],            xref:#boost-urls-url_view_base-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-url_view_base-password[password],            xref:#boost-urls-url_view_base-user[user],            xref:#boost-urls-url_view_base-userinfo[userinfo]&period;





Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1011[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
host(StringToken&& token = &lcub;&rcub;);
----

== Description


This function returns the host portion        of the authority as a string, or the        empty string if there is no authority&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).host() == "www-root.example.com" );
----

=== Complexity

Linear in `this&hyphen;&gt;host()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1104[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
host&lowbar;address(StringToken&& token = &lcub;&rcub;);
----

== Description


The value returned by this function        depends on the type of host returned        from the function xref:#boost-urls-url_view_base-host_type[host&lowbar;type]&period;

* If the type is 
host&lowbar;type&colon;&colon;ipv4
,        then the IPv4 address string is returned&period;
* If the type is 
host&lowbar;type&colon;&colon;ipv6
,        then the IPv6 address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;ipvfuture
,        then the IPvFuture address string is returned,        without any enclosing brackets&period;
* If the type is 
host&lowbar;type&colon;&colon;name
,        then the host name string is returned&period;        Any percent&hyphen;escapes in the string are
        decoded first&period;
* If the type is 
host&lowbar;type&colon;&colon;none
,        then an empty string is returned&period;


=== Example

[,cpp]
----
assert( url_view( "https://[1::6:c0a8:1]/" ).host_address() == "1::6:c0a8:1" );
----

=== Complexity

Linear in `this&hyphen;&gt;host&lowbar;address()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host IPv4 address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1203[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv4_address,ipv4&lowbar;address>>
host&lowbar;ipv4&lowbar;address() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv4],        this function returns the address as        a value of type xref:#boost-urls-ipv4_address[ipv4&lowbar;address]&period;        Otherwise, if the host type is not an IPv4        address, it returns a default&hyphen;constructed        value which is equal to the unspecified        address &quot;0&period;0&period;0&period;0&quot;&period;


=== Example

[,cpp]
----
assert( url_view( "http://127.0.0.1/index.htm?user=win95" ).host_ipv4_address() == ipv4_address( "127.0.0.1" ) );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host IPv6 address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1249[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-ipv6_address,ipv6&lowbar;address>>
host&lowbar;ipv6&lowbar;address() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv6],        this function returns the address as        a value of type xref:#boost-urls-ipv6_address[ipv6&lowbar;address]&period;        Otherwise, if the host type is not an IPv6        address, it returns a default&hyphen;constructed        value which is equal to the unspecified        address &quot;0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0&colon;0&quot;&period;


=== Example

[,cpp]
----
assert( url_view( "ftp://[::1]/" ).host_ipv6_address() == ipv6_address( "::1" ) );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host IPvFuture address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1280[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
host&lowbar;ipvfuture() const noexcept;
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipvfuture],        this function returns the address as        a string&period;        Otherwise, if the host type is not an        IPvFuture address, it returns an        empty string&period;


=== Example

[,cpp]
----
assert( url_view( "http://[v1fe.d:9]/index.htm" ).host_ipvfuture() == "v1fe.d:9" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
IPvFuture  = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host name

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1314[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
host&lowbar;name(StringToken&& token = &lcub;&rcub;);
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;name],        this function returns the name as        a string&period; Otherwise an empty string is returned&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "https://www%2droot.example.com/" ).host_name() == "www-root.example.com" );
----

=== Complexity

Linear in `this&hyphen;&gt;host&lowbar;name()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"

reg-name    = *( unreserved / pct-encoded / "-" / ".")
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return the host type

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L974[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls,urls>>::<<boost-urls-host_type,host&lowbar;type>>
host&lowbar;type() const noexcept;
----

== Description


This function returns one of the        following constants representing the        type of host present&period;

* host&lowbar;type&colon;&colon;ipv4
        
* host&lowbar;type&colon;&colon;ipv6
        
* host&lowbar;type&colon;&colon;ipvfuture
        
* host&lowbar;type&colon;&colon;name
        
* host&lowbar;type&colon;&colon;none

When xref:#boost-urls-url_view_base-has_authority[has&lowbar;authority] is false, the        host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;none]&period;


=== Example

[,cpp]
----
assert( url_view( "https://192.168.0.1/local.htm" ).host_type() == host_type::ipv4 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]




Return true if the path is absolute

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1595[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;path&lowbar;absolute() const noexcept;
----

== Description


This function returns true if the path        begins with a forward slash (&apos;&sol;&apos;)&period;


=== Example

[,cpp]
----
assert( url_view( "/path/to/file.txt" ).is_path_absolute() );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_path[encoded&lowbar;path],            xref:#boost-urls-url_view_base-encoded_segments[encoded&lowbar;segments]&period;            xref:#boost-urls-url_view_base-path[path],            xref:#boost-urls-url_view_base-segments[segments]&period;





Return the maximum number of characters possible

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L154[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
static
std::size&lowbar;t
max&lowbar;size() noexcept;
----

== Description


This represents the largest number        of characters that are theoretically        possible to represent in a url,        not including any null terminator&period;        In practice the actual possible size        may be lower than this number&period;


=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the URL as a core&colon;&colon;string&lowbar;view

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L271[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator core::string&lowbar;view() const noexcept;
----

== Description



=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1969[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view,params&lowbar;view>>
<<boost-urls-url_view_base-params-06,params>>() const noexcept;
----

[.small]#<<boost-urls-url_view_base-params-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view,params&lowbar;view>>
<<boost-urls-url_view_base-params-05,params>>(<<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) const noexcept;
----

[.small]#<<boost-urls-url_view_base-params-05,_» more..._>>#

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;


=== Example

[,cpp]
----
params_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_params[encoded&lowbar;params],            xref:#boost-urls-url_view_base-encoded_query[encoded&lowbar;query],            xref:#boost-urls-url_view_base-has_query[has&lowbar;query],            xref:#boost-urls-url_view_base-query[query]&period;





Return the query as a container of parameters

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1969[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view,params&lowbar;view>>
params() const noexcept;
----

== Description


This function returns a bidirectional        view of key&sol;value pairs over the query&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;


=== Example

[,cpp]
----
params_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_params[encoded&lowbar;params],            xref:#boost-urls-url_view_base-encoded_query[encoded&lowbar;query],            xref:#boost-urls-url_view_base-has_query[has&lowbar;query],            xref:#boost-urls-url_view_base-query[query]&period;





== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1972[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-params_view,params&lowbar;view>>
params(<<boost-urls-encoding_opts,encoding&lowbar;opts>> opt) const noexcept;
----


Return the password

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L889[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
password(StringToken&& token = &lcub;&rcub;);
----

== Description


If present, this function returns a        string representing the password (which        may be an empty string)&period;        Otherwise it returns an empty string&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).password() == "pass" );
----

=== Complexity

Linear in `this&hyphen;&gt;password()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_password[has&lowbar;password],            xref:#boost-urls-url_view_base-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-url_view_base-encoded_password[encoded&lowbar;password],            xref:#boost-urls-url_view_base-encoded_user[encoded&lowbar;user],            xref:#boost-urls-url_view_base-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-url_view_base-user[user],            xref:#boost-urls-url_view_base-userinfo[userinfo]&period;





Return the path

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1645[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
path(StringToken&& token = &lcub;&rcub;);
----

== Description


This function returns the path as a        string&period; The path may be empty&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "file:///Program%20Files/Games/config.ini" ).path() == "/Program Files/Games/config.ini" );
----

=== Complexity

Linear in `this&hyphen;&gt;path()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
path          = path-abempty    ; begins with "/" or is empty
              / path-absolute   ; begins with "/" but not "//"
              / path-noscheme   ; begins with a non-colon segment
              / path-rootless   ; begins with a segment
              / path-empty      ; zero characters

path-abempty  = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-noscheme = segment-nz-nc *( "/" segment )
path-rootless = segment-nz *( "/" segment )
path-empty    = 0<pchar>
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-is_path_absolute[is&lowbar;path&lowbar;absolute],            xref:#boost-urls-url_view_base-encoded_path[encoded&lowbar;path],            xref:#boost-urls-url_view_base-encoded_segments[encoded&lowbar;segments]&period;            xref:#boost-urls-url_view_base-segments[segments]&period;





Return a shared, persistent copy of the url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L311[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::shared&lowbar;ptr&lt;<<boost-urls-url_view,url&lowbar;view>> const&gt;
persist() const;
----

== Description


This function returns a read&hyphen;only copy of        the url, with shared lifetime&period; The returned        value owns (persists) the underlying string&period;        The algorithm used to create the value        minimizes the number of individual memory        allocations, making it more efficient than        when using direct standard library functions&period;


=== Example

[,cpp]
----
std::shared_ptr< url_view const > sp;
{
    std::string s( "http://example.com" );
    url_view u( s );                        // u references characters in s

    assert( u.data() == s.data() );         // same buffer

    sp = u.persist();

    assert( sp->data() != s.data() );       // different buffer
    assert( sp->buffer() == s);             // same contents

    // s is destroyed and thus u
    // becomes invalid, but sp remains valid.
}
----

=== Complexity

Linear in `this&hyphen;&gt;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;




Return the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1512[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
port() const noexcept;
----

== Description


If present, this function returns a        string representing the port (which        may be empty)&period;        Otherwise it returns an empty string&period;


=== Example

[,cpp]
----
assert( url_view( "http://localhost.com:8080" ).port() == "8080" );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
port        = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_host_and_port[encoded&lowbar;host&lowbar;and&lowbar;port],            xref:#boost-urls-url_view_base-has_port[has&lowbar;port],            xref:#boost-urls-url_view_base-port_number[port&lowbar;number]&period;





Return the port

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1546[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::uint16&lowbar;t
port&lowbar;number() const noexcept;
----

== Description


If a port is present and the numerical        value is representable, it is returned        as an unsigned integer&period; Otherwise, the        number zero is returned&period;


=== Example

[,cpp]
----
assert( url_view( "http://localhost.com:8080" ).port_number() == 8080 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
port        = *DIGIT
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3&period;2&period;3&period; Port (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-encoded_host_and_port[encoded&lowbar;host&lowbar;and&lowbar;port],            xref:#boost-urls-url_view_base-has_port[has&lowbar;port],            xref:#boost-urls-url_view_base-port[port]&period;





Return the query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1876[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
query(StringToken&& token = &lcub;&rcub;);
----

== Description


If this contains a query, it is returned        as a string (which may be empty)&period;        Otherwise, an empty string is returned&period;        Any percent&hyphen;escapes in the string are        decoded first&period;                When plus signs appear in the query        portion of the url, they are converted        to spaces automatically upon decoding&period;        This behavior can be changed by setting        decode options&period;


=== Example

[,cpp]
----
assert( url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).query() == "id=42&name=jane-doe&page size=20" );
----

=== Complexity

Linear in `this&hyphen;&gt;query()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-param     = key [ "=" value ]
query-params    = [ query-param ] *( "&" query-param )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query (rfc3986)]
        
* link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)]



== See Also


xref:#boost-urls-url_view_base-encoded_params[encoded&lowbar;params],            xref:#boost-urls-url_view_base-encoded_query[encoded&lowbar;query],            xref:#boost-urls-url_view_base-has_query[has&lowbar;query],            xref:#boost-urls-url_view_base-params-05[params]&period;





Return the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L387[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
scheme() const noexcept;
----

== Description


This function returns the scheme if it        exists, without a trailing colon (&apos;&colon;&apos;)&period;        Otherwise it returns an empty string&period;        Note that schemes are case&hyphen;insensitive,        and the canonical form is lowercased&period;


=== Example

[,cpp]
----
assert( url_view( "http://www.example.com" ).scheme() == "http" );
----

=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
scheme          = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

URI             = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

absolute-URI    = scheme ":" hier-part [ "?" query ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3&period;1&period; Scheme (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_scheme[has&lowbar;scheme],            xref:#boost-urls-url_view_base-scheme_id[scheme&lowbar;id]&period;





Return the scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L435[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls,urls>>::<<boost-urls-scheme,scheme>>
scheme&lowbar;id() const noexcept;
----

== Description


This function returns a value which        depends on the scheme in the url&colon;

* If the scheme is a well&hyphen;known        scheme, corresponding value from
        the enumeration 
urls&colon;&colon;scheme
        is returned&period;
* If a scheme is present but is not        a well&hyphen;known scheme, the value
        returned is 
urls&colon;&colon;scheme&colon;&colon;unknown
&period;
* Otherwise, if the scheme is absent        the value returned is
        
urls&colon;&colon;scheme&colon;&colon;none
&period;


=== Example

[,cpp]
----
assert( url_view( "wss://www.example.com/crypto.cgi" ).scheme_id() == scheme::wss );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
URI             = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

absolute-URI    = scheme ":" hier-part [ "?" query ]

scheme          = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3&period;1&period; Scheme (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_scheme[has&lowbar;scheme],            xref:#boost-urls-url_view_base-scheme[scheme]&period;





Return the path as a container of segments

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1737[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-segments_view,segments&lowbar;view>>
segments() const noexcept;
----

== Description


This function returns a bidirectional        view of strings over the path&period;        The returned view references the same        underlying character buffer&semi; ownership        is not transferred&period;        Any percent&hyphen;escapes in strings returned        when iterating the view are decoded first&period;


=== Example

[,cpp]
----
segments_view sv = url_view( "/path/to/file.txt" ).segments();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
path          = [ "/" ] segment *( "/" segment )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-is_path_absolute[is&lowbar;path&lowbar;absolute],            xref:#boost-urls-url_view_base-encoded_path[encoded&lowbar;path],            xref:#boost-urls-url_view_base-encoded_segments[encoded&lowbar;segments]&period;            xref:#boost-urls-url_view_base-path[path],            xref:#boost-urls-segments_view[segments&lowbar;view]&period;





Return the number of characters in the url

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L180[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
size() const noexcept;
----

== Description


This function returns the number of        characters in the url&apos;s encoded string,        not including any null terminator,        if present&period;


=== Example

[,cpp]
----
assert( url_view( "file:///Program%20Files" ).size() == 23 );
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;




== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L92[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>>() noexcept;
----

[.small]#<<boost-urls-url_view_base,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>>(&sol;&ast; implementation-defined &ast;&sol;::url&lowbar;impl const&) noexcept;
----

[.small]#<<boost-urls-url_view_base,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>>(<<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& o) noexcept;
----

[.small]#<<boost-urls-url_view_base,_» more..._>>#


Return the user

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L795[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
user(StringToken&& token = &lcub;&rcub;);
----

== Description


If present, this function returns a        string representing the user (which        may be empty)&period;        Otherwise it returns an empty string&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).user() == "jane-doe" );
----

=== Complexity

Linear in `this&hyphen;&gt;user()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

user        = *( unreserved / pct-encoded / sub-delims )
password    = *( unreserved / pct-encoded / sub-delims / ":" )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== See Also


xref:#boost-urls-url_view_base-has_password[has&lowbar;password],            xref:#boost-urls-url_view_base-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-url_view_base-encoded_password[encoded&lowbar;password],            xref:#boost-urls-url_view_base-encoded_user[encoded&lowbar;user],            xref:#boost-urls-url_view_base-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-url_view_base-password[password],            xref:#boost-urls-url_view_base-userinfo[userinfo]&period;





Return the userinfo

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L700[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
userinfo(StringToken&& token = &lcub;&rcub;);
----

== Description


If present, this function returns a        string representing the userinfo (which        may be empty)&period;        Otherwise it returns an empty string&period;        Any percent&hyphen;escapes in the string are        decoded first&period;

[NOTE]
This function uses the string token        return type customization&period; Depending on        the token passed, the return type and        behavior of the function can be different&period;        See xref:#boost-urls-string_token-return_string[string&lowbar;token&colon;&colon;return&lowbar;string]        for more information&period;


=== Example

[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).userinfo() == "jane-doe:pass" );
----

=== Complexity

Linear in `this&hyphen;&gt;userinfo()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
userinfo    = user [ ":" [ password ] ]

authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3&period;2&period;1&period; User Information (rfc3986)]



== Return Value


When called with no arguments,        a value of type `std&colon;&colon;string` is        returned&period; Otherwise, the return type        and meaning depends on the string token        passed to the function&period;



== See Also


xref:#boost-urls-url_view_base-has_password[has&lowbar;password],            xref:#boost-urls-url_view_base-has_userinfo[has&lowbar;userinfo],            xref:#boost-urls-url_view_base-encoded_password[encoded&lowbar;password],            xref:#boost-urls-url_view_base-encoded_user[encoded&lowbar;user],            xref:#boost-urls-url_view_base-encoded_userinfo[encoded&lowbar;userinfo],            xref:#boost-urls-url_view_base-password[password],            xref:#boost-urls-url_view_base-user[user]&period;





Return the IPv6 Zone ID

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1394[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>&gt;
StringToken::result&lowbar;type
zone&lowbar;id(StringToken&& token = &lcub;&rcub;);
----

== Description


If the host type is xref:#boost-urls-host_type[host&lowbar;type&colon;&colon;ipv6],        this function returns the Zone ID as        a string&period; Otherwise an empty string is returned&period;        Any percent&hyphen;escapes in the string are        decoded first&period;


=== Example

[,cpp]
----
assert( url_view( "http://[fe80::1%25eth0]/" ).zone_id() == "eth0" );
----

=== Complexity

Linear in `this&hyphen;&gt;encoded&lowbar;zone&lowbar;id()&period;size()`&period;


=== Exception Safety

Calls to allocate may throw&period;


=== BNF

[,cpp]
----
host        = IP-literal / IPv4address / reg-name

IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture  ) "]"

ZoneID = 1*( unreserved / pct-encoded )

IPv6addrz = IPv6address "%25" ZoneID
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc6874[Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers]




Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2391[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator!&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.b.com/index.htm" );
assert( u0 != u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() != b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 !&equals; u1`




Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2433[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&lt;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.b.com/index.htm" );
assert( u0 < u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() < b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &lt; u1`




Format the url to the output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2600[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

== Description


This function serializes the url to        the specified output stream&period; Any        percent&hyphen;escapes are emitted as&hyphen;is&semi;        no decoding is performed&period;


=== Example

[,cpp]
----
url_view u( "http://www.example.com/index.htm" );
std::stringstream ss;
ss << u;
assert( ss.str() == "http://www.example.com/index.htm" );
----

=== Effects

[,cpp]
----
return os << u.buffer();
----

=== Complexity

Linear in `u&period;buffer()&period;size()`


=== Exception Safety

Basic guarantee&period;



== Return Value


A reference to the output stream, for chaining



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to&period;


| *u*
| The url to write&period;


|===


Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2475[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&lt;&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.b.com/index.htm" );
url_view u1( "http://www.b.com/index.htm" );
assert( u0 <= u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() <= b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &lt;&equals; u1`




Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2349[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&equals;&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.a.com/index.htm" );
assert( u0 == u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() == b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &equals;&equals; u1`




Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2517[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&gt;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.b.com/index.htm" );
url_view u1( "http://www.a.com/index.htm" );
assert( u0 > u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() > b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &gt; u1`




Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2559[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
bool
operator&gt;&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.a.com/index.htm" );
assert( u0 >= u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() >= b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &gt;&equals; u1`




Designate a named argument for a replacement field

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L447[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
<<boost-urls-named_arg,named&lowbar;arg>>&lt;T&gt;
arg(
    core::string&lowbar;view name,
    T const& arg);
----

== Description


Construct a named argument for a format URL    string that contains named replacement fields&period;

The function parameters should be convertible    to an implementation defined type able to    store the name and a reference to any type    potentially used as a format argument&period;


=== Example

The function should be used to designate a named    argument for a replacement field in a format    URL string&period;

[,cpp]
----
assert(format("user/{id}", arg("id", 1)).buffer() == "user/1");
----


== Return Value


A temporary object with reference    semantics for a named argument



== Parameters


|===
| Name | Description

| *name*
| The format argument name


| *arg*
| The format argument value


|===

== See Also


xref:#boost-urls-format-02[format],        xref:#boost-urls-format_to-0b[format&lowbar;to]&period;





Return the default port for a known scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/scheme.hpp#L174[boost&sol;url&sol;scheme&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::uint16&lowbar;t
default&lowbar;port(<<boost-urls-scheme,scheme>> s) noexcept;
----

== Description


This function returns the default port    for the known schemes&period; If the value does    not represent a known scheme or the scheme    does not represent a protocol, the function    returns zero&period;

The following ports are returned by the    function&colon;

* scheme&colon;&colon;ftp
 &equals; 21    
* scheme&colon;&colon;http
, 
scheme&colon;&colon;ws
 &equals; 80    
* scheme&colon;&colon;https
, 
scheme&colon;&colon;wss
 &equals; 443



== Return Value


An integer with the default port number



== Parameters


|===
| Name | Description

| *s*
| The known scheme constant


|===


Apply percent&hyphen;encoding to a string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encode.hpp#L119[boost&sol;url&sol;encode&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar,grammar>>::<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
std::size&lowbar;t
<<boost-urls-encode-09,encode>>(
    char* dest,
    std::size&lowbar;t size,
    core::string&lowbar;view s,
    CS const& unreserved,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;);
----

[.small]#<<boost-urls-encode-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>,
    <<boost-urls-grammar,grammar>>::<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
StringToken::result&lowbar;type
<<boost-urls-encode-04,encode>>(
    core::string&lowbar;view s,
    CS const& unreserved,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;,
    StringToken&& token = &lcub;&rcub;) noexcept;
----

[.small]#<<boost-urls-encode-04,_» more..._>>#

== Description


This function applies percent&hyphen;encoding    to the string using the given options and    character set&period; The destination buffer    provided by the caller is used to store    the result, which may be truncated if    there is insufficient space&period;


=== Example

[,cpp]
----
char buf[100];
assert( encode( buf, sizeof(buf), "Program Files", pchars ) == 15 );
----

=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2&period;1&period; Percent&hyphen;Encoding (rfc3986)]



== Return Value


The number of characters written    to the destination buffer&period;



== Parameters


|===
| Name | Description

| *dest*
| The destination buffer    to write to&period;


| *size*
| The number of writable    characters pointed to by `dest`&period;    If this is less than `encoded&lowbar;size(s)`,    the result is truncated&period;


| *s*
| The string to encode&period;


| *unreserved*
| The set of characters    that is not percent&hyphen;encoded&period;


| *opt*
| The options for encoding&period; If    this parameter is omitted, the default    options are used&period;


| *token*
| A string token&period;


|===

== See Also


xref:#boost-urls-encode-04[encode],        xref:#boost-urls-encoded_size[encoded&lowbar;size],        xref:#boost-urls-make_pct_string_view[make&lowbar;pct&lowbar;string&lowbar;view]&period;





Apply percent&hyphen;encoding to a string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encode.hpp#L119[boost&sol;url&sol;encode&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar,grammar>>::<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
std::size&lowbar;t
encode(
    char* dest,
    std::size&lowbar;t size,
    core::string&lowbar;view s,
    CS const& unreserved,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;);
----

== Description


This function applies percent&hyphen;encoding    to the string using the given options and    character set&period; The destination buffer    provided by the caller is used to store    the result, which may be truncated if    there is insufficient space&period;


=== Example

[,cpp]
----
char buf[100];
assert( encode( buf, sizeof(buf), "Program Files", pchars ) == 15 );
----

=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2&period;1&period; Percent&hyphen;Encoding (rfc3986)]



== Return Value


The number of characters written    to the destination buffer&period;



== Parameters


|===
| Name | Description

| *dest*
| The destination buffer    to write to&period;


| *size*
| The number of writable    characters pointed to by `dest`&period;    If this is less than `encoded&lowbar;size(s)`,    the result is truncated&period;


| *s*
| The string to encode&period;


| *unreserved*
| The set of characters    that is not percent&hyphen;encoded&period;


| *opt*
| The options for encoding&period; If    this parameter is omitted, the default    options are used&period;


|===

== See Also


xref:#boost-urls-encode-04[encode],        xref:#boost-urls-encoded_size[encoded&lowbar;size],        xref:#boost-urls-make_pct_string_view[make&lowbar;pct&lowbar;string&lowbar;view]&period;





Return a percent&hyphen;encoded string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encode.hpp#L183[boost&sol;url&sol;encode&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-StringToken,StringToken>> StringToken = <<boost-urls-string_token,string&lowbar;token>>::<<boost-urls-string_token-return_string,return&lowbar;string>>,
    <<boost-urls-grammar,grammar>>::<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
StringToken::result&lowbar;type
encode(
    core::string&lowbar;view s,
    CS const& unreserved,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;,
    StringToken&& token = &lcub;&rcub;) noexcept;
----

== Description


This function applies percent&hyphen;encoding    to the string using the given options and    character set, and returns the result as    a string when called with default arguments&period;


=== Example

[,cpp]
----
encoding_opts opt;
opt.space_as_plus = true;
std::string s = encode( "My Stuff", opt, pchars );

assert( s == "My+Stuff" );
----

=== Exception Safety

Calls to allocate may throw&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2&period;1&period; Percent&hyphen;Encoding (rfc3986)]



== Return Value


The string



== Parameters


|===
| Name | Description

| *s*
| The string to encode&period;


| *unreserved*
| The set of characters    that is not percent&hyphen;encoded&period;


| *opt*
| The options for encoding&period; If    this parameter is omitted, the default    options are used&period;


| *token*
| A string token&period;


|===

== See Also


xref:#boost-urls-encode-04[encode],        xref:#boost-urls-encoded_size[encoded&lowbar;size],        xref:#boost-urls-encoding_opts[encoding&lowbar;opts],





Return the buffer size needed for percent&hyphen;encoding

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/encode.hpp#L63[boost&sol;url&sol;encode&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar,grammar>>::<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
std::size&lowbar;t
encoded&lowbar;size(
    core::string&lowbar;view s,
    CS const& unreserved,
    <<boost-urls-encoding_opts,encoding&lowbar;opts>> opt = &lcub;&rcub;) noexcept;
----

== Description


This function returns the exact number    of bytes necessary to store the result    of applying percent&hyphen;encoding to the    string using the given options and    character set&period;    No encoding is actually performed&period;


=== Example

[,cpp]
----
assert( encoded_size( "My Stuff", pchars ) == 10 );
----

=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2&period;1&period; Percent&hyphen;Encoding (rfc3986)]



== Return Value


The number of bytes needed,    excluding any null terminator&period;



== Parameters


|===
| Name | Description

| *s*
| The string to measure&period;


| *unreserved*
| The set of characters    that is not percent&hyphen;encoded&period;


| *opt*
| The options for encoding&period; If    this parameter is omitted, the default    options are be used&period;


|===

== See Also


xref:#boost-urls-encode-04[encode],        xref:#boost-urls-encoding_opts[encoding&lowbar;opts],        xref:#boost-urls-make_pct_string_view[make&lowbar;pct&lowbar;string&lowbar;view]&period;





Format arguments into a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L142[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt;... Args&gt;
<<boost-urls-url,url>>
<<boost-urls-format-05,format>>(
    core::string&lowbar;view fmt,
    Args&&... args);
----

[.small]#<<boost-urls-format-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>
<<boost-urls-format-02,format>>(
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt; args);
----

[.small]#<<boost-urls-format-02,_» more..._>>#

== Description


Format arguments according to the format    URL string into a xref:#boost-urls-url[url]&period;

The rules for a format URL string are the same    as for a `std&colon;&colon;format&lowbar;string`, where replacement    fields are delimited by curly braces&period;

The URL components to which replacement fields    belong are identified before replacement is    applied and any invalid characters for that    formatted argument are percent&hyphen;escaped&period;

Hence, the delimiters between URL components,    such as `&colon;`, `&sol;&sol;`, `?`, and `&num;`, should be    included in the URL format string&period; Likewise,    a format string with a single `&quot;&lcub;&rcub;&quot;` is    interpreted as a path and any replacement    characters invalid in this component will be    encoded to form a valid URL&period;


=== Example

[,cpp]
----
assert(format("{}", "Hello world!").buffer() == "Hello%20world%21");
----

=== Preconditions

All replacement fields must be valid and the    resulting URL should be valid after arguments    are formatted into the URL&period;

Because any invalid characters for a URL    component are encoded by this function, only    replacements in the scheme and port components    might be invalid, as these components do not    allow percent&hyphen;encoding of arbitrary    characters&period;


=== BNF

[,cpp]
----
replacement_field ::=  "{" [arg_id] [":" (format_spec | chrono_format_spec)] "}"
arg_id            ::=  integer | identifier
integer           ::=  digit+
digit             ::=  "0"..."9"
identifier        ::=  id_start id_continue*
id_start          ::=  "a"..."z" | "A"..."Z" | "_"
id_continue       ::=  id_start | digit
----

=== Specification

* link:https://fmt.dev/latest/syntax.html[Format String Syntax]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `fmt` contains an invalid format string and    the result contains an invalid URL after    replacements are applied&period;


|===

== Return Value


A URL holding the formatted result&period;



== Parameters


|===
| Name | Description

| *fmt*
| The format URL string&period;


| *args*
| Arguments to be formatted&period;


|===

== See Also


xref:#boost-urls-format_to-0b[format&lowbar;to],        xref:#boost-urls-arg[arg]&period;





Format arguments into a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L142[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt;... Args&gt;
<<boost-urls-url,url>>
format(
    core::string&lowbar;view fmt,
    Args&&... args);
----

== Description


Format arguments according to the format    URL string into a xref:#boost-urls-url[url]&period;

The rules for a format URL string are the same    as for a `std&colon;&colon;format&lowbar;string`, where replacement    fields are delimited by curly braces&period;

The URL components to which replacement fields    belong are identified before replacement is    applied and any invalid characters for that    formatted argument are percent&hyphen;escaped&period;

Hence, the delimiters between URL components,    such as `&colon;`, `&sol;&sol;`, `?`, and `&num;`, should be    included in the URL format string&period; Likewise,    a format string with a single `&quot;&lcub;&rcub;&quot;` is    interpreted as a path and any replacement    characters invalid in this component will be    encoded to form a valid URL&period;


=== Example

[,cpp]
----
assert(format("{}", "Hello world!").buffer() == "Hello%20world%21");
----

=== Preconditions

All replacement fields must be valid and the    resulting URL should be valid after arguments    are formatted into the URL&period;

Because any invalid characters for a URL    component are encoded by this function, only    replacements in the scheme and port components    might be invalid, as these components do not    allow percent&hyphen;encoding of arbitrary    characters&period;


=== BNF

[,cpp]
----
replacement_field ::=  "{" [arg_id] [":" (format_spec | chrono_format_spec)] "}"
arg_id            ::=  integer | identifier
integer           ::=  digit+
digit             ::=  "0"..."9"
identifier        ::=  id_start id_continue*
id_start          ::=  "a"..."z" | "A"..."Z" | "_"
id_continue       ::=  id_start | digit
----

=== Specification

* link:https://fmt.dev/latest/syntax.html[Format String Syntax]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `fmt` contains an invalid format string and    the result contains an invalid URL after    replacements are applied&period;


|===

== Return Value


A URL holding the formatted result&period;



== Parameters


|===
| Name | Description

| *fmt*
| The format URL string&period;


| *args*
| Arguments to be formatted&period;


|===

== See Also


xref:#boost-urls-format_to-0b[format&lowbar;to],        xref:#boost-urls-arg[arg]&period;





Format arguments into a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L314[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-url,url>>
format(
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt; args);
----

== Description


Format arguments according to the format    URL string into a xref:#boost-urls-url[url]&period;

This overload allows type&hyphen;erased arguments    to be passed as an initializer&lowbar;list, which    is mostly convenient for named parameters&period;

All arguments must be convertible to a    implementation defined type able to store a    type&hyphen;erased reference to any valid format    argument&period;

The rules for a format URL string are the same    as for a `std&colon;&colon;format&lowbar;string`, where replacement    fields are delimited by curly braces&period;

The URL components to which replacement fields    belong are identified before replacement is    applied and any invalid characters for that    formatted argument are percent&hyphen;escaped&period;

Hence, the delimiters between URL components,    such as `&colon;`, `&sol;&sol;`, `?`, and `&num;`, should be    included in the URL format string&period; Likewise,    a format string with a single `&quot;&lcub;&rcub;&quot;` is    interpreted as a path and any replacement    characters invalid in this component will be    encoded to form a valid URL&period;


=== Example

[,cpp]
----
assert(format("user/{id}", {{"id", 1}}).buffer() == "user/1");
----

=== Preconditions

All replacement fields must be valid and the    resulting URL should be valid after arguments    are formatted into the URL&period;

Because any invalid characters for a URL    component are encoded by this function, only    replacements in the scheme and port components    might be invalid, as these components do not    allow percent&hyphen;encoding of arbitrary    characters&period;


=== BNF

[,cpp]
----
replacement_field ::=  "{" [arg_id] [":" (format_spec | chrono_format_spec)] "}"
arg_id            ::=  integer | identifier
integer           ::=  digit+
digit             ::=  "0"..."9"
identifier        ::=  id_start id_continue*
id_start          ::=  "a"..."z" | "A"..."Z" | "_"
id_continue       ::=  id_start | digit
----

=== Specification

* link:https://fmt.dev/latest/syntax.html[Format String Syntax]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `fmt` contains an invalid format string and    the result contains an invalid URL after    replacements are applied&period;


|===

== Return Value


A URL holding the formatted result&period;



== Parameters


|===
| Name | Description

| *fmt*
| The format URL string&period;


| *args*
| Arguments to be formatted&period;


|===

== See Also


xref:#boost-urls-format_to-0b[format&lowbar;to]&period;





Format arguments into a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L225[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt;... Args&gt;
void
<<boost-urls-format_to-02,format&lowbar;to>>(
    <<boost-urls-url_base,url&lowbar;base>>& u,
    core::string&lowbar;view fmt,
    Args&&... args);
----

[.small]#<<boost-urls-format_to-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
<<boost-urls-format_to-0b,format&lowbar;to>>(
    <<boost-urls-url_base,url&lowbar;base>>& u,
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt; args);
----

[.small]#<<boost-urls-format_to-0b,_» more..._>>#

== Description


Format arguments according to the format    URL string into a xref:#boost-urls-url_base[url&lowbar;base]&period;

The rules for a format URL string are the same    as for a `std&colon;&colon;format&lowbar;string`, where replacement    fields are delimited by curly braces&period;

The URL components to which replacement fields    belong are identified before replacement is    applied and any invalid characters for that    formatted argument are percent&hyphen;escaped&period;

Hence, the delimiters between URL components,    such as `&colon;`, `&sol;&sol;`, `?`, and `&num;`, should be    included in the URL format string&period; Likewise,    a format string with a single `&quot;&lcub;&rcub;&quot;` is    interpreted as a path and any replacement    characters invalid in this component will be    encoded to form a valid URL&period;


=== Example

[,cpp]
----
static_url<30> u;
format(u, "{}", "Hello world!");
assert(u.buffer() == "Hello%20world%21");
----

=== Preconditions

All replacement fields must be valid and the    resulting URL should be valid after arguments    are formatted into the URL&period;

Because any invalid characters for a URL    component are encoded by this function, only    replacements in the scheme and port components    might be invalid, as these components do not    allow percent&hyphen;encoding of arbitrary    characters&period;


=== Exception Safety

Strong guarantee&period;


=== BNF

[,cpp]
----
replacement_field ::=  "{" [arg_id] [":" (format_spec | chrono_format_spec)] "}"
arg_id            ::=  integer | identifier
integer           ::=  digit+
digit             ::=  "0"..."9"
identifier        ::=  id_start id_continue*
id_start          ::=  "a"..."z" | "A"..."Z" | "_"
id_continue       ::=  id_start | digit
----

=== Specification

* link:https://fmt.dev/latest/syntax.html[Format String Syntax]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `fmt` contains an invalid format string and    `u` contains an invalid URL after replacements    are applied&period;


|===

== Parameters


|===
| Name | Description

| *u*
| An object that derives from xref:#boost-urls-url_base[url&lowbar;base]&period;


| *fmt*
| The format URL string&period;


| *args*
| Arguments to be formatted&period;


|===

== See Also


xref:#boost-urls-format-02[format]&period;





Format arguments into a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L225[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt;... Args&gt;
void
format&lowbar;to(
    <<boost-urls-url_base,url&lowbar;base>>& u,
    core::string&lowbar;view fmt,
    Args&&... args);
----

== Description


Format arguments according to the format    URL string into a xref:#boost-urls-url_base[url&lowbar;base]&period;

The rules for a format URL string are the same    as for a `std&colon;&colon;format&lowbar;string`, where replacement    fields are delimited by curly braces&period;

The URL components to which replacement fields    belong are identified before replacement is    applied and any invalid characters for that    formatted argument are percent&hyphen;escaped&period;

Hence, the delimiters between URL components,    such as `&colon;`, `&sol;&sol;`, `?`, and `&num;`, should be    included in the URL format string&period; Likewise,    a format string with a single `&quot;&lcub;&rcub;&quot;` is    interpreted as a path and any replacement    characters invalid in this component will be    encoded to form a valid URL&period;


=== Example

[,cpp]
----
static_url<30> u;
format(u, "{}", "Hello world!");
assert(u.buffer() == "Hello%20world%21");
----

=== Preconditions

All replacement fields must be valid and the    resulting URL should be valid after arguments    are formatted into the URL&period;

Because any invalid characters for a URL    component are encoded by this function, only    replacements in the scheme and port components    might be invalid, as these components do not    allow percent&hyphen;encoding of arbitrary    characters&period;


=== Exception Safety

Strong guarantee&period;


=== BNF

[,cpp]
----
replacement_field ::=  "{" [arg_id] [":" (format_spec | chrono_format_spec)] "}"
arg_id            ::=  integer | identifier
integer           ::=  digit+
digit             ::=  "0"..."9"
identifier        ::=  id_start id_continue*
id_start          ::=  "a"..."z" | "A"..."Z" | "_"
id_continue       ::=  id_start | digit
----

=== Specification

* link:https://fmt.dev/latest/syntax.html[Format String Syntax]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `fmt` contains an invalid format string and    `u` contains an invalid URL after replacements    are applied&period;


|===

== Parameters


|===
| Name | Description

| *u*
| An object that derives from xref:#boost-urls-url_base[url&lowbar;base]&period;


| *fmt*
| The format URL string&period;


| *args*
| Arguments to be formatted&period;


|===

== See Also


xref:#boost-urls-format-02[format]&period;





Format arguments into a URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L406[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
format&lowbar;to(
    <<boost-urls-url_base,url&lowbar;base>>& u,
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;<<boost-urls-format_arg,format&lowbar;arg>>&gt; args);
----

== Description


Format arguments according to the format    URL string into a xref:#boost-urls-url_base[url&lowbar;base]&period;

This overload allows type&hyphen;erased arguments    to be passed as an initializer&lowbar;list, which    is mostly convenient for named parameters&period;

All arguments must be convertible to a    implementation defined type able to store a    type&hyphen;erased reference to any valid format    argument&period;

The rules for a format URL string are the same    as for a `std&colon;&colon;format&lowbar;string`, where replacement    fields are delimited by curly braces&period;

The URL components to which replacement fields    belong are identified before replacement is    applied and any invalid characters for that    formatted argument are percent&hyphen;escaped&period;

Hence, the delimiters between URL components,    such as `&colon;`, `&sol;&sol;`, `?`, and `&num;`, should be    included in the URL format string&period; Likewise,    a format string with a single `&quot;&lcub;&rcub;&quot;` is    interpreted as a path and any replacement    characters invalid in this component will be    encoded to form a valid URL&period;


=== Example

[,cpp]
----
static_url<30> u;
format_to(u, "user/{id}", {{"id", 1}})
assert(u.buffer() == "user/1");
----

=== Preconditions

All replacement fields must be valid and the    resulting URL should be valid after arguments    are formatted into the URL&period;

Because any invalid characters for a URL    component are encoded by this function, only    replacements in the scheme and port components    might be invalid, as these components do not    allow percent&hyphen;encoding of arbitrary    characters&period;


=== Exception Safety

Strong guarantee&period;


=== BNF

[,cpp]
----
replacement_field ::=  "{" [arg_id] [":" (format_spec | chrono_format_spec)] "}"
arg_id            ::=  integer | identifier
integer           ::=  digit+
digit             ::=  "0"..."9"
identifier        ::=  id_start id_continue*
id_start          ::=  "a"..."z" | "A"..."Z" | "_"
id_continue       ::=  id_start | digit
----

=== Specification

* link:https://fmt.dev/latest/syntax.html[Format String Syntax]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `fmt` contains an invalid format string and    `u` contains an invalid URL after replacements    are applied&period;


|===

== Parameters


|===
| Name | Description

| *u*
| An object that derives from xref:#boost-urls-url_base[url&lowbar;base]&period;


| *fmt*
| The format URL string&period;


| *args*
| Arguments to be formatted&period;


|===

== See Also


xref:#boost-urls-format-02[format]&period;





Return a valid percent&hyphen;encoded string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L415[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-pct_string_view,pct&lowbar;string&lowbar;view>>&gt;
make&lowbar;pct&lowbar;string&lowbar;view(core::string&lowbar;view s) noexcept;
----

== Description


If `s` is a valid percent&hyphen;encoded string,    the function returns the buffer as a valid    view which may be used to perform decoding    or measurements&period;    Otherwise the result contains an error code&period;    Upon success, the returned view references    the original character buffer&semi;    Ownership is not transferred&period;


=== Complexity

Linear in `s&period;size()`&period;


=== Exception Safety

Throws nothing&period;



== Parameters


|===
| Name | Description

| *s*
| The string to validate&period;


|===


Return true if two addresses are not equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L252[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_not_eq-02,operator!&equals;>>(
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a1,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a2) noexcept;
----

[.small]#<<boost-urls-operator_not_eq-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_not_eq-07,operator!&equals;>>(
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a1,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a2) noexcept;
----

[.small]#<<boost-urls-operator_not_eq-07,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_not_eq-03,operator!&equals;>>(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

[.small]#<<boost-urls-operator_not_eq-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-operator_not_eq-08,operator!&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_not_eq-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_not_eq-06,operator!&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_not_eq-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_not_eq-0b,operator!&equals;>>(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_not_eq-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_not_eq-04,operator!&equals;>>(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

[.small]#<<boost-urls-operator_not_eq-04,_» more..._>>#


Compare two decode views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L641[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator!&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L653[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator!&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return true if two addresses are not equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L252[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a1,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a2) noexcept;
----


Return true if two addresses are not equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L304[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a1,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a2) noexcept;
----


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1266[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for inequality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L630[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator!&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2391[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.b.com/index.htm" );
assert( u0 != u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() != b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 !&equals; u1`




Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1286[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_lt-0a,operator&lt;>>(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

[.small]#<<boost-urls-operator_lt-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-operator_lt-05,operator&lt;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_lt-05,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_lt-047,operator&lt;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_lt-047,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_lt-03,operator&lt;>>(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_lt-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_lt-04a,operator&lt;>>(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

[.small]#<<boost-urls-operator_lt-04a,_» more..._>>#

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L688[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&lt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L700[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&lt;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1286[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for less than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L677[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&lt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2433[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.b.com/index.htm" );
assert( u0 < u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() < b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &lt; u1`




Format the address to an output stream&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L333[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-0a,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr);
----

[.small]#<<boost-urls-operator_lshift-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-0f6,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& addr);
----

[.small]#<<boost-urls-operator_lshift-0f6,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-0d,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a);
----

[.small]#<<boost-urls-operator_lshift-0d,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-034,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-decode_view,decode&lowbar;view>> const& s);
----

[.small]#<<boost-urls-operator_lshift-034,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-09,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-params_encoded_base,params&lowbar;encoded&lowbar;base>> const& qp);
----

[.small]#<<boost-urls-operator_lshift-09,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-0b,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-params_base,params&lowbar;base>> const& qp);
----

[.small]#<<boost-urls-operator_lshift-0b,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-0c,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

[.small]#<<boost-urls-operator_lshift-0c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-038,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>> const& ps);
----

[.small]#<<boost-urls-operator_lshift-038,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
<<boost-urls-operator_lshift-0f4,operator&lt;&lt;>>(
    std::ostream& os,
    <<boost-urls-segments_base,segments&lowbar;base>> const& ps);
----

[.small]#<<boost-urls-operator_lshift-0f4,_» more..._>>#

== Description


IPv4 addresses written to output streams        are written in their dotted decimal format&period;

Format the address to an output stream&period;

IPv4 addresses written to output streams    are written in their dotted decimal format&period;



== Parameters


|===
| Name | Description

| *os*
| The output stream&period;


| *addr*
| The address to format&period;


| *a*
| The URL to write


| *s*
| The decoded view to write


| *u*
| The url to write&period;


|===


Format the address to an output stream&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L333[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& addr);
----

== Description


IPv4 addresses written to output streams        are written in their dotted decimal format&period;

Format the address to an output stream&period;

IPv4 addresses written to output streams    are written in their dotted decimal format&period;



== Parameters


|===
| Name | Description

| *os*
| The output stream&period;


| *addr*
| The address to format&period;


| *os*
| The output stream&period;


| *addr*
| The address to format&period;


|===


Format the address to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L379[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& addr);
----

== Description


This hidden friend function writes the        address to an output stream using        standard notation&period;

Format the address to an output stream

This function writes the address to an    output stream using standard notation&period;



== Return Value


The output stream, for chaining&period;



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to&period;


| *addr*
| The address to write&period;


| *os*
| The output stream to write to&period;


| *addr*
| The address to write&period;


|===


Format the encoded authority to the output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1403[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a);
----

== Description


This hidden friend function serializes the encoded URL        to the output stream&period;


=== Example

[,cpp]
----
authority_view a( "www.example.com" );

std::cout << a << std::endl;
----
Format the encoded authority to the output stream

This function serializes the encoded URL    to the output stream&period;


=== Example

[,cpp]
----
authority_view a( "www.example.com" );

std::cout << a << std::endl;
----


== Return Value


A reference to the output stream, for chaining



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to


| *a*
| The URL to write


| *os*
| The output stream to write to


| *a*
| The URL to write


|===


Format the string with percent&hyphen;decoding applied to the output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L892[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-decode_view,decode&lowbar;view>> const& s);
----

== Description


This hidden friend function serializes the decoded view        to the output stream&period;

Format the string with percent&hyphen;decoding applied to the output stream

This function serializes the decoded view    to the output stream&period;



== Return Value


A reference to the output stream, for chaining



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to


| *s*
| The decoded view to write


| *os*
| The output stream to write to


| *s*
| The decoded view to write


|===


Format to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L562[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-params_encoded_base,params&lowbar;encoded&lowbar;base>> const& qp);
----

== Description


Any percent&hyphen;escapes are emitted as&hyphen;is&semi;    no decoding is performed&period;


=== Complexity

Linear in `ps&period;buffer()&period;size()`&period;


=== Effects

[,cpp]
----
return os << ps.buffer();
----



Format to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L512[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-params_base,params&lowbar;base>> const& qp);
----

== Description


Any percent&hyphen;escapes are emitted as&hyphen;is&semi;    no decoding is performed&period;


=== Complexity

Linear in `ps&period;buffer()&period;size()`&period;


=== Effects

[,cpp]
----
return os << ps.buffer();
----



Format the url to the output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2656[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u);
----

== Description


This function serializes the url to        the specified output stream&period; Any        percent&hyphen;escapes are emitted as&hyphen;is&semi;        no decoding is performed&period;


=== Example

[,cpp]
----
url_view u( "http://www.example.com/index.htm" );
std::stringstream ss;
ss << u;
assert( ss.str() == "http://www.example.com/index.htm" );
----

=== Effects

[,cpp]
----
return os << u.buffer();
----

=== Complexity

Linear in `u&period;buffer()&period;size()`


=== Exception Safety

Basic guarantee&period;

Format the url to the output stream

This function serializes the url to    the specified output stream&period; Any    percent&hyphen;escapes are emitted as&hyphen;is&semi;    no decoding is performed&period;


=== Example

[,cpp]
----
url_view u( "http://www.example.com/index.htm" );
std::stringstream ss;
ss << u;
assert( ss.str() == "http://www.example.com/index.htm" );
----

=== Effects

[,cpp]
----
return os << u.buffer();
----

=== Complexity

Linear in `u&period;buffer()&period;size()`


=== Exception Safety

Basic guarantee&period;



== Return Value


A reference to the output stream, for chaining



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to&period;


| *u*
| The url to write&period;


| *os*
| The output stream to write to&period;


| *u*
| The url to write&period;


|===


Format to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L349[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-segments_encoded_base,segments&lowbar;encoded&lowbar;base>> const& ps);
----

== Description


Any percent&hyphen;escapes are emitted as&hyphen;is&semi;    no decoding is performed&period;


=== Complexity

Linear in `ps&period;buffer()&period;size()`&period;


=== Effects

[,cpp]
----
return os << ps.buffer();
----



Format to an output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L337[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    <<boost-urls-segments_base,segments&lowbar;base>> const& ps);
----

== Description


Any percent&hyphen;escapes are emitted as&hyphen;is&semi;    no decoding is performed&period;


=== Complexity

Linear in `ps&period;buffer()&period;size()`&period;


=== Effects

[,cpp]
----
return os << ps.buffer();
----



Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1306[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_le-01,operator&lt;&equals;>>(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

[.small]#<<boost-urls-operator_le-01,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-operator_le-00,operator&lt;&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_le-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_le-0e,operator&lt;&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_le-0e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_le-06,operator&lt;&equals;>>(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_le-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_le-0a,operator&lt;&equals;>>(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

[.small]#<<boost-urls-operator_le-0a,_» more..._>>#

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L735[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&lt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L747[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&lt;&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1306[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for less than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L724[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&lt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2475[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.b.com/index.htm" );
url_view u1( "http://www.b.com/index.htm" );
assert( u0 <= u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() <= b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &lt;&equals; u1`




Return true if two addresses are equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L241[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_eq-0f2,operator&equals;&equals;>>(
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a1,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a2) noexcept;
----

[.small]#<<boost-urls-operator_eq-0f2,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_eq-0fd,operator&equals;&equals;>>(
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a1,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a2) noexcept;
----

[.small]#<<boost-urls-operator_eq-0fd,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_eq-092,operator&equals;&equals;>>(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

[.small]#<<boost-urls-operator_eq-092,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-operator_eq-091,operator&equals;&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_eq-091,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_eq-090,operator&equals;&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_eq-090,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_eq-02,operator&equals;&equals;>>(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_eq-02,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_eq-01,operator&equals;&equals;>>(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

[.small]#<<boost-urls-operator_eq-01,_» more..._>>#


Compare two decode views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L594[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&equals;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L606[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&equals;&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return true if two addresses are equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L241[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a1,
    <<boost-urls-ipv4_address,ipv4&lowbar;address>> const& a2) noexcept;
----


Return true if two addresses are equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L293[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a1,
    <<boost-urls-ipv6_address,ipv6&lowbar;address>> const& a2) noexcept;
----


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1246[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for equality

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L583[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&equals;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2349[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.a.com/index.htm" );
assert( u0 == u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() == b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &equals;&equals; u1`




Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1326[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_gt-08,operator&gt;>>(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

[.small]#<<boost-urls-operator_gt-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-operator_gt-03,operator&gt;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_gt-03,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_gt-0a,operator&gt;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_gt-0a,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_gt-00,operator&gt;>>(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_gt-00,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_gt-09,operator&gt;>>(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

[.small]#<<boost-urls-operator_gt-09,_» more..._>>#

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L782[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&gt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L794[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&gt;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1326[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for greater than

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L771[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&gt;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2517[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.b.com/index.htm" );
url_view u1( "http://www.a.com/index.htm" );
assert( u0 > u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() > b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &gt; u1`




Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1346[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_ge-08,operator&gt;&equals;>>(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

[.small]#<<boost-urls-operator_ge-08,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
<<boost-urls-operator_ge-06,operator&gt;&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_ge-06,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_ge-09e,operator&gt;&equals;>>(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_ge-09e,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
<<boost-urls-operator_ge-09c,operator&gt;&equals;>>(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----

[.small]#<<boost-urls-operator_ge-09c,_» more..._>>#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
<<boost-urls-operator_ge-00,operator&gt;&equals;>>(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

[.small]#<<boost-urls-operator_ge-00,_» more..._>>#

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L829[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&gt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    S const& rhs) noexcept;
----


Compare two decode views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L841[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
operator&gt;&equals;(
    S const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two authorities        The authorities are compared component        by component as if they were first        normalized&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1346[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;&equals;(
    <<boost-urls-authority_view,authority&lowbar;view>> const& a0,
    <<boost-urls-authority_view,authority&lowbar;view>> const& a1) noexcept;
----

== Description



=== Complexity

Linear in `min( a0&period;size(), a1&period;size() )`


=== Exception Safety

Throws nothing




Compare two decode views for greater than or equal

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L818[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&gt;&equals;(
    <<boost-urls-decode_view,decode&lowbar;view>> const& lhs,
    <<boost-urls-decode_view,decode&lowbar;view>> const& rhs) noexcept;
----


Return the result of comparing two URLs

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2559[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;&equals;(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u0,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& u1) noexcept;
----

== Description


The URLs are compared component by        component as if they were first        normalized&period;


=== Example

[,cpp]
----
url_view u0( "http://www.a.com/index.htm" );
url_view u1( "http://www.a.com/index.htm" );
assert( u0 >= u1 );
----

=== Effects

[,cpp]
----
url a(u0);
a.normalize();
url b(u1);
b.normalize();
return a.buffer() >= b.buffer();
----

=== Complexity

Linear in `min( u0&period;size(), u1&period;size() )`


=== Exception Safety

Throws nothing


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6&period;2&period;2 Syntax&hyphen;Based Normalization (rfc3986)]



== Return Value


`true` if `u0 &gt;&equals; u1`




Return a reference to a parsed URL string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/parse.hpp#L65[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-url_view,url&lowbar;view>>&gt;
parse&lowbar;absolute&lowbar;uri(core::string&lowbar;view s);
----

== Description


This function parses a string according    to the grammar below and returns a view    referencing the passed string upon success,    else returns an error&period;    Ownership of the string is not transferred&semi;    the caller is responsible for ensuring that    the lifetime of the character buffer extends    until the view is no longer being accessed&period;


=== Example

[,cpp]
----
system::result< url_view > rv = parse_absolute_uri( "http://example.com/index.htm?id=1" );
----

=== BNF

[,cpp]
----
absolute-URI    = scheme ":" hier-part [ "?" query ]

hier-part       = "//" authority path-abempty
                / path-absolute
                / path-rootless
                / path-empty
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.3[4&period;3&period; Absolute URI (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`


|===

== Return Value


A result containing a value or an error



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-parse_origin_form[parse&lowbar;origin&lowbar;form],        xref:#boost-urls-parse_relative_ref[parse&lowbar;relative&lowbar;ref],        xref:#boost-urls-parse_uri[parse&lowbar;uri],        xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Parse an authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1449[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-authority_view,authority&lowbar;view>>&gt;
parse&lowbar;authority(core::string&lowbar;view s) noexcept;
----

== Description


This function parses a string according to    the authority grammar below, and returns an    xref:#boost-urls-authority_view[authority&lowbar;view] referencing the string&period;    Ownership of the string is not transferred&semi;    the caller is responsible for ensuring that    the lifetime of the string extends until the    view is no longer being accessed&period;


=== BNF

[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

userinfo      = user [ ":" [ password ] ]

user          = *( unreserved / pct-encoded / sub-delims )
password      = *( unreserved / pct-encoded / sub-delims / ":" )

host          = IP-literal / IPv4address / reg-name

port          = *DIGIT
----

=== Exception Safety

Throws nothing&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== Return Value


A view to the parsed authority



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-authority_view[authority&lowbar;view]&period;





Return an IPv4 address from an IP address string in dotted decimal form

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L343[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-ipv4_address,ipv4&lowbar;address>>&gt;
parse&lowbar;ipv4&lowbar;address(core::string&lowbar;view s) noexcept;
----


Parse a string containing an IPv6 address&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv6_address.hpp#L402[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-ipv6_address,ipv6&lowbar;address>>&gt;
parse&lowbar;ipv6&lowbar;address(core::string&lowbar;view s) noexcept;
----

== Description


This function attempts to parse the string    as an IPv6 address and returns a result    containing the address upon success, or    an error code if the string does not contain    a valid IPv6 address&period;


=== Exception Safety

Throws nothing&period;



== Return Value


A result containing the address&period;



== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===


Return a reference to a parsed URL string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/parse.hpp#L112[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-url_view,url&lowbar;view>>&gt;
parse&lowbar;origin&lowbar;form(core::string&lowbar;view s);
----

== Description


This function parses a string according    to the grammar below and returns a view    referencing the passed string upon success,    else returns an error&period;    Ownership of the string is not transferred&semi;    the caller is responsible for ensuring that    the lifetime of the character buffer extends    until the view is no longer being accessed&period;


=== Example

[,cpp]
----
system::result< url_view > = parse_origin_form( "/index.htm?layout=mobile" );
----

=== BNF

[,cpp]
----
origin-form    = absolute-path [ "?" query ]

absolute-path = 1*( "/" segment )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1[5&period;3&period;1&period;  origin&hyphen;form (rfc7230)]



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`


|===

== Return Value


A result containing a value or an error



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-parse_absolute_uri[parse&lowbar;absolute&lowbar;uri],        xref:#boost-urls-parse_relative_ref[parse&lowbar;relative&lowbar;ref],        xref:#boost-urls-parse_uri[parse&lowbar;uri],        xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Parse a string and return an encoded segment view

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/parse_path.hpp#L48[boost&sol;url&sol;parse&lowbar;path&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-segments_encoded_view,segments&lowbar;encoded&lowbar;view>>&gt;
parse&lowbar;path(core::string&lowbar;view s) noexcept;
----

== Description


This function parses the string and returns the    corresponding path object if the string is valid,    otherwise returns an error&period;


=== BNF

[,cpp]
----
path          = [ "/" ] segment *( "/" segment )
----

=== Exception Safety

No&hyphen;throw guarantee&period;


=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period;  Path (rfc3986)]



== Return Value


A valid view on success, otherwise an    error code&period;



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view]&period;





Parse a string and return an encoded params view

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/parse_query.hpp#L47[boost&sol;url&sol;parse&lowbar;query&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-params_encoded_view,params&lowbar;encoded&lowbar;view>>&gt;
parse&lowbar;query(core::string&lowbar;view s) noexcept;
----

== Description


This function parses the string and returns the    corresponding params object if the string is valid,    otherwise returns an error&period;


=== BNF

[,cpp]
----
query         = *( pchar / "/" / "?" )
----

=== Exception Safety

No&hyphen;throw guarantee&period;


=== Specification



== Return Value


A valid view on success, otherwise an    error code&period;



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-params_encoded_view[params&lowbar;encoded&lowbar;view]&period;





Return a reference to a parsed URL string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/parse.hpp#L165[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-url_view,url&lowbar;view>>&gt;
parse&lowbar;relative&lowbar;ref(core::string&lowbar;view s);
----

== Description


This function parses a string according    to the grammar below and returns a view    referencing the passed string upon success,    else returns an error&period;    Ownership of the string is not transferred&semi;    the caller is responsible for ensuring that    the lifetime of the character buffer extends    until the view is no longer being accessed&period;


=== Example

[,cpp]
----
system::result< url_view > = parse_relative_ref( "images/dot.gif?v=hide#a" );
----

=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

relative-part = "//" authority path-abempty
              / path-absolute
              / path-noscheme
              / path-abempty
              / path-empty
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]
    
* link:https://www.rfc-editor.org/errata/eid5428[Errata ID&colon; 5428 (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`


|===

== Return Value


A result containing a value or an error



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-parse_absolute_uri[parse&lowbar;absolute&lowbar;uri],        xref:#boost-urls-parse_origin_form[parse&lowbar;origin&lowbar;form],        xref:#boost-urls-parse_uri[parse&lowbar;uri],        xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Return a reference to a parsed URL string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/parse.hpp#L215[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-url_view,url&lowbar;view>>&gt;
parse&lowbar;uri(core::string&lowbar;view s);
----

== Description


This function parses a string according    to the grammar below and returns a view    referencing the passed string upon success,    else returns an error&period;    Ownership of the string is not transferred&semi;    the caller is responsible for ensuring that    the lifetime of the character buffer extends    until the view is no longer being accessed&period;


=== Example

[,cpp]
----
system::result< url_view > = parse_uri( "https://www.example.com/index.htm?id=guest#s1" );
----

=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

hier-part     = "//" authority path-abempty
              / path-absolute
              / path-rootless
              / path-empty
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3[3&period; Syntax Components (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`


|===

== Return Value


A result containing a value or an error



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-parse_absolute_uri[parse&lowbar;absolute&lowbar;uri],        xref:#boost-urls-parse_origin_form[parse&lowbar;origin&lowbar;form],        xref:#boost-urls-parse_relative_ref[parse&lowbar;relative&lowbar;ref],        xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Return a reference to a parsed URL string

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/parse.hpp#L277[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;<<boost-urls-url_view,url&lowbar;view>>&gt;
parse&lowbar;uri&lowbar;reference(core::string&lowbar;view s);
----

== Description


This function parses a string according    to the grammar below and returns a view    referencing the passed string upon success,    else returns an error&period;    Ownership of the string is not transferred&semi;    the caller is responsible for ensuring that    the lifetime of the character buffer extends    until the view is no longer being accessed&period;


=== Example

[,cpp]
----
system::result< url_view > = parse_uri_reference( "ws://echo.example.com/?name=boost#demo" );
----

=== BNF

[,cpp]
----
URI-reference = URI / relative-ref

URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

relative-ref  = relative-part [ "?" query ] [ "#" fragment ]

hier-part     = "//" authority path-abempty
              / path-absolute
              / path-rootless
              / path-empty

relative-part = "//" authority path-abempty
              / path-absolute
              / path-noscheme
              / path-abempty
              / path-empty
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4&period;1&period; URI Reference (rfc3986)]
    
* link:https://www.rfc-editor.org/errata/eid5428[Errata ID&colon; 5428 (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`


|===

== Return Value


A result containing a value or an error



== Parameters


|===
| Name | Description

| *s*
| The string to parse


|===

== See Also


xref:#boost-urls-parse_absolute_uri[parse&lowbar;absolute&lowbar;uri],        xref:#boost-urls-parse_origin_form[parse&lowbar;origin&lowbar;form],        xref:#boost-urls-parse_relative_ref[parse&lowbar;relative&lowbar;ref],        xref:#boost-urls-parse_uri[parse&lowbar;uri],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Rule for a string with percent&hyphen;encoded escapes

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/pct_encoded_rule.hpp#L130[boost&sol;url&sol;rfc&sol;pct&lowbar;encoded&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;<<boost-urls-grammar,grammar>>::<<boost-urls-grammar-CharSet,CharSet>> CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-pct_encoded_rule_t,pct&lowbar;encoded&lowbar;rule&lowbar;t>>&lt;CS&gt;
pct&lowbar;encoded&lowbar;rule(CS const& cs) noexcept;
----

== Description


This function returns a rule which matches    a percent&hyphen;encoded string, permitting characters    in the string which are also in the specified    character set to be used unescaped&period;


=== Value Type

[,cpp]
----
using value_type = pct_string_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
//  pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"

system::result< pct_string_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( pchars ) );
----

=== BNF

[,cpp]
----
pct-encoded   = "%" HEXDIG HEXDIG
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[        2&period;1&period; Percent&hyphen;Encoding (rfc3986)]



== Parameters


|===
| Name | Description

| *cs*
| The character set indicating    which characters are allowed without escapes&period;    Any character which is not in this set must be    escaped, or else parsing returns an error&period;


|===

== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-pchars[pchars],        xref:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]&period;





Resolve a URL reference against a base URL

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L2788[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;void&gt;
resolve(
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& base,
    <<boost-urls-url_view_base,url&lowbar;view&lowbar;base>> const& ref,
    <<boost-urls-url_base,url&lowbar;base>>& dest);
----

== Description


This function attempts to resolve a URL    reference `ref` against the base URL `base`    in a manner similar to that of a web browser    resolving an anchor tag&period;

The base URL must satisfy the _URI_    grammar&period; In other words, it must contain    a scheme&period;

Relative references are only usable when    in the context of a base absolute URI&period;    This process of resolving a relative    _reference_ within the context of    a _base_ URI is defined in detail    in rfc3986 (see below)&period;

The resolution process works as if the    relative reference is appended to the base    URI and the result is normalized&period;

Given the input base URL, this function    resolves the relative reference    as if performing the following steps&colon;

* Ensure the base URI has at least a scheme    
* Normalizing the reference path    
* Merge base and reference paths    
* Normalize the merged path

This function places the result of the    resolution into `dest`, which can be    any of the url containers that inherit    from xref:#boost-urls-url_base[url&lowbar;base]&period;

If an error occurs, the contents of    `dest` is unspecified and `ec` is set&period;

[NOTE]
Abnormal hrefs where the number of &quot;&period;&period;&quot;    segments exceeds the number of segments in    the base path are handled by including the    unmatched &quot;&period;&period;&quot; segments in the result, as described    in link:https://www.rfc-editor.org/errata/eid4547[Errata 4547]&period;


=== Example

[,cpp]
----
url dest;
system::error_code ec;

resolve("/one/two/three", "four", dest, ec);
assert( dest.str() == "/one/two/four" );

resolve("http://example.com/", "/one", dest, ec);
assert( dest.str() == "http://example.com/one" );

resolve("http://example.com/one", "/two", dest, ec);
assert( dest.str() == "http://example.com/two" );

resolve("http://a/b/c/d;p?q", "g#s", dest, ec);
assert( dest.str() == "http://a/b/c/g#s" );
----

=== BNF

[,cpp]
----
absolute-URI  = scheme ":" hier-part [ "?" query ]
----

=== Exception Safety

Basic guarantee&period;    Calls to allocate may throw&period;


=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-5[5&period; Reference Resolution (rfc3986)]



== Return Value


An empty result upon success,    otherwise an error code if `!base&period;has&lowbar;scheme()`&period;



== Parameters


|===
| Name | Description

| *base*
| The base URL to resolve against&period;


| *ref*
| The URL reference to resolve&period;


| *dest*
| The container where the result    is written, upon success&period;


|===

== See Also


xref:#boost-urls-url[url],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Return the known scheme for a non&hyphen;normalized string, if known

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/scheme.hpp#L141[boost&sol;url&sol;scheme&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
<<boost-urls-scheme,scheme>>
string&lowbar;to&lowbar;scheme(core::string&lowbar;view s) noexcept;
----

== Description


If the string does not identify a known    scheme, the value xref:#boost-urls-scheme[scheme&colon;&colon;unknown] is    returned&period;


=== BNF

[,cpp]
----
scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3&period;1&period; Scheme (rfc3986)]



== Return Value


The known scheme



== Parameters


|===
| Name | Description

| *s*
| The string holding the scheme


|===


Swap

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L397[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(
    <<boost-urls-url,url>>& v0,
    <<boost-urls-url,url>>& v1) noexcept;
----

== Description


Exchanges the contents of `v0` with another `v1`&period;        All views, iterators and references remain        valid&period;

If `&amp;v0 &equals;&equals; &amp;v1`, this function call has no effect&period;


=== Example

[,cpp]
----
url u1( "https://www.example.com" );
url u2( "https://www.boost.org" );
std::swap(u1, u2);
assert(u1 == "https://www.boost.org" );
assert(u2 == "https://www.example.com" );
----

=== Effects

[,cpp]
----
v0.swap( v1 );
----

=== Complexity

Constant


=== Exception Safety

Throws nothing



== Parameters


|===
| Name | Description

| *v0*
| The first object to swap


| *v1*
| The second object to swap


|===

== See Also


xref:#boost-urls-url-swap[url&colon;&colon;swap] 





Return the normalized string for a known scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/scheme.hpp#L151[boost&sol;url&sol;scheme&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
core::string&lowbar;view
to&lowbar;string(<<boost-urls-scheme,scheme>> s) noexcept;
----

== Return Value


A string representing the known scheme



== Parameters


|===
| Name | Description

| *s*
| The known scheme constant


|===


Error codes returned the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/error.hpp#L22[boost&sol;url&sol;error&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum class error : int;
----

== Members


[,cols=2]
|===
|Name |Description
|`success`
|The operation completed successfully&period;
|`illegal&lowbar;null`
|Null encountered in pct&hyphen;encoded&period;
|`illegal&lowbar;reserved&lowbar;char`
|Illegal reserved character in encoded string&period;
|`non&lowbar;canonical`
|A grammar element was not in canonical form&period;
|`bad&lowbar;pct&lowbar;hexdig`
|Bad hexadecimal digit&period;
|`incomplete&lowbar;encoding`
|The percent&hyphen;encoded sequence is incomplete&period;
|`missing&lowbar;pct&lowbar;hexdig`
|Missing hexadecimal digit&period;
|`no&lowbar;space`
|No space in output buffer
|`not&lowbar;a&lowbar;base`
|The URL is not a base URL
|===


Identifies the type of host in a URL&period;

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/host_type.hpp#L24[boost&sol;url&sol;host&lowbar;type&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum class host&lowbar;type : int;
----

== Members


[,cols=2]
|===
|Name |Description
|`none`
|No host is specified&period;
|`name`
|A host is specified by reg&hyphen;name&period;
|`ipv4`
|A host is specified by xref:#boost-urls-ipv4_address[ipv4&lowbar;address]&period;
|`ipv6`
|A host is specified by xref:#boost-urls-ipv6_address[ipv6&lowbar;address]&period;
|`ipvfuture`
|A host is specified by IPvFuture&period;
|===

== Description


Values of this type are returned by URL views    and containers to indicate the type of host    present in a URL&period;




Identifies a known URL scheme

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/scheme.hpp#L33[boost&sol;url&sol;scheme&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum class scheme : unsigned short;
----

== Members


[,cols=2]
|===
|Name |Description
|`none`
|Indicates that no scheme is present
|`unknown`
|Indicates the scheme is not a well&hyphen;known scheme
|`ftp`
|File Transfer Protocol (FTP)
|`file`
|File URI Scheme
|`http`
|The Hypertext Transfer Protocol URI Scheme
|`https`
|The Secure Hypertext Transfer Protocol URI Scheme
|`ws`
|The WebSocket URI Scheme
|`wss`
|The Secure WebSocket URI Scheme
|===

== Description



=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3&period;1&period; Scheme (rfc3986)]




A temporary reference to a formatting argument

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L72[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using format&lowbar;arg = &sol;&ast; implementation-defined &ast;&sol;::format&lowbar;arg;
----

== Description


This class represents a temporary reference    to a formatting argument used by the    xref:#boost-urls-format-02[format] function&period;

A xref:#boost-urls-format-02[format] argument should always be    created by passing the argument to be    formatted directly to the xref:#boost-urls-format-02[format] function&period;

Any type that can be formatted into a URL    with the xref:#boost-urls-format-02[format] function is convertible    to this type&period;

This includes basic types, types convertible    to `core&colon;&colon;string&lowbar;view`, and xref:#boost-urls-named_arg[named&lowbar;arg]&period;



== See Also


xref:#boost-urls-format-02[format],        xref:#boost-urls-format_to-0b[format&lowbar;to],        xref:#boost-urls-arg[arg]&period;





A temporary reference to a named formatting argument

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/format.hpp#L47[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
using named&lowbar;arg = &sol;&ast; implementation-defined &ast;&sol;::named&lowbar;arg&lt;T&gt;;
----

== Description


This class represents a temporary reference    to a named formatting argument used by the    xref:#boost-urls-format-02[format] function&period;

Named arguments should always be created    with the xref:#boost-urls-arg[arg] function&period;

Any type that can be formatted into a URL    with the xref:#boost-urls-format-02[format] function can also be used    in a named argument&period; All named arguments    are convertible to xref:#boost-urls-format_arg[format&lowbar;arg] and    can be used in the xref:#boost-urls-format-02[format] function&period;



== See Also


xref:#boost-urls-arg[arg],        xref:#boost-urls-format-02[format],        xref:#boost-urls-format_to-0b[format&lowbar;to],        xref:#boost-urls-format_arg[format&lowbar;arg]&period;





The type of optional used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/optional.hpp#L38[boost&sol;url&sol;optional&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
using optional = <<boost,boost>>::optional&lt;T&gt;;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `boost&colon;&colon;optional` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




The type of string&lowbar;view used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/string_view.hpp#L45[boost&sol;url&sol;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using string&lowbar;view = <<boost,boost>>::core::string&lowbar;view;
----

== Description


String views are used to pass character    buffers into or out of functions&period; Ownership    of the underlying character buffer is not    transferred&semi; the caller is responsible for    ensuring that the lifetime of character    buffer extends until it is no longer    referenced&period;

[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `core&colon;&colon;string&lowbar;view` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




The type of variant used by the library

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/variant.hpp#L37[boost&sol;url&sol;variant&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class... Ts&gt;
using variant = <<boost,boost>>::variant2::variant&lt;Ts...&gt;;
----

== Description


[WARNING]
This alias is no longer supported and    should not be used in new code&period; Please use    `boost&colon;&colon;variant2&colon;&colon;variant` instead&period;

This alias is included for backwards    compatibility with earlier versions of the    library&period;

However, it will be removed in future releases,    and using it in new code is not recommended&period;

Please use the updated version instead to    ensure compatibility with future versions of    the library&period;




Rule for absolute&hyphen;URI

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/absolute_uri_rule.hpp#L67[boost&sol;url&sol;rfc&sol;absolute&lowbar;uri&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-absolute_uri_rule_t,absolute&lowbar;uri&lowbar;rule&lowbar;t>> absolute&lowbar;uri&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = url_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< url_view > rv = grammar::parse( "http://example.com/index.htm?id=1", absolute_uri_rule );
----

=== BNF

[,cpp]
----
absolute-URI    = scheme ":" hier-part [ "?" query ]

hier-part       = "//" authority path-abempty
                / path-absolute
                / path-rootless
                / path-empty
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.3[4&period;3&period; Absolute URI (rfc3986)]



== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-parse_absolute_uri[parse&lowbar;absolute&lowbar;uri],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Rule for authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/authority_rule.hpp#L93[boost&sol;url&sol;rfc&sol;authority&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-authority_rule_t,authority&lowbar;rule&lowbar;t>> authority&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = authority_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< authority_view > rv = grammar::parse( "user:pass@example.com:8080", authority_rule );
----

=== BNF

[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== See Also


xref:#boost-urls-authority_view[authority&lowbar;view],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-parse_authority[parse&lowbar;authority]&period;





The gen&hyphen;delims character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/gen_delim_chars.hpp#L44[boost&sol;url&sol;rfc&sol;gen&lowbar;delim&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr <<boost-urls-grammar,grammar>>::<<boost-urls-grammar-lut_chars,lut&lowbar;chars>> gen&lowbar;delim&lowbar;chars = &quot;&colon;&sol;?&num;&lsqb;&rsqb;@&quot;;
----

== Description



=== Example

Character sets are used with rules and    the functions xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if] and    xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< decode_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( gen_delim_chars ) );
----

=== BNF

[,cpp]
----
gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.2[2&period;2&period; Reserved Characters (rfc3986)]



== See Also


xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-pct_encoded_rule[pct&lowbar;encoded&lowbar;rule]&period;





Ignore case when comparing

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ignore_case.hpp#L29[boost&sol;url&sol;ignore&lowbar;case&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-ignore_case_t,ignore&lowbar;case&lowbar;t>> ignore&lowbar;case = &lcub;&rcub;;
----

== Description


This value may be optionally passed to    functions accepting a parameter of type    xref:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] to indicate that    comparisons should be case&hyphen;insensitive&period;




Rule for an IP version 4 style address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/ipv4_address_rule.hpp#L109[boost&sol;url&sol;rfc&sol;ipv4&lowbar;address&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-ipv4_address_rule_t,ipv4&lowbar;address&lowbar;rule&lowbar;t>> ipv4&lowbar;address&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = ipv4_address;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< ipv4_address > rv = grammar::parse( "192.168.0.1", ipv4_address_rule );
----

=== BNF

[,cpp]
----
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet

dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----

=== Specification

* link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)]
    
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== See Also


xref:#boost-urls-ipv4_address[ipv4&lowbar;address],        xref:#boost-urls-parse_ipv4_address[parse&lowbar;ipv4&lowbar;address],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;





Rule for An IP version 6 style address

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/ipv6_address_rule.hpp#L125[boost&sol;url&sol;rfc&sol;ipv6&lowbar;address&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-ipv6_address_rule_t,ipv6&lowbar;address&lowbar;rule&lowbar;t>> ipv6&lowbar;address&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = ipv6_address;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< ipv6_address > rv = grammar::parse( "2001:0db8:85a3:0000:0000:8a2e:0370:7334", ipv6_address_rule );
----

=== BNF

[,cpp]
----
IPv6address =                            6( h16 ":" ) ls32
            /                       "::" 5( h16 ":" ) ls32
            / [               h16 ] "::" 4( h16 ":" ) ls32
            / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
            / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
            / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
            / [ *4( h16 ":" ) h16 ] "::"              ls32
            / [ *5( h16 ":" ) h16 ] "::"              h16
            / [ *6( h16 ":" ) h16 ] "::"

ls32        = ( h16 ":" h16 ) / IPv4address
            ; least-significant 32 bits of address

h16         = 1*4HEXDIG
            ; 16 bits of address represented in hexadecimal
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)]
    
* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period; Host (rfc3986)]



== See Also


xref:#boost-urls-ipv6_address[ipv6&lowbar;address],        xref:#boost-urls-parse_ipv6_address[parse&lowbar;ipv6&lowbar;address],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;





Constant indicating no value in a param

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L36[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr <<boost-urls-no_value_t,no&lowbar;value&lowbar;t>> no&lowbar;value = &lcub;&rcub;;
----


Rule for origin&hyphen;form

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/origin_form_rule.hpp#L65[boost&sol;url&sol;rfc&sol;origin&lowbar;form&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
inline constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-origin_form_rule_t,origin&lowbar;form&lowbar;rule&lowbar;t>> origin&lowbar;form&lowbar;rule = &lcub;&rcub;;
----

== Description


This appears in the HTTP&sol;1 request&hyphen;line grammar&period;


=== Value Type

[,cpp]
----
using value_type = url_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< url_view > rv = grammar::parse( "/index.htm?layout=mobile", origin_form_rule );
----

=== BNF

[,cpp]
----
origin-form    = absolute-path [ "?" query ]

absolute-path = 1*( "/" segment )
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1[5&period;3&period;1&period;  origin&hyphen;form (rfc7230)]



== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-parse_origin_form[parse&lowbar;origin&lowbar;form],        xref:#boost-urls-url_view[url&lowbar;view]&period;





The path character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/pchars.hpp#L45[boost&sol;url&sol;rfc&sol;pchars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr auto pchars = unreserved&lowbar;chars &plus; sub&lowbar;delim&lowbar;chars &plus; &apos;&colon;&apos; &plus; &apos;@&apos;;
----

== Description



=== Example

Character sets are used with rules and    the functions xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if] and    xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< decode_view > rv = grammar::parse( "Program%20Files", pchars );
----

=== BNF

[,cpp]
----
pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3&period;3&period; Path (rfc3986)]



== See Also


xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-pct_encoded_rule[pct&lowbar;encoded&lowbar;rule]&period;





Rule for query

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/query_rule.hpp#L110[boost&sol;url&sol;rfc&sol;query&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-query_rule_t,query&lowbar;rule&lowbar;t>> query&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = params_encoded_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< params_encoded_view > rv = grammar::parse( "format=web&id=42&compact", query_rule );
----

=== BNF

[,cpp]
----
query           = *( pchar / "/" / "?" )

query-params    = [ query-param ] *( "&" query-param )
query-param     = key [ "=" value ]
key             = *qpchar
value           = *( qpchar / "=" )
qpchar          = unreserved
                / pct-encoded
                / "!" / "$" / "'" / "(" / ")"
                / "*" / "+" / "," / ";"
                / ":" / "@" / "/" / "?"
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period; Query (rfc3986)]



== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-params_encoded_view[params&lowbar;encoded&lowbar;view]&period;





Rule for relative&hyphen;ref

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/relative_ref_rule.hpp#L92[boost&sol;url&sol;rfc&sol;relative&lowbar;ref&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-relative_ref_rule_t,relative&lowbar;ref&lowbar;rule&lowbar;t>> relative&lowbar;ref&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = url_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< url_view > rv = grammar::parse( "images/dot.gif?v=hide#a", relative_ref_rule );
----

=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]



== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-parse_relative_ref[parse&lowbar;relative&lowbar;ref],        xref:#boost-urls-url_view[url&lowbar;view]&period;





The reserved character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/reserved_chars.hpp#L39[boost&sol;url&sol;rfc&sol;reserved&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr auto reserved&lowbar;chars = &#126;unreserved&lowbar;chars;
----

== Description



=== Example

Character sets are used with rules and    the functions xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if] and    xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< decode_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( reserved_chars ) );
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.3[2&period;3&period; Unreserved Characters (rfc3986)]



== See Also


xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-pct_encoded_rule[pct&lowbar;encoded&lowbar;rule]&period;





The sub&hyphen;delims character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/sub_delim_chars.hpp#L45[boost&sol;url&sol;rfc&sol;sub&lowbar;delim&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr <<boost-urls-grammar,grammar>>::<<boost-urls-grammar-lut_chars,lut&lowbar;chars>> sub&lowbar;delim&lowbar;chars = &quot;!$&amp;()&ast;&plus;,&semi;&equals;&bsol;x27&quot;;
----

== Description



=== Example

Character sets are used with rules and    the functions xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if] and    xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< decode_view > = grammar::parse( "Program%20Files", pct_encoded_rule( sub_delim_chars ) );
----

=== BNF

[,cpp]
----
sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
              / "*" / "+" / "," / ";" / "="
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.2[2&period;2&period; Reserved Characters (rfc3986)]



== See Also


xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-pct_encoded_rule[pct&lowbar;encoded&lowbar;rule]&period;





The unreserved character set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/unreserved_chars.hpp#L44[boost&sol;url&sol;rfc&sol;unreserved&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr <<boost-urls-grammar,grammar>>::<<boost-urls-grammar-lut_chars,lut&lowbar;chars>> unreserved&lowbar;chars = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;
    &quot;abcdefghijklmnopqrstuvwxyz&quot;
    &quot;0123456789&quot;
    &quot;&hyphen;&period;&lowbar;&#126;&quot;;
----

== Description



=== Example

Character sets are used with rules and    the functions xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if] and    xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not]&period;

[,cpp]
----
system::result< decode_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( unreserved_chars ) );
----

=== BNF

[,cpp]
----
unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.3[2&period;3&period; Unreserved Characters (rfc3986)]



== See Also


xref:#boost-urls-grammar-find_if[grammar&colon;&colon;find&lowbar;if],        xref:#boost-urls-grammar-find_if_not[grammar&colon;&colon;find&lowbar;if&lowbar;not],        xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-pct_encoded_rule[pct&lowbar;encoded&lowbar;rule]&period;





Rule for URI&hyphen;reference

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/uri_reference_rule.hpp#L98[boost&sol;url&sol;rfc&sol;uri&lowbar;reference&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-uri_reference_rule_t,uri&lowbar;reference&lowbar;rule&lowbar;t>> uri&lowbar;reference&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = url_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< url_view > rv = grammar::parse( "ws://echo.example.com/?name=boost#demo", uri_reference_rule );
----

=== BNF

[,cpp]
----
URI-reference = URI / relative-ref

URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3[3&period; Syntax Components (rfc3986)]



== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-parse_uri_reference[parse&lowbar;uri&lowbar;reference],        xref:#boost-urls-url_view[url&lowbar;view]&period;





Rule for URI

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/uri_rule.hpp#L92[boost&sol;url&sol;rfc&sol;uri&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol;::<<boost-urls-implementation_defined-uri_rule_t,uri&lowbar;rule&lowbar;t>> uri&lowbar;rule = &lcub;&rcub;;
----

== Description



=== Value Type

[,cpp]
----
using value_type = url_view;
----

=== Example

Rules are used with the function xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse]&period;

[,cpp]
----
system::result< url_view > rv = grammar::parse( "https://www.example.com/index.htm?id=guest#s1", uri_rule );
----

=== BNF

[,cpp]
----
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3[3&period; Syntax Components (rfc3986)]



== See Also


xref:#boost-urls-grammar-parse-02[grammar&colon;&colon;parse],        xref:#boost-urls-parse_uri[parse&lowbar;uri],        xref:#boost-urls-url_view[url&lowbar;view]&period;






[.small]#Created with https://www.mrdocs.com[MrDocs]#
