= Reference
:mrdocs:

== Namespaces

[cols=1]
|===
| Name
| link:#boost[`boost`] 
|===

== Namespaces

[cols=1]
|===
| Name
| link:#boost-urls[`urls`] 
|===

== Namespaces

[cols=1]
|===
| Name
| link:#boost-urls-error_types[`error&lowbar;types`] 
| link:#boost-urls-grammar[`grammar`] 
| link:#boost-urls-string_token[`string&lowbar;token`] 
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-authority_view[`authority&lowbar;view`] 
| A non&hyphen;owning reference to a valid authority
| link:#boost-urls-decode_view[`decode&lowbar;view`] 
| A reference to a valid, percent&hyphen;encoded string
| link:#boost-urls-encoding_opts[`encoding&lowbar;opts`] 
| Percent&hyphen;encoding options
| link:#boost-urls-ignore_case_param[`ignore&lowbar;case&lowbar;param`] 
| An optional parameter to determine case&hyphen;sensitivity
| link:#boost-urls-ipv4_address[`ipv4&lowbar;address`] 
| An IP version 4 style address&period;
| link:#boost-urls-ipv6_address[`ipv6&lowbar;address`] 
| An IP version 6 style address&period;
| link:#boost-urls-no_value_t[`no&lowbar;value&lowbar;t`] 
| The type of link:#boost-urls-no_value[`no&lowbar;value`]
| link:#boost-urls-param[`param`] 
| A query parameter
| link:#boost-urls-param_pct_view[`param&lowbar;pct&lowbar;view`] 
| A view of a percent&hyphen;encoded query parameter
| link:#boost-urls-param_view[`param&lowbar;view`] 
| A view of a query parameter
| link:#boost-urls-params_base[`params&lowbar;base`] 
| Common functionality for query parameter containers
| link:#boost-urls-params_encoded_base[`params&lowbar;encoded&lowbar;base`] 
| Common functionality for containers
| link:#boost-urls-params_encoded_ref[`params&lowbar;encoded&lowbar;ref`] 
| A view representing query parameters in a URL
| link:#boost-urls-params_encoded_view[`params&lowbar;encoded&lowbar;view`] 
| A view representing query parameters in a URL
| link:#boost-urls-params_ref[`params&lowbar;ref`] 
| A view representing query parameters in a URL
| link:#boost-urls-params_view[`params&lowbar;view`] 
| A view representing query parameters in a URL
| link:#boost-urls-pct_string_view[`pct&lowbar;string&lowbar;view`] 
| A reference to a valid percent&hyphen;encoded string
| link:#boost-urls-segments_base[`segments&lowbar;base`] 
| Common functionality for containers
| link:#boost-urls-segments_encoded_base[`segments&lowbar;encoded&lowbar;base`] 
| Common functionality for containers
| link:#boost-urls-segments_encoded_ref[`segments&lowbar;encoded&lowbar;ref`] 
| A view representing path segments in a URL
| link:#boost-urls-segments_encoded_view[`segments&lowbar;encoded&lowbar;view`] 
| A view representing path segments in a URL
| link:#boost-urls-segments_ref[`segments&lowbar;ref`] 
| A view representing path segments in a URL
| link:#boost-urls-segments_view[`segments&lowbar;view`] 
| A view representing path segments in a URL
| link:#boost-urls-static_url[`static&lowbar;url`] 
| A modifiable container for a URL&period;
| link:#boost-urls-static_url_base[`static&lowbar;url&lowbar;base`] 
| Common implementation for all static URLs
| link:#boost-urls-url[`url`] 
| A modifiable container for a URL&period;
| link:#boost-urls-url_base[`url&lowbar;base`] 
| Common functionality for containers
| link:#boost-urls-url_view[`url&lowbar;view`] 
| A non&hyphen;owning reference to a valid URL
| link:#boost-urls-url_view_base[`url&lowbar;view&lowbar;base`] 
| Common functionality for containers
| link:#boost-urls-format_arg[`format&lowbar;arg`] 
| A temporary reference to a formatting argument
| link:#boost-urls-named_arg[`named&lowbar;arg`] 
| A temporary reference to a named formatting argument
| link:#boost-urls-optional[`optional`] 
| The type of optional used by the library
| link:#boost-urls-string_view[`string&lowbar;view`] 
| The type of string&lowbar;view used by the library
| link:#boost-urls-variant[`variant`] 
| The type of variant used by the library
|===

== Enums

[cols=2]
|===
| Name
| Description
| link:#boost-urls-error[`error`] 
| Error codes returned the library
| link:#boost-urls-host_type[`host&lowbar;type`] 
| Identifies the type of host in a URL&period;
| link:#boost-urls-scheme[`scheme`] 
| Identifies a known URL scheme
|===

== Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-arg[`arg`] 
| Designate a named argument for a replacement field
| link:#boost-urls-default_port[`default&lowbar;port`] 
| Return the default port for a known scheme
| link:#boost-urls-encode-0d[`encode`] 
| `encode` overloads
| link:#boost-urls-encoded_size[`encoded&lowbar;size`] 
| Return the buffer size needed for percent&hyphen;encoding
| link:#boost-urls-format-06[`format`] 
| Format arguments into a URL
| link:#boost-urls-format_to-01[`format&lowbar;to`] 
| Format arguments into a URL
| link:#boost-urls-make_pct_string_view[`make&lowbar;pct&lowbar;string&lowbar;view`] 
| Return a valid percent&hyphen;encoded string
| link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`] 
| Return a reference to a parsed URL string
| link:#boost-urls-parse_authority[`parse&lowbar;authority`] 
| Parse an authority
| link:#boost-urls-parse_ipv4_address[`parse&lowbar;ipv4&lowbar;address`] 
| Return an IPv4 address from an IP address string in dotted decimal form
| link:#boost-urls-parse_ipv6_address[`parse&lowbar;ipv6&lowbar;address`] 
| Parse a string containing an IPv6 address&period;
| link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`] 
| Return a reference to a parsed URL string
| link:#boost-urls-parse_path[`parse&lowbar;path`] 
| Parse a string and return an encoded segment view
| link:#boost-urls-parse_query[`parse&lowbar;query`] 
| Parse a string and return an encoded params view
| link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`] 
| Return a reference to a parsed URL string
| link:#boost-urls-parse_uri[`parse&lowbar;uri`] 
| Return a reference to a parsed URL string
| link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`] 
| Return a reference to a parsed URL string
| link:#boost-urls-pct_encoded_rule[`pct&lowbar;encoded&lowbar;rule`] 
| Rule for a string with percent&hyphen;encoded escapes
| link:#boost-urls-resolve[`resolve`] 
| Resolve a URL reference against a base URL
| link:#boost-urls-string_to_scheme[`string&lowbar;to&lowbar;scheme`] 
| Return the known scheme for a non&hyphen;normalized string, if known
| link:#boost-urls-swap[`swap`] 
| Swap
| link:#boost-urls-to_string[`to&lowbar;string`] 
| Return the normalized string for a known scheme
| link:#boost-urls-operator_lshift-04[`operator&lt;&lt;`] 
| Stream insertion operators
| link:#boost-urls-operator_lt-05c[`operator&lt;`] 
| Less&hyphen;than operators
| link:#boost-urls-operator_le-0b[`operator&lt;&equals;`] 
| Less&hyphen;than&hyphen;or&hyphen;equal operators
| link:#boost-urls-operator_gt-0f[`operator&gt;`] 
| Greater&hyphen;than operators
| link:#boost-urls-operator_ge-07[`operator&gt;&equals;`] 
| Greater&hyphen;than&hyphen;or&hyphen;equal operators
|===

== Variables

[cols=2]
|===
| Name
| Description
| link:#boost-urls-absolute_uri_rule[`absolute&lowbar;uri&lowbar;rule`] 
| Rule for absolute&hyphen;URI
| link:#boost-urls-authority_rule[`authority&lowbar;rule`] 
| Rule for authority
| link:#boost-urls-gen_delim_chars[`gen&lowbar;delim&lowbar;chars`] 
| The gen&hyphen;delims character set
| link:#boost-urls-ignore_case[`ignore&lowbar;case`] 
| Ignore case when comparing
| link:#boost-urls-ipv4_address_rule[`ipv4&lowbar;address&lowbar;rule`] 
| Rule for an IP version 4 style address
| link:#boost-urls-ipv6_address_rule[`ipv6&lowbar;address&lowbar;rule`] 
| Rule for An IP version 6 style address
| link:#boost-urls-no_value[`no&lowbar;value`] 
| Constant indicating no value in a param
| link:#boost-urls-origin_form_rule[`origin&lowbar;form&lowbar;rule`] 
| Rule for origin&hyphen;form
| link:#boost-urls-pchars[`pchars`] 
| The path character set
| link:#boost-urls-query_rule[`query&lowbar;rule`] 
| Rule for a query string
| link:#boost-urls-relative_ref_rule[`relative&lowbar;ref&lowbar;rule`] 
| Rule for relative&hyphen;ref
| link:#boost-urls-reserved_chars[`reserved&lowbar;chars`] 
| The reserved character set
| link:#boost-urls-sub_delim_chars[`sub&lowbar;delim&lowbar;chars`] 
| The sub&hyphen;delims character set
| link:#boost-urls-unreserved_chars[`unreserved&lowbar;chars`] 
| The unreserved character set
| link:#boost-urls-uri_reference_rule[`uri&lowbar;reference&lowbar;rule`] 
| Rule for URI&hyphen;reference
| link:#boost-urls-uri_rule[`uri&lowbar;rule`] 
| Rule for URI
|===

== Using Namespace Directives

[cols=1]
|===
| Name
| link:#boost-urls-error_types[`error&lowbar;types`]
|===


== Namespace Aliases

[cols=2]
|===
| Name
| Description
| link:#boost-urls-error_types-errc[`errc`] 
| The set of constants used for cross&hyphen;platform error codes
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-error_types-error_category[`error&lowbar;category`] 
| The type of error category used by the library
| link:#boost-urls-error_types-error_code[`error&lowbar;code`] 
| The type of error code used by the library
| link:#boost-urls-error_types-error_condition[`error&lowbar;condition`] 
| The type of error condition used by the library
| link:#boost-urls-error_types-result[`result`] 
| The type of result returned by library functions
| link:#boost-urls-error_types-system_error[`system&lowbar;error`] 
| The type of system error thrown by the library
|===

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#L171[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
namespace errc = 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;

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::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::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::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#L264[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::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 link:#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;
----
* https://boost.org/libs/system/doc/html/system.html#ref_resultt_e[]

== Template Parameters

[cols=2]
|===
| 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::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;

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#L131[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using 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

[cols=2]
|===
| 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#L151[boost&sol;url&sol;error&lowbar;types&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using 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

[cols=2]
|===
| Name
| system&lowbar;category
|===

== Namespace Aliases

[cols=1]
|===
| Name
| link:#boost-urls-grammar-string_token[`string&lowbar;token`] 
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-literal_rule[`literal&lowbar;rule`] 
| Match a string literal exactly
| link:#boost-urls-grammar-lut_chars[`lut&lowbar;chars`] 
| A set of characters
| link:#boost-urls-grammar-range[`range`] 
| A forward range of parsed elements
| link:#boost-urls-grammar-recycled[`recycled`] 
| A thread&hyphen;safe collection of instances of T
| link:#boost-urls-grammar-recycled_ptr[`recycled&lowbar;ptr`] 
| A pointer to a shared instance of T
| link:#boost-urls-grammar-string_view_base[`string&lowbar;view&lowbar;base`] 
| Common functionality for string views
| link:#boost-urls-grammar-unsigned_rule[`unsigned&lowbar;rule`] 
| Match an unsigned decimal
| link:#boost-urls-grammar-aligned_storage[`aligned&lowbar;storage`] 
| Provides an aligned storage buffer aligned for T
| link:#boost-urls-grammar-ci_equal[`ci&lowbar;equal`] 
| A case&hyphen;insensitive equals predicate for strings
| link:#boost-urls-grammar-ci_hash[`ci&lowbar;hash`] 
| A case&hyphen;insensitive hash function object for strings
| link:#boost-urls-grammar-ci_less[`ci&lowbar;less`] 
| A case&hyphen;insensitive less predicate for strings
| link:#boost-urls-grammar-is_charset[`is&lowbar;charset`] 
| Alias for `std&colon;&colon;true&lowbar;type` if T satisfies link:#boost-urls-grammar-CharSet[`CharSet`]&period;
| link:#boost-urls-grammar-is_rule[`is&lowbar;rule`] 
| Determine if T meets the requirements of link:#boost-urls-grammar-Rule[`Rule`]
|===

== Enums

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-condition[`condition`] 
| Error conditions for errors received from rules
| link:#boost-urls-grammar-error[`error`] 
| Error codes returned when using rules
|===

== Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-ci_compare[`ci&lowbar;compare`] 
| Return the case&hyphen;insensitive comparison of s0 and s1
| link:#boost-urls-grammar-ci_digest[`ci&lowbar;digest`] 
| Return the case&hyphen;insensitive digest of a string
| link:#boost-urls-grammar-ci_is_equal-0b2[`ci&lowbar;is&lowbar;equal`] 
| Return true if s0 equals s1 using case&hyphen;insensitive comparison
| link:#boost-urls-grammar-ci_is_less[`ci&lowbar;is&lowbar;less`] 
| Return true if s0 is less than s1 using case&hyphen;insensitive comparison
| link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`] 
| `delim&lowbar;rule` overloads
| link:#boost-urls-grammar-find_if[`find&lowbar;if`] 
| Find the first character in the string that is in the set&period;
| link:#boost-urls-grammar-find_if_not[`find&lowbar;if&lowbar;not`] 
| Find the first character in the string that is not in CharSet
| link:#boost-urls-grammar-hexdig_value[`hexdig&lowbar;value`] 
| Return the decimal value of a hex character
| link:#boost-urls-grammar-not_empty_rule[`not&lowbar;empty&lowbar;rule`] 
| Match another rule, if the result is not empty
| link:#boost-urls-grammar-operator_plus[`operator&plus;`] 
| Return the union of two character sets&period;
| link:#boost-urls-grammar-operator_minus[`operator&hyphen;`] 
| Return a new character set by subtracting
| link:#boost-urls-grammar-optional_rule[`optional&lowbar;rule`] 
| Match a rule, or the empty string
| link:#boost-urls-grammar-parse-09[`parse`] 
| Parse a character buffer using a rule
| link:#boost-urls-grammar-range_rule-02[`range&lowbar;rule`] 
| Match a repeating number of elements
| link:#boost-urls-grammar-ref-01[`ref`] 
| `ref` overloads
| link:#boost-urls-grammar-squelch[`squelch`] 
| Squelch the value of a rule
| link:#boost-urls-grammar-to_lower[`to&lowbar;lower`] 
| Return c converted to lowercase
| link:#boost-urls-grammar-to_upper[`to&lowbar;upper`] 
| Return c converted to uppercase
| link:#boost-urls-grammar-token_rule[`token&lowbar;rule`] 
| Match a non&hyphen;empty string of characters from a set
| link:#boost-urls-grammar-tuple_rule[`tuple&lowbar;rule`] 
| Match a series of rules in order
| link:#boost-urls-grammar-variant_rule[`variant&lowbar;rule`] 
| Match one of a set of rules
| link:#boost-urls-grammar-operator_lshift[`operator&lt;&lt;`] 
| Format a string to an output stream
| link:#boost-urls-grammar-operator_eq[`operator&equals;&equals;`] 
| Compare two string views for equality
| link:#boost-urls-grammar-operator_not_eq[`operator!&equals;`] 
| Compare two string views for inequality
| link:#boost-urls-grammar-operator_lt[`operator&lt;`] 
| Compare two string views for less than
| link:#boost-urls-grammar-operator_le[`operator&lt;&equals;`] 
| Compare two string views for less than or equal
| link:#boost-urls-grammar-operator_gt[`operator&gt;`] 
| Compare two string views for greater than
| link:#boost-urls-grammar-operator_ge[`operator&gt;&equals;`] 
| Compare two string views for greater than or equal
|===

== Variables

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-all_chars[`all&lowbar;chars`] 
| The set of all characters
| link:#boost-urls-grammar-alnum_chars[`alnum&lowbar;chars`] 
| The set of letters and digits
| link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`] 
| The set of all letters
| link:#boost-urls-grammar-dec_octet_rule[`dec&lowbar;octet&lowbar;rule`] 
| Match a decimal octet
| link:#boost-urls-grammar-digit_chars[`digit&lowbar;chars`] 
| The set of decimal digits
| link:#boost-urls-grammar-hexdig_chars[`hexdig&lowbar;chars`] 
| The set of hexadecimal digits
| link:#boost-urls-grammar-vchars[`vchars`] 
| The set of visible characters
|===

== Concepts

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-CharSet[`CharSet`] 
| Concept for a CharSet
| link:#boost-urls-grammar-Rule[`Rule`] 
| Concept for a grammar Rule
|===

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
namespace string&lowbar;token = link:#boost-urls-string_token[boost::urls::string&lowbar;token];
----

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;;
----

== 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#L326[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;;
----

== 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

link:#boost-urls-grammar-ci_hash[`ci&lowbar;hash`], link:#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#L287[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;;
----

== 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

link:#boost-urls-grammar-ci_equal[`ci&lowbar;equal`], link:#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#L365[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;;
----

== 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

link:#boost-urls-grammar-ci_equal[`ci&lowbar;equal`], link:#boost-urls-grammar-ci_hash[`ci&lowbar;hash`]&period;

Alias for `std&colon;&colon;true&lowbar;type` if T satisfies link:#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;;
----

== 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

[cols=2]
|===
| Name
| Description
| *T*
| the type to check&period;
|===

Determine if T meets the requirements of link:#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;;
----

== 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

link:#boost-urls-grammar-parse-09[`parse`]&period;

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
| link:#boost-urls-grammar-literal_rule-value_type[`value&lowbar;type`] 
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-literal_rule-2constructor[`literal&lowbar;rule`]         [.small]#[constructor]#
| Construct from `char`
| link:#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 link:#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 link:#boost-urls-grammar-literal_rule-parse[`parse`]&period;

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

link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`], link:#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#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;
----

Construct from `char`

== 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;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The value to construct from
|===

== 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;value&lowbar;type&gt;
parse(
    char const*& it,
    char const* end) const noexcept;
----

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
| link:#boost-urls-grammar-lut_chars-2constructor-029[`lut&lowbar;chars`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-grammar-lut_chars-operator_call-09[`operator()`] 
| Return true if ch is in the character set&period;
| link:#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
| `link:#boost-urls-grammar-operator_minus[boost::urls::grammar::operator&hyphen;]`
| Return a new character set by subtracting
| `link:#boost-urls-grammar-operator_plus[boost::urls::grammar::operator&plus;]`
| Return the union of two character sets&period;
|===

== 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 link:#boost-urls-grammar-find_if[`find&lowbar;if`] and link:#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

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

Constructors

== Synopses

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;`

Constructor


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

[.small]#link:#boost-urls-grammar-lut_chars-2constructor-079[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-lut_chars-2constructor-074[_» more&period;&period;&period;_]#

Constructor&period;


[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
link:#boost-urls-grammar-lut_chars-2constructor-02d[lut&lowbar;chars](Pred const& pred) noexcept;
----

[.small]#link:#boost-urls-grammar-lut_chars-2constructor-02d[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| 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

== 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

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *s*
| A null&hyphen;terminated string&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

[cols=2]
|===
| Name
| Description
| *pred*
| The function object to use for determining membership in the character set&period;
|===

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

== Synopses

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

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


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

[.small]#link:#boost-urls-grammar-lut_chars-operator_call-0f6[_» more&period;&period;&period;_]#

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


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

[.small]#link:#boost-urls-grammar-lut_chars-operator_call-0fe[_» more&period;&period;&period;_]#

== Return Value

`true` if `ch` is in the set&period;

== Parameters

[cols=2]
|===
| 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#L266[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;

== Return Value

`true` if `ch` is in the set&period;

== Parameters

[cols=2]
|===
| 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#L257[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;

== Return Value

`true` if `ch` is in the set&period;

== Parameters

[cols=2]
|===
| 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#L372[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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;

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
| link:#boost-urls-grammar-range-iterator[`iterator`] 
| A constant, forward iterator to elements of the range
| link:#boost-urls-grammar-range-const_iterator[`const&lowbar;iterator`] 
| A constant, forward iterator to elements of the range
| link:#boost-urls-grammar-range-const_reference[`const&lowbar;reference`] 
| The type of each element of the range
| link:#boost-urls-grammar-range-difference_type[`difference&lowbar;type`] 
| The type used to represent signed integers
| link:#boost-urls-grammar-range-pointer[`pointer`] 
| Provided for compatibility, unused
| link:#boost-urls-grammar-range-reference[`reference`] 
| The type of each element of the range
| link:#boost-urls-grammar-range-size_type[`size&lowbar;type`] 
| The type used to represent unsigned integers
| link:#boost-urls-grammar-range-value_type[`value&lowbar;type`] 
| The type of each element of the range
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-range-2constructor-04[`range`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-grammar-range-2destructor[`&#126;range`] [.small]#[destructor]#
| Destructor
| link:#boost-urls-grammar-range-operator_assign-00[`operator&equals;`] 
| Assignment
| link:#boost-urls-grammar-range-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-grammar-range-empty[`empty`] 
| Return true if the range is empty
| link:#boost-urls-grammar-range-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-grammar-range-size[`size`] 
| Return the number of elements in the range
| link:#boost-urls-grammar-range-string[`string`] 
| Return the matching part of the string
|===

== Description

Objects of this type are forward ranges returned when parsing using the link:#boost-urls-grammar-range_rule-02[`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;

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

[cols=2]
|===
| Name
| Description
| *T*
| The value type of the range
|===

== See Also

link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-grammar-range_rule-02[`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#L164[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = link:#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 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;
----

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-grammar-range[boost::urls::grammar::range]`
| A forward range of parsed elements
|===

Constructor

== Synopses

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;`

Constructor


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

[.small]#link:#boost-urls-grammar-range-2constructor-01e[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-range-2constructor-01b[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-range-2constructor-08[_» more&period;&period;&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#L209[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
range(link:#boost-urls-grammar-range[range] const& other) 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;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

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(link:#boost-urls-grammar-range[range]&& other) 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;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to move construct from
|===

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();
----

Assignment

== Synopses

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

Assignment


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

[.small]#link:#boost-urls-grammar-range-operator_assign-0e[_» more&period;&period;&period;_]#

Assignment


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

[.small]#link:#boost-urls-grammar-range-operator_assign-08[_» more&period;&period;&period;_]#

== Return Value

`&ast;this`

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-grammar-range[range]&
operator&equals;(link:#boost-urls-grammar-range[range] const& other) 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 Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy assign from
|===

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-grammar-range[range]&
operator&equals;(link:#boost-urls-grammar-range[range]&& other) 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;

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to move assign from
|===

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#L251[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

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

== Return Value

An iterator to the first element

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#L263[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

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

== Return Value

`true` if the range is empty

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#L257[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

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

== Return Value

An iterator to one past the last element

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#L273[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 Value

The number of elements

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#L283[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;
----

== Return Value

A string view representing the range

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
| link:#boost-urls-grammar-recycled-2constructor[`recycled`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-grammar-recycled-2destructor[`&#126;recycled`] [.small]#[destructor]#
| Destructor
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-grammar-recycled_ptr[boost::urls::grammar::recycled&lowbar;ptr]`
| A pointer to a shared instance of T
|===

== Description

Instances of this type may be used to control where recycled instances of T come from when used with link:#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

link:#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 link:#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
| link:#boost-urls-grammar-recycled_ptr-2constructor-07[`recycled&lowbar;ptr`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-grammar-recycled_ptr-2destructor[`&#126;recycled&lowbar;ptr`] [.small]#[destructor]#
| Destructor
| link:#boost-urls-grammar-recycled_ptr-operator_assign-0b1[`operator&equals;`] 
| Assignment
| link:#boost-urls-grammar-recycled_ptr-acquire[`acquire`] 
| Return the referenced object
| link:#boost-urls-grammar-recycled_ptr-bin[`bin`] 
| Return the referenced recycle bin
| link:#boost-urls-grammar-recycled_ptr-empty[`empty`] 
| Return true if this does not reference an object
| link:#boost-urls-grammar-recycled_ptr-get[`get`] 
| Return the referenced object
| link:#boost-urls-grammar-recycled_ptr-operator_star[`operator&ast;`] 
| Return the referenced object
| link:#boost-urls-grammar-recycled_ptr-operator_ptr[`operator&hyphen;&gt;`] 
| Return the referenced object
| link:#boost-urls-grammar-recycled_ptr-release[`release`] 
| Release the referenced object
| link:#boost-urls-grammar-recycled_ptr-2conversion[`operator bool`] 
| Return true if this references an object
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-grammar-recycled[boost::urls::grammar::recycled]`
| A thread&hyphen;safe collection of instances of T
|===

== 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

[cols=2]
|===
| Name
| Description
| *T*
| the type of object to acquire, which must be _DefaultConstructible_&period;
|===

Constructor

== Synopses

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;`

Constructor


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

[.small]#link:#boost-urls-grammar-recycled_ptr-2constructor-056[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-recycled_ptr-2constructor-0ab[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-recycled_ptr-2constructor-0f[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-recycled_ptr-2constructor-05e[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-recycled_ptr-2constructor-08[_» more&period;&period;&period;_]#

Constructor


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

[.small]#link:#boost-urls-grammar-recycled_ptr-2constructor-0ac[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The pointer to copy
| *bin*
| The recycle bin to use
|===

== See Also

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

link:#boost-urls-grammar-recycled_ptr-acquire[`acquire`], link:#boost-urls-grammar-recycled[`recycled`], link:#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

link:#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#L321[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
recycled&lowbar;ptr(link:#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

[cols=2]
|===
| 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(link:#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

[cols=2]
|===
| Name
| Description
| *other*
| The pointer to move from
|===

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 value) 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;

== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to construct from
|===

== See Also

link:#boost-urls-grammar-recycled_ptr-acquire[`acquire`], link:#boost-urls-grammar-recycled[`recycled`], link:#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#L208[boost&sol;url&sol;grammar&sol;recycled&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
recycled&lowbar;ptr(link:#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

[cols=2]
|===
| Name
| Description
| *bin*
| The recycle bin to use
|===

== See Also

link:#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(
    link:#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

[cols=2]
|===
| Name
| Description
| *bin*
| The recycle bin to use
|===

== See Also

link:#boost-urls-grammar-recycled_ptr-acquire[`acquire`], link:#boost-urls-grammar-recycled[`recycled`], link:#boost-urls-grammar-recycled_ptr-release[`release`]&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();
----
Assignment

== Synopses

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

Assignment


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

[.small]#link:#boost-urls-grammar-recycled_ptr-operator_assign-09[_» more&period;&period;&period;_]#

Assignment


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

[.small]#link:#boost-urls-grammar-recycled_ptr-operator_assign-0b4[_» more&period;&period;&period;_]#

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The pointer to copy from
|===

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-grammar-recycled_ptr[recycled&lowbar;ptr]&
operator&equals;(link:#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;

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The pointer to copy from
|===

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-grammar-recycled_ptr[recycled&lowbar;ptr]&
operator&equals;(link:#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;

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The pointer to move from
|===

Return the referenced object

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L499[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 Value

A reference to the object

Return the referenced recycle bin

== Synopsis

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

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

== Description

== Exception Safety
Throws nothing&period;

== Return Value

A reference to the recycle bin

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#L406[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 Value

`p`_ &equals;&equals; nullptr_

Return the referenced object

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L452[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 Value

A pointer to the object

Return the referenced object

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L480[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 Value

A reference to the object

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&hyphen;&gt;() const noexcept;
----

== Description

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

== Exception Safety
Throws nothing&period;

== Return Value

A pointer to the object

Release the referenced object

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/recycled.hpp#L516[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;

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#L424[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 Value

`!this&hyphen;&gt;empty()`

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
| link:#boost-urls-grammar-string_view_base-const_iterator[`const&lowbar;iterator`] 
| The const iterator type
| link:#boost-urls-grammar-string_view_base-const_pointer[`const&lowbar;pointer`] 
| The const pointer type
| link:#boost-urls-grammar-string_view_base-const_reference[`const&lowbar;reference`] 
| The const reference type
| link:#boost-urls-grammar-string_view_base-const_reverse_iterator[`const&lowbar;reverse&lowbar;iterator`] 
| The const reverse iterator type
| link:#boost-urls-grammar-string_view_base-difference_type[`difference&lowbar;type`] 
| The difference type
| link:#boost-urls-grammar-string_view_base-iterator[`iterator`] 
| The iterator type
| link:#boost-urls-grammar-string_view_base-pointer[`pointer`] 
| The pointer type
| link:#boost-urls-grammar-string_view_base-reference[`reference`] 
| The reference type
| link:#boost-urls-grammar-string_view_base-reverse_iterator[`reverse&lowbar;iterator`] 
| The reverse iterator type
| link:#boost-urls-grammar-string_view_base-size_type[`size&lowbar;type`] 
| The size type
| link:#boost-urls-grammar-string_view_base-traits_type[`traits&lowbar;type`] 
| The character traits
| link:#boost-urls-grammar-string_view_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-at[`at`] 
| Access a character
| link:#boost-urls-grammar-string_view_base-back[`back`] 
| Return the last character
| link:#boost-urls-grammar-string_view_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-grammar-string_view_base-cbegin[`cbegin`] 
| Return an iterator to the beginning
| link:#boost-urls-grammar-string_view_base-cend[`cend`] 
| Return an iterator to the end
| link:#boost-urls-grammar-string_view_base-compare-06[`compare`] 
| Return the result of comparing to another string
| link:#boost-urls-grammar-string_view_base-contains-0a[`contains`] 
| Return true if matching characters are found
| link:#boost-urls-grammar-string_view_base-copy[`copy`] 
| Copy the characters to another buffer
| link:#boost-urls-grammar-string_view_base-crbegin[`crbegin`] 
| Return a reverse iterator to the end
| link:#boost-urls-grammar-string_view_base-crend[`crend`] 
| Return a reverse iterator to the beginning
| link:#boost-urls-grammar-string_view_base-data[`data`] 
| Return a pointer to the character buffer
| link:#boost-urls-grammar-string_view_base-empty[`empty`] 
| Return true if the string is empty
| link:#boost-urls-grammar-string_view_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-grammar-string_view_base-ends_with-09[`ends&lowbar;with`] 
| Return true if a matching suffix exists
| link:#boost-urls-grammar-string_view_base-find-0e[`find`] 
| Return the position of matching characters
| link:#boost-urls-grammar-string_view_base-find_first_not_of-01[`find&lowbar;first&lowbar;not&lowbar;of`] 
| Return the position of the first non&hyphen;match
| link:#boost-urls-grammar-string_view_base-find_first_of-047[`find&lowbar;first&lowbar;of`] 
| Return the position of the first match
| link:#boost-urls-grammar-string_view_base-find_last_not_of-03e[`find&lowbar;last&lowbar;not&lowbar;of`] 
| Return the position of the last non&hyphen;match
| link:#boost-urls-grammar-string_view_base-find_last_of-0b[`find&lowbar;last&lowbar;of`] 
| Return the position of the last match
| link:#boost-urls-grammar-string_view_base-front[`front`] 
| Return the first character
| link:#boost-urls-grammar-string_view_base-length[`length`] 
| Return the size
| link:#boost-urls-grammar-string_view_base-max_size[`max&lowbar;size`] 
| Return the maximum allowed size
| link:#boost-urls-grammar-string_view_base-operator_subs[`operator&lsqb;&rsqb;`] 
| Access a character
| link:#boost-urls-grammar-string_view_base-rbegin[`rbegin`] 
| Return a reverse iterator to the end
| link:#boost-urls-grammar-string_view_base-rend[`rend`] 
| Return a reverse iterator to the beginning
| link:#boost-urls-grammar-string_view_base-rfind-05[`rfind`] 
| Return the position of matching characters
| link:#boost-urls-grammar-string_view_base-size[`size`] 
| Return the size
| link:#boost-urls-grammar-string_view_base-starts_with-02[`starts&lowbar;with`] 
| Return true if a matching prefix exists
| link:#boost-urls-grammar-string_view_base-substr[`substr`] 
| Return a view to part of the string
| link:#boost-urls-grammar-string_view_base-2conversion-06[`operator std::string`] 
| Conversion
| link:#boost-urls-grammar-string_view_base-2conversion-0e[`operator std::string&lowbar;view`] 
| Conversion
|===

== Static Data Members

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-npos[`npos`] 
| A constant used to represent &quot;no position&quot;
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-2constructor-04[`string&lowbar;view&lowbar;base`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-grammar-string_view_base-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-grammar-string_view_base-swap[`swap`] 
| Swap
|===

== Protected Data Members

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-s_[`s&lowbar;`] 
| The referenced character buffer
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-grammar-operator_lshift[boost::urls::grammar::operator&lt;&lt;]`
| Format a string to an output stream
| `link:#boost-urls-grammar-operator_ge[boost::urls::grammar::operator&gt;&equals;]`
| Compare two string views for greater than or equal
| `link:#boost-urls-grammar-operator_gt[boost::urls::grammar::operator&gt;]`
| Compare two string views for greater than
| `link:#boost-urls-grammar-operator_le[boost::urls::grammar::operator&lt;&equals;]`
| Compare two string views for less than or equal
| `link:#boost-urls-grammar-operator_lt[boost::urls::grammar::operator&lt;]`
| Compare two string views for less than
| `link:#boost-urls-grammar-operator_not_eq[boost::urls::grammar::operator!&equals;]`
| Compare two string views for inequality
| `link:#boost-urls-grammar-operator_eq[boost::urls::grammar::operator&equals;&equals;]`
| Compare two string views for equality
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-pct_string_view[`pct&lowbar;string&lowbar;view`]
| A reference to a valid percent&hyphen;encoded string
|===

== 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;

The const iterator type

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L111[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#L105[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#L109[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#L115[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;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#L122[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#L113[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef link:#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#L103[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#L107[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#L118[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
typedef link:#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#L120[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#L99[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#L101[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;
----

Access a character

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-const_reference[const&lowbar;reference]
at(link:#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 Value

The character at the position

== Parameters

[cols=2]
|===
| Name
| Description
| *pos*
| The position to access
|===

Return the last character

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

The last character

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#L177[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

An iterator to the beginning

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#L199[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

An iterator to the beginning

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#L210[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

An iterator to the end

Return the result of comparing to another string

== Synopses

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

Return the result of comparing to another string


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

[.small]#link:#boost-urls-grammar-string_view_base-compare-02[_» more&period;&period;&period;_]#

Return the result of comparing to another string


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

[.small]#link:#boost-urls-grammar-string_view_base-compare-07[_» more&period;&period;&period;_]#

Return the result of comparing to another string


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

[.small]#link:#boost-urls-grammar-string_view_base-compare-0a[_» more&period;&period;&period;_]#

Return the result of comparing to another string


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

[.small]#link:#boost-urls-grammar-string_view_base-compare-0b[_» more&period;&period;&period;_]#

Return the result of comparing to another string


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

[.small]#link:#boost-urls-grammar-string_view_base-compare-0c[_» more&period;&period;&period;_]#

Return the result of comparing to another string


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

[.small]#link:#boost-urls-grammar-string_view_base-compare-0e[_» more&period;&period;&period;_]#

== Return Value

The result of the comparison

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The string to compare
| *s*
| The string to compare
| *pos1*
| The position to start comparing from
| *n1*
| The number of characters to compare
| *n2*
| The number of characters to compare
| *pos2*
| The position to start comparing from
|===

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#L413[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 Value

The result of the comparison

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The 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/grammar/string_view_base.hpp#L459[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 Value

The result of the comparison

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The 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/grammar/string_view_base.hpp#L428[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos1,
    link:#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 Value

The result of the comparison

== Parameters

[cols=2]
|===
| Name
| Description
| *pos1*
| The position to start comparing from
| *n1*
| The number of characters to compare
| *str*
| The 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/grammar/string_view_base.hpp#L474[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos1,
    link:#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 Value

The result of the comparison

== Parameters

[cols=2]
|===
| Name
| Description
| *pos1*
| The position to start comparing from
| *n1*
| The number of characters to compare
| *s*
| The 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/grammar/string_view_base.hpp#L490[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos1,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] n1,
    char const* s,
    link:#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 Value

The result of the comparison

== Parameters

[cols=2]
|===
| Name
| Description
| *pos1*
| The position to start comparing from
| *n1*
| The number of characters to compare
| *s*
| The string to compare
| *n2*
| The number of characters 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/grammar/string_view_base.hpp#L445[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos1,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] n1,
    core::string&lowbar;view str,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos2,
    link:#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 Value

The result of the comparison

== Parameters

[cols=2]
|===
| Name
| Description
| *pos1*
| The position to start comparing from
| *n1*
| The number of characters to compare
| *str*
| The string to compare
| *pos2*
| The position to start comparing from
| *n2*
| The number of characters to compare
|===

Return true if matching characters are found

== Synopses

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

Return true if matching characters are found


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

[.small]#link:#boost-urls-grammar-string_view_base-contains-08[_» more&period;&period;&period;_]#

Return true if matching characters are found


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

[.small]#link:#boost-urls-grammar-string_view_base-contains-04[_» more&period;&period;&period;_]#

Return true if matching characters are found


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

[.small]#link:#boost-urls-grammar-string_view_base-contains-03[_» more&period;&period;&period;_]#

== Return Value

* `true` if the string contains the characters, otherwise `false`
* `true` if the string contains the character, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *sv*
| The string to search for
| *c*
| The character to search for
| *s*
| The string to search for
|===

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#L942[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 Value

`true` if the string contains the characters, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *sv*
| The string to search for
|===

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#L954[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 Value

`true` if the string contains the character, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *c*
| The character to search for
|===

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#L966[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`

== Return Value

`true` if the string contains the characters, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to search for
|===

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#L384[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
copy(
    char* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] n,
    link:#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 Value

The number of characters copied

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The destination buffer
| *n*
| The number of characters to copy
| *pos*
| The position to start from
|===

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#L245[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

A reverse iterator to the end

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#L257[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

A reverse iterator to the beginning

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#L367[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

A pointer to the character buffer

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#L304[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 Value

`true` if the string is empty

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#L188[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

An iterator to the end

Return true if a matching suffix exists

== Synopses

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;`

Return true if a matching suffix exists


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

[.small]#link:#boost-urls-grammar-string_view_base-ends_with-0a[_» more&period;&period;&period;_]#

Return true if a matching suffix exists


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

[.small]#link:#boost-urls-grammar-string_view_base-ends_with-06[_» more&period;&period;&period;_]#

Return true if a matching suffix exists


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

[.small]#link:#boost-urls-grammar-string_view_base-ends_with-0c[_» more&period;&period;&period;_]#

== Return Value

`true` if the suffix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The string to search for
|===

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#L547[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 Value

`true` if the suffix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The string to search for
|===

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#L560[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 Value

`true` if the suffix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The character to search for
|===

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#L573[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 Value

`true` if the suffix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The string to search for
|===

Return the position of matching characters

== Synopses

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;`

Return the position of matching characters


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

[.small]#link:#boost-urls-grammar-string_view_base-find-0d[_» more&period;&period;&period;_]#

Return the position of matching characters


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

[.small]#link:#boost-urls-grammar-string_view_base-find-00[_» more&period;&period;&period;_]#

Return the position of matching characters


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

[.small]#link:#boost-urls-grammar-string_view_base-find-0c[_» more&period;&period;&period;_]#

Return the position of matching characters


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

[.small]#link:#boost-urls-grammar-string_view_base-find-07[_» more&period;&period;&period;_]#

== Return Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
| *c*
| The character to search for
| *s*
| The characters to search for
| *n*
| The number of characters to search for
|===

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#L589[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find(
    core::string&lowbar;view str,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L603[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find(
    char c,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *c*
| The character to search for
| *pos*
| The position to start searching from
|===

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#L632[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find(
    char const* s,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L618[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find(
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
| *n*
| The number of characters to search for
|===

Return the position of the first non&hyphen;match

== Synopses

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

Return the position of the first non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_not_of-0e[_» more&period;&period;&period;_]#

Return the position of the first non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_not_of-02[_» more&period;&period;&period;_]#

Return the position of the first non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_not_of-0c[_» more&period;&period;&period;_]#

Return the position of the first non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_not_of-0a[_» more&period;&period;&period;_]#

== Return Value

The position of the first non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
| *c*
| The character to search for
| *s*
| The characters to search for
| *n*
| The number of characters to search for
|===

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#L825[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;not&lowbar;of(
    core::string&lowbar;view str,
    link:#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 Value

The position of the first non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L839[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;not&lowbar;of(
    char c,
    link:#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 Value

The position of the first non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *c*
| The character to search for
| *pos*
| The position to start searching from
|===

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#L868[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;not&lowbar;of(
    char const* s,
    link:#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 Value

The position of the first non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L854[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;not&lowbar;of(
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos,
    link:#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 Value

The position of the first non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
| *n*
| The number of characters to search for
|===

Return the position of the first match

== Synopses

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

Return the position of the first match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_of-0ab[_» more&period;&period;&period;_]#

Return the position of the first match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_of-04d[_» more&period;&period;&period;_]#

Return the position of the first match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_of-08[_» more&period;&period;&period;_]#

Return the position of the first match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_first_of-0af[_» more&period;&period;&period;_]#

== Return Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
| *c*
| The character to search for
| *s*
| The characters to search for
| *n*
| The number of characters to search for
|===

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#L707[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;of(
    core::string&lowbar;view str,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L721[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;of(
    char c,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *c*
| The character to search for
| *pos*
| The position to start searching from
|===

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#L750[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;of(
    char const* s,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L736[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;first&lowbar;of(
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
| *n*
| The number of characters to search for
|===

Return the position of the last non&hyphen;match

== Synopses

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

Return the position of the last non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_not_of-035[_» more&period;&period;&period;_]#

Return the position of the last non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_not_of-0d[_» more&period;&period;&period;_]#

Return the position of the last non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_not_of-06[_» more&period;&period;&period;_]#

Return the position of the last non&hyphen;match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_not_of-01[_» more&period;&period;&period;_]#

== Return Value

The position of the last non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
| *c*
| The character to search for
| *s*
| The characters to search for
| *n*
| The number of characters to search for
|===

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#L884[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;not&lowbar;of(
    core::string&lowbar;view str,
    link:#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 Value

The position of the last non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L898[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;not&lowbar;of(
    char c,
    link:#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 Value

The position of the last non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *c*
| The character to search for
| *pos*
| The position to start searching from
|===

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#L927[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;not&lowbar;of(
    char const* s,
    link:#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 Value

The position of the last non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L913[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;not&lowbar;of(
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos,
    link:#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 Value

The position of the last non&hyphen;match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
| *n*
| The number of characters to search for
|===

Return the position of the last match

== Synopses

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

Return the position of the last match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_of-00[_» more&period;&period;&period;_]#

Return the position of the last match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_of-0c[_» more&period;&period;&period;_]#

Return the position of the last match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_of-08[_» more&period;&period;&period;_]#

Return the position of the last match


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

[.small]#link:#boost-urls-grammar-string_view_base-find_last_of-02[_» more&period;&period;&period;_]#

== Return Value

The position of the last match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
| *c*
| The character to search for
| *s*
| The characters to search for
| *n*
| The number of characters to search for
|===

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#L766[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;of(
    core::string&lowbar;view str,
    link:#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 Value

The position of the last match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L780[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;of(
    char c,
    link:#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 Value

The position of the last match

== Parameters

[cols=2]
|===
| Name
| Description
| *c*
| The character to search for
| *pos*
| The position to start searching from
|===

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#L809[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;of(
    char const* s,
    link:#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 Value

The position of the last match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L795[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
find&lowbar;last&lowbar;of(
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos,
    link:#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 Value

The position of the last match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
| *n*
| The number of characters to search for
|===

Return the first character

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

The first character

Return the size

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

The size

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#L293[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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`

== Return Value

The maximum allowed size

Access a character

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-const_reference[const&lowbar;reference]
operator&lsqb;&rsqb;(link:#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 Value

The character at the position

== Parameters

[cols=2]
|===
| Name
| Description
| *pos*
| The position to access
|===

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#L221[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

A reverse iterator to the end

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#L233[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

A reverse iterator to the beginning

Return the position of matching characters

== Synopses

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

Return the position of matching characters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
link:#boost-urls-grammar-string_view_base-rfind-0ed[rfind](
    core::string&lowbar;view str,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-rfind-0ed[_» more&period;&period;&period;_]#

Return the position of matching characters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
link:#boost-urls-grammar-string_view_base-rfind-0eb[rfind](
    char c,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-rfind-0eb[_» more&period;&period;&period;_]#

Return the position of matching characters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
link:#boost-urls-grammar-string_view_base-rfind-0d[rfind](
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos = core&colon;&colon;string&lowbar;view&colon;&colon;npos) const noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-rfind-0d[_» more&period;&period;&period;_]#

Return the position of matching characters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
link:#boost-urls-grammar-string_view_base-rfind-0b[rfind](
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] n) const noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-rfind-0b[_» more&period;&period;&period;_]#

== Return Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
| *c*
| The character to search for
| *s*
| The characters to search for
| *n*
| The number of characters to search for
|===

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#L648[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
rfind(
    core::string&lowbar;view str,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *str*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L662[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
rfind(
    char c,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *c*
| The character to search for
| *pos*
| The position to start searching from
|===

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#L691[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
rfind(
    char const* s,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
|===

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#L677[boost&sol;url&sol;grammar&sol;string&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type]
rfind(
    char const* s,
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos,
    link:#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 Value

The position of the first match

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The characters to search for
| *pos*
| The position to start searching from
| *n*
| The number of characters to search for
|===

Return the size

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#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 Value

The size

Return true if a matching prefix exists

== Synopses

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

Return true if a matching prefix exists


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
link:#boost-urls-grammar-string_view_base-starts_with-06[starts&lowbar;with](core::string&lowbar;view x) const noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-starts_with-06[_» more&period;&period;&period;_]#

Return true if a matching prefix exists


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
link:#boost-urls-grammar-string_view_base-starts_with-0b[starts&lowbar;with](char x) const noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-starts_with-0b[_» more&period;&period;&period;_]#

Return true if a matching prefix exists


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
link:#boost-urls-grammar-string_view_base-starts_with-0d[starts&lowbar;with](char const* x) const noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-starts_with-0d[_» more&period;&period;&period;_]#

== Return Value

`true` if the prefix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The string to search for
|===

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#L506[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 Value

`true` if the prefix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The string to search for
|===

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#L519[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 Value

`true` if the prefix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The character to search for
|===

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#L532[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`

== Return Value

`true` if the prefix matches

== Parameters

[cols=2]
|===
| Name
| Description
| *x*
| The string to search for
|===

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#L398[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(
    link:#boost-urls-grammar-string_view_base-size_type[size&lowbar;type] pos = 0,
    link:#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`

== Return Value

A view to the substring

== Parameters

[cols=2]
|===
| Name
| Description
| *pos*
| The position to start from
| *n*
| The number of characters
|===

Conversion

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L160[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;

== Return Value

A string with the same contents

Conversion

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L133[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;
----

== Return Value

A string view with the same contents

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#L125[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;
----

Constructor

== Synopses

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

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-2constructor-02[string&lowbar;view&lowbar;base]() = default;
----

[.small]#link:#boost-urls-grammar-string_view_base-2constructor-02[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-2constructor-0e[string&lowbar;view&lowbar;base](link:#boost-urls-grammar-string_view_base[string&lowbar;view&lowbar;base] const& other) = default;
----

[.small]#link:#boost-urls-grammar-string_view_base-2constructor-0e[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-2constructor-09[string&lowbar;view&lowbar;base](core::string&lowbar;view s) noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-2constructor-09[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base-2constructor-0a[string&lowbar;view&lowbar;base](
    char const* data,
    std::size&lowbar;t size) noexcept;
----

[.small]#link:#boost-urls-grammar-string_view_base-2constructor-0a[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string view
| *data*
| The character buffer
| *size*
| The number of characters
|===

Constructor

== 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
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#L86[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(link:#boost-urls-grammar-string_view_base[string&lowbar;view&lowbar;base] const& other) = default;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L47[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;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string view
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_view_base.hpp#L59[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;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *data*
| The character buffer
| *size*
| The number of characters
|===

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-string_view_base[string&lowbar;view&lowbar;base]&
operator&equals;(link:#boost-urls-grammar-string_view_base[string&lowbar;view&lowbar;base] const& other) = default;
----

== Return Value

A reference to this object

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to assign
|===

Swap

== 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"]
----
void
swap(link:#boost-urls-grammar-string_view_base[string&lowbar;view&lowbar;base]& s) noexcept;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The object to swap with
|===

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;;
----

Match an unsigned decimal

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/unsigned_rule.hpp#L52[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
| link:#boost-urls-grammar-unsigned_rule-value_type[`value&lowbar;type`] 
|===

== Member Functions

[cols=1]
|===
| Name
| link:#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 link:#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

[cols=2]
|===
| Name
| Description
| *Unsigned*
| The unsigned integer type used to store the result&period;
|===

== See Also

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`]&period;

== Synopsis

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

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

== Synopsis

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

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

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

link:#boost-urls-grammar-error[`error`], link:#boost-urls-grammar-parse-09[`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

link:#boost-urls-grammar-condition[`condition`], link:#boost-urls-grammar-parse-09[`parse`]&period;

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

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

== See Also

link:#boost-urls-grammar-ci_is_equal-0b2[`ci&lowbar;is&lowbar;equal`], link:#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

[cols=2]
|===
| Name
| Description
| *s*
| The string
|===

Return true if s0 equals s1 using case&hyphen;insensitive comparison

== Synopses

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

Return true if s0 equals s1 using case&hyphen;insensitive comparison


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-grammar-ci_is_equal-0b9[ci&lowbar;is&lowbar;equal](
    core::string&lowbar;view s0,
    core::string&lowbar;view s1) noexcept;
----

[.small]#link:#boost-urls-grammar-ci_is_equal-0b9[_» more&period;&period;&period;_]#

Return true if s0 equals s1 using case&hyphen;insensitive comparison


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class String0,
    class String1&gt;
bool
link:#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]#link:#boost-urls-grammar-ci_is_equal-0a[_» more&period;&period;&period;_]#

== Return Value

`true` if `s0` case&hyphen;insensitively equals `s1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

== See Also

link:#boost-urls-grammar-ci_compare[`ci&lowbar;compare`], link:#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#L204[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" ) );
----
== Return Value

`true` if `s0` case&hyphen;insensitively equals `s1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

== See Also

link:#boost-urls-grammar-ci_compare[`ci&lowbar;compare`], link:#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#L164[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" ) );
----
== Return Value

`true` if `s0` case&hyphen;insensitively equals `s1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

== See Also

link:#boost-urls-grammar-ci_compare[`ci&lowbar;compare`], link:#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#L239[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" ) );
----
== Return Value

`true` if `s0` is case&hyphen;insensitively less than `s1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

== See Also

link:#boost-urls-grammar-ci_compare[`ci&lowbar;compare`], link:#boost-urls-grammar-ci_is_equal-0b2[`ci&lowbar;is&lowbar;equal`]&period;

`delim&lowbar;rule` overloads

== Synopses

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

Match a character literal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
&sol;&ast; implementation-defined &ast;&sol;
link:#boost-urls-grammar-delim_rule-02[delim&lowbar;rule](char ch) noexcept;
----

[.small]#link:#boost-urls-grammar-delim_rule-02[_» more&period;&period;&period;_]#

Match a single character from a character set


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-CharSet[CharSet] CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
link:#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]#link:#boost-urls-grammar-delim_rule-01[_» more&period;&period;&period;_]#

== Return Value

* A rule which matches the character&period;
* A rule which matches a single character from the set&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *ch*
| The character to match
| *cs*
| The character set to use&period;
|===

== See Also

link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-grammar-squelch[`squelch`]&period;

link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`], link:#boost-urls-grammar-parse-09[`parse`], link:#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#L79[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;
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 link:#boost-urls-grammar-squelch[`squelch`] may be used to turn this into `void` instead&period; If there is no more input, the error code link:#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 link:#boost-urls-grammar-parse-09[`parse`]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( ".", delim_rule('.') );
----
== BNF
[,cpp]
----
char        = %00-FF
----
== Return Value

A rule which matches the character&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *ch*
| The character to match
|===

== See Also

link:#boost-urls-grammar-parse-09[`parse`], link:#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#L157[boost&sol;url&sol;grammar&sol;delim&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-CharSet[CharSet] CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 link:#boost-urls-grammar-squelch[`squelch`] may be used to turn this into `void` instead&period; If there is no more input, the error code link:#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 link:#boost-urls-grammar-parse-09[`parse`]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "X", delim_rule( alpha_chars ) );
----
== Return Value

A rule which matches a single character from the set&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *cs*
| The character set to use&period;
|===

== See Also

link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`], link:#boost-urls-grammar-parse-09[`parse`], link:#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;link:#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

[cols=2]
|===
| 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

link:#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;link:#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

[cols=2]
|===
| 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

link:#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#L117[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

[cols=2]
|===
| 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#L72[boost&sol;url&sol;grammar&sol;not&lowbar;empty&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 link:#boost-urls-grammar-parse-09[`parse`]&period;

[,cpp]
----
system::result< decode_view > rv = parse( "Program%20Files",
    not_empty_rule( pct_encoded_rule( unreserved_chars ) ) );
----
== Return Value

The adapted rule

== Parameters

[cols=2]
|===
| Name
| Description
| *r*
| The rule to match
|===

== See Also

link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-pct_encoded_rule[`pct&lowbar;encoded&lowbar;rule`], link:#boost-urls-unreserved_chars[`unreserved&lowbar;chars`]&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#L300[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-lut_chars[lut&lowbar;chars]
operator&plus;(
    link:#boost-urls-grammar-lut_chars[lut&lowbar;chars] const& cs0,
    link:#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

[cols=2]
|===
| 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#L337[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-grammar-lut_chars[lut&lowbar;chars]
operator&hyphen;(
    link:#boost-urls-grammar-lut_chars[lut&lowbar;chars] const& cs0,
    link:#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

[cols=2]
|===
| Name
| Description
| *cs0*
| A character set to join&period;
| *cs1*
| A character set to join&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#L84[boost&sol;url&sol;grammar&sol;optional&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc5234#section-3.8[]

== Return Value

The adapted rule

== Parameters

[cols=2]
|===
| Name
| Description
| *r*
| The rule to match
|===

== See Also

link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`], link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-optional[`optional`], link:#boost-urls-grammar-token_rule[`token&lowbar;rule`]&period;

Parse a character buffer using a rule

== Synopses

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;`

Parse a character buffer using a rule


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
system::result&lt;R::value&lowbar;type&gt;
link:#boost-urls-grammar-parse-02[parse](
    core::string&lowbar;view s,
    R const& r);
----

[.small]#link:#boost-urls-grammar-parse-02[_» more&period;&period;&period;_]#

Parse a character buffer using a rule


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
system::result&lt;R::value&lowbar;type&gt;
link:#boost-urls-grammar-parse-06[parse](
    char const*& it,
    char const* end,
    R const& r);
----

[.small]#link:#boost-urls-grammar-parse-06[_» more&period;&period;&period;_]#

== Return Value

The parsed value upon success, otherwise an error&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The input string
| *r*
| The rule to use
| *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;
|===

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;link:#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

[cols=2]
|===
| Name
| Description
| *s*
| The input string
| *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#L37[boost&sol;url&sol;grammar&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#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

[cols=2]
|===
| 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
|===

Match a repeating number of elements

== Synopses

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

Match a repeating number of elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
link:#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]#link:#boost-urls-grammar-range_rule-00[_» more&period;&period;&period;_]#

Match a repeating number of elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    link:#boost-urls-grammar-Rule[Rule] R1,
    link:#boost-urls-grammar-Rule[Rule] R2&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
link:#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]#link:#boost-urls-grammar-range_rule-06[_» more&period;&period;&period;_]#

== Return Value

A rule that matches the range&period;

== Parameters

[cols=2]
|===
| 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

link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`], link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`], link:#boost-urls-grammar-error[`error&colon;&colon;end&lowbar;of&lowbar;range`], link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-grammar-range[`range`], link:#boost-urls-grammar-tuple_rule[`tuple&lowbar;rule`], link:#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#L397[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 link:#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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[]

== Return Value

A rule that matches the range&period;

== Parameters

[cols=2]
|===
| 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

link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`], link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`], link:#boost-urls-grammar-error[`error&colon;&colon;end&lowbar;of&lowbar;range`], link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-grammar-range[`range`], link:#boost-urls-grammar-tuple_rule[`tuple&lowbar;rule`], link:#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#L527[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    link:#boost-urls-grammar-Rule[Rule] R1,
    link:#boost-urls-grammar-Rule[Rule] R2&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 link:#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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[]

== Return Value

A rule that matches the range&period;

== Parameters

[cols=2]
|===
| 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

link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`], link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`], link:#boost-urls-grammar-error[`error&colon;&colon;end&lowbar;of&lowbar;range`], link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-grammar-range[`range`], link:#boost-urls-grammar-tuple_rule[`tuple&lowbar;rule`], link:#boost-urls-grammar-squelch[`squelch`]&period;

`ref` overloads

== Synopses

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

Return a reference to a character set


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-CharSet[CharSet] CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
link:#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]#link:#boost-urls-grammar-ref-02[_» more&period;&period;&period;_]#

Return a reference to a rule


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
link:#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]#link:#boost-urls-grammar-ref-0e[_» more&period;&period;&period;_]#

== Return Value

* The character set as a reference type
* The rule as a reference type

== Template Parameters

[cols=2]
|===
| Name
| Description
| *CharSet*
| The character set type
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *cs*
| The character set to use
| *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#L255[boost&sol;url&sol;grammar&sol;charset&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-CharSet[CharSet] CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 Value

The character set as a reference type

== Template Parameters

[cols=2]
|===
| Name
| Description
| *CharSet*
| The character set type
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *cs*
| The character set to use
|===

Return a reference to a rule

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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;

== Return Value

The rule as a reference type

== Parameters

[cols=2]
|===
| 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#L221[boost&sol;url&sol;grammar&sol;tuple&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-Rule[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 ) ) );
----
== Return Value

The squelched rule

== Parameters

[cols=2]
|===
| Name
| Description
| *r*
| The rule to squelch
|===

== See Also

link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`], link:#boost-urls-grammar-digit_chars[`digit&lowbar;chars`], link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-grammar-tuple_rule[`tuple&lowbar;rule`], link:#boost-urls-grammar-token_rule[`token&lowbar;rule`], link:#boost-urls-decode_view[`decode&lowbar;view`], link:#boost-urls-pct_encoded_rule[`pct&lowbar;encoded&lowbar;rule`], link:#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

[cols=2]
|===
| Name
| Description
| *c*
| The character to convert
|===

== See Also

link:#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

[cols=2]
|===
| Name
| Description
| *c*
| The character to convert
|===

== See Also

link:#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#L79[boost&sol;url&sol;grammar&sol;token&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-CharSet[CharSet] CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
token&lowbar;rule(CS const& cs) noexcept;
----

== Description

If there is no more input, the error code link:#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 link:#boost-urls-grammar-parse-09[`parse`]&period;

[,cpp]
----
system::result< core::string_view > rv = parse( "abcdef", token_rule( alpha_chars ) );
----
== BNF
[,cpp]
----
token     = 1*( ch )
----
== Return Value

The token rule

== Parameters

[cols=2]
|===
| Name
| Description
| *cs*
| The character set to use
|===

== See Also

link:#boost-urls-grammar-alpha_chars[`alpha&lowbar;chars`], link:#boost-urls-grammar-parse-09[`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#L124[boost&sol;url&sol;grammar&sol;tuple&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    link:#boost-urls-grammar-Rule[Rule] R0,
    link:#boost-urls-grammar-Rule[Rule]&period;&period;&period; Rn&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
tuple&lowbar;rule(
    R0 const& r0,
    Rn const&&period;&period;&period; 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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc5234#section-3.1[]

== Return Value

The sequence rule

== Parameters

[cols=2]
|===
| Name
| Description
| *r0*
| The first rule to match
| *rn*
| A list of one or more rules to match
|===

== See Also

link:#boost-urls-grammar-dec_octet_rule[`dec&lowbar;octet&lowbar;rule`], link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`], link:#boost-urls-grammar-parse-09[`parse`], link:#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#L105[boost&sol;url&sol;grammar&sol;variant&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    link:#boost-urls-grammar-Rule[Rule] R0,
    link:#boost-urls-grammar-Rule[Rule]&period;&period;&period; Rn&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
variant&lowbar;rule(
    R0 const& r0,
    Rn const&&period;&period;&period; 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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc5234#section-3.2[]
* https://datatracker.ietf.org/doc/html/rfc7230#section-5.3[]

== Return Value

The variant rule

== Parameters

[cols=2]
|===
| Name
| Description
| *r0*
| The first rule to match
| *rn*
| A list of one or more rules to match
|===

== See Also

link:#boost-urls-absolute_uri_rule[`absolute&lowbar;uri&lowbar;rule`], link:#boost-urls-authority_rule[`authority&lowbar;rule`], link:#boost-urls-grammar-delim_rule-0a[`delim&lowbar;rule`], link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-origin_form_rule[`origin&lowbar;form&lowbar;rule`], link:#boost-urls-url_view[`url&lowbar;view`]&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#L1112[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,
    link:#boost-urls-grammar-string_view_base[string&lowbar;view&lowbar;base] const& s);
----

== Description

Format a string to an output stream

== Return Value

A reference to the output stream, for chaining

== Parameters

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to
| *s*
| The string to write
|===

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#L998[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;

== Return Value

`true` if the strings are equal, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

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#L1017[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 Value

`true` if the strings are not equal, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

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#L1036[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;

== Return Value

`true` if the first string is less than the second, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

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#L1055[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;

== Return Value

`true` if the first string is less than or equal to the second, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

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#L1074[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;

== Return Value

`true` if the first string is greater than the second, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

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#L1093[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;

== Return Value

`true` if the first string is greater than or equal to the second, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *s0*
| The first string
| *s1*
| The second string
|===

The set of all characters

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/all_chars.hpp#L75[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; all&lowbar;chars = all&lowbar;chars&lcub;&rcub;;
----

== Description

== Example
Character sets are used with rules and the functions link:#boost-urls-grammar-find_if[`find&lowbar;if`] and link:#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

link:#boost-urls-grammar-find_if[`find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`parse`], link:#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#L84[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; alnum&lowbar;chars = &lcub;&rcub;;
----

== Description

== Example
Character sets are used with rules and the functions link:#boost-urls-grammar-find_if[`find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[]

== See Also

link:#boost-urls-grammar-find_if[`find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`parse`], link:#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#L81[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; alpha&lowbar;chars = alpha&lowbar;chars&lcub;&rcub;;
----

== Description

== Example
Character sets are used with rules and the functions link:#boost-urls-grammar-find_if[`find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[]

== See Also

link:#boost-urls-grammar-find_if[`find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`parse`], link:#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#L67[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; 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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== See Also

link:#boost-urls-grammar-parse-09[`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#L76[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; digit&lowbar;chars = &lcub;&rcub;;
----

== Description

== Example
Character sets are used with rules and the functions link:#boost-urls-grammar-find_if[`find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[]

== See Also

link:#boost-urls-grammar-find_if[`find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`parse`], link:#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#L97[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; hexdig&lowbar;chars = &lcub;&rcub;;
----

== Description

== Example
Character sets are used with rules and the functions link:#boost-urls-grammar-find_if[`find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[]
* https://datatracker.ietf.org/doc/html/rfc7230#section-1.2[]
* https://datatracker.ietf.org/doc/html/rfc5952#section-2.3[]
* https://datatracker.ietf.org/doc/html/rfc5952#section-4.3[]

== See Also

link:#boost-urls-grammar-find_if[`find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-hexdig_value[`hexdig&lowbar;value`], link:#boost-urls-grammar-parse-09[`parse`], link:#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#L76[boost&sol;url&sol;grammar&sol;vchars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol; vchars = &lcub;&rcub;;
----

== Description

== Example
Character sets are used with rules and the functions link:#boost-urls-grammar-find_if[`find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[]

== See Also

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

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

link:#boost-urls-grammar-is_charset[`is&lowbar;charset`], link:#boost-urls-grammar-find_if[`find&lowbar;if`], link:#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 link:#boost-urls-grammar-parse-09[`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

link:#boost-urls-grammar-parse-09[`parse`], link:#boost-urls-grammar-is_rule[`is&lowbar;rule`]&period;

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-string_token-arg[`arg`] 
| Base class for string tokens, and algorithm parameters
| link:#boost-urls-string_token-is_token[`is&lowbar;token`] 
| Trait to determine if a type is a string token
| link:#boost-urls-string_token-return_string[`return&lowbar;string`] 
| A string token for returning a plain string
|===

== Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-string_token-append_to[`append&lowbar;to`] 
| Create a string token for appending to a plain string
| link:#boost-urls-string_token-assign_to[`assign&lowbar;to`] 
| Create a string token for assigning to a plain string
| link:#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
| link:#boost-urls-string_token-StringToken[`StringToken`] 
| Concept for a string token
|===

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#L130[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;;
----

== Description

This trait returns `true` if `T` is a valid link:#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#L277[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;;
----

== Description

This link:#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 link:#boost-urls-url_view_base[`url&lowbar;view&lowbar;base`] that return decoded strings&period;

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
| link:#boost-urls-string_token-arg-2constructor-06[`arg`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-string_token-arg-2destructor[`&#126;arg`] [.small]#[destructor]# [.small]#[virtual]#
| Virtual destructor
| link:#boost-urls-string_token-arg-operator_assign-08[`operator&equals;`]  [.small]#[deleted]#
| Assignment operators
| link:#boost-urls-string_token-arg-prepare[`prepare`]  [.small]#[virtual]#
| Return a modifiable character buffer
|===

== Description

This abstract interface provides a means for an algorithm to generically obtain a modifiable, contiguous character buffer of prescribed size&period;

A link:#boost-urls-string_token-StringToken[`StringToken`] should be derived from this class&period; As the author of an algorithm using a link:#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;

Constructors

== Synopses

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;`

Default constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-string_token-arg-2constructor-01[arg]() = default;
----

[.small]#link:#boost-urls-string_token-arg-2constructor-01[_» more&period;&period;&period;_]#

Deleted copy constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-string_token-arg-2constructor-05[arg](link:#boost-urls-string_token-arg[arg] const& other) = delete;
----

[.small]#link:#boost-urls-string_token-arg-2constructor-05[_» more&period;&period;&period;_]#

Default move constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-string_token-arg-2constructor-0c[arg](link:#boost-urls-string_token-arg[arg]&& other) = default;
----

[.small]#link:#boost-urls-string_token-arg-2constructor-0c[_» more&period;&period;&period;_]#

Default 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() = default;
----

Deleted copy constructor

== 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"]
----
arg(link:#boost-urls-string_token-arg[arg] const& other) = delete;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

Default move 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"]
----
constexpr
arg(link:#boost-urls-string_token-arg[arg]&& other) = default;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to move construct from
|===

Virtual destructor

== 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
virtual
&#126;arg() = default;
----

Assignment operators

== Synopses

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;`

Deleted copy assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-string_token-arg[arg]&
link:#boost-urls-string_token-arg-operator_assign-01[operator&equals;](link:#boost-urls-string_token-arg[arg] const& other) = delete;
----

[.small]#link:#boost-urls-string_token-arg-operator_assign-01[_» more&period;&period;&period;_]#

Deleted move assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-string_token-arg[arg]&
link:#boost-urls-string_token-arg-operator_assign-0f[operator&equals;](link:#boost-urls-string_token-arg[arg]&& other) = delete;
----

[.small]#link:#boost-urls-string_token-arg-operator_assign-0f[_» more&period;&period;&period;_]#

Deleted copy assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-string_token-arg[arg]&
operator&equals;(link:#boost-urls-string_token-arg[arg] const& other) = delete;
----

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy assign from
|===

Deleted move 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"]
----
link:#boost-urls-string_token-arg[arg]&
operator&equals;(link:#boost-urls-string_token-arg[arg]&& other) = delete;
----

== Return Value

Reference to the current object

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to move assign from
|===

Return a modifiable character buffer

== 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"]
----
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;

== Return Value

A pointer to the buffer

== Parameters

[cols=2]
|===
| Name
| Description
| *n*
| The number of characters needed
|===

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#L332[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;
append&lowbar;to(std::basic&lowbar;string&lt;char, std::char&lowbar;traits&lt;char&gt;, Alloc&gt;& s);
----

== Description

This function creates a link:#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;

== Return Value

A string token

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to append
|===

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#L395[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;
assign&lowbar;to(std::basic&lowbar;string&lt;char, std::char&lowbar;traits&lt;char&gt;, Alloc&gt;& s);
----

== Description

This function creates a link:#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;

== Return Value

A string token

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to assign
|===

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#L464[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;
preserve&lowbar;size(std::basic&lowbar;string&lt;char, std::char&lowbar;traits&lt;char&gt;, Alloc&gt;& s);
----

== Description

This function creates a link:#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;

== Return Value

A string token

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to preserve
|===

Concept for a string token

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/string_token.hpp#L231[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 link:#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 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;;
----

== Description

This class represents a temporary reference to a formatting argument used by the link:#boost-urls-format-06[`format`] function&period;

A link:#boost-urls-format-06[`format`] argument should always be created by passing the argument to be formatted directly to the link:#boost-urls-format-06[`format`] function&period;

Any type that can be formatted into a URL with the link:#boost-urls-format-06[`format`] function is convertible to this type&period;

This includes basic types, types convertible to `core&colon;&colon;string&lowbar;view`, and link:#boost-urls-named_arg[`named&lowbar;arg`]&period;

== See Also

link:#boost-urls-format-06[`format`], link:#boost-urls-format_to-01[`format&lowbar;to`], link:#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;;
----

== Description

This class represents a temporary reference to a named formatting argument used by the link:#boost-urls-format-06[`format`] function&period;

Named arguments should always be created with the link:#boost-urls-arg[`arg`] function&period;

Any type that can be formatted into a URL with the link:#boost-urls-format-06[`format`] function can also be used in a named argument&period; All named arguments are convertible to link:#boost-urls-format_arg[`format&lowbar;arg`] and can be used in the link:#boost-urls-format-06[`format`] function&period;

== See Also

link:#boost-urls-arg[`arg`], link:#boost-urls-format-06[`format`], link:#boost-urls-format_to-01[`format&lowbar;to`], link:#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::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::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&period;&period;&period; Ts&gt;
using variant = boost::variant2::variant&lt;Ts&period;&period;&period;&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;

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
| link:#boost-urls-authority_view-2constructor-05[`authority&lowbar;view`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-authority_view-2destructor[`&#126;authority&lowbar;view`] [.small]#[destructor]# [.small]#[virtual]#
| Destructor
| link:#boost-urls-authority_view-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-authority_view-buffer[`buffer`] 
| Return the complete authority
| link:#boost-urls-authority_view-compare[`compare`] 
| Return the result of comparing this with another authority
| link:#boost-urls-authority_view-data[`data`] 
| Return a pointer to the first character
| link:#boost-urls-authority_view-empty[`empty`] 
| Return true if the authority is empty
| link:#boost-urls-authority_view-encoded_host[`encoded&lowbar;host`] 
| Return the host
| link:#boost-urls-authority_view-encoded_host_address[`encoded&lowbar;host&lowbar;address`] 
| Return the host
| link:#boost-urls-authority_view-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`] 
| Return the host and port
| link:#boost-urls-authority_view-encoded_host_name[`encoded&lowbar;host&lowbar;name`] 
| Return the host name
| link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`] 
| Return the password
| link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`] 
| Return the user
| link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`] 
| Return the userinfo
| link:#boost-urls-authority_view-has_password[`has&lowbar;password`] 
| Return true if a password is present
| link:#boost-urls-authority_view-has_port[`has&lowbar;port`] 
| Return true if a port is present
| link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`] 
| Return true if a userinfo is present
| link:#boost-urls-authority_view-host[`host`] 
| Return the host
| link:#boost-urls-authority_view-host_address[`host&lowbar;address`] 
| Return the host
| link:#boost-urls-authority_view-host_ipv4_address[`host&lowbar;ipv4&lowbar;address`] 
| Return the host IPv4 address
| link:#boost-urls-authority_view-host_ipv6_address[`host&lowbar;ipv6&lowbar;address`] 
| Return the host IPv6 address
| link:#boost-urls-authority_view-host_ipvfuture[`host&lowbar;ipvfuture`] 
| Return the host IPvFuture address
| link:#boost-urls-authority_view-host_name[`host&lowbar;name`] 
| Return the host name
| link:#boost-urls-authority_view-host_type[`host&lowbar;type`] 
| Return the host type
| link:#boost-urls-authority_view-password[`password`] 
| Return the password
| link:#boost-urls-authority_view-port[`port`] 
| Return the port
| link:#boost-urls-authority_view-port_number[`port&lowbar;number`] 
| Return the port
| link:#boost-urls-authority_view-size[`size`] 
| Return the number of characters in the authority
| link:#boost-urls-authority_view-user[`user`] 
| Return the user
| link:#boost-urls-authority_view-userinfo[`userinfo`] 
| Return the userinfo
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-operator_lshift-0d[boost::urls::operator&lt;&lt;]`
| Format the encoded authority to the output stream
| `link:#boost-urls-operator_ge-08[boost::urls::operator&gt;&equals;]`
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized&period;
| `link:#boost-urls-operator_gt-08[boost::urls::operator&gt;]`
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized&period;
| `link:#boost-urls-operator_le-01[boost::urls::operator&lt;&equals;]`
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized&period;
| `link:#boost-urls-operator_lt-0a[boost::urls::operator&lt;]`
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized&period;
| `link:#boost-urls-operator_not_eq-03[boost::urls::operator!&equals;]`
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized&period;
| `link:#boost-urls-operator_eq-092[boost::urls::operator&equals;&equals;]`
| Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized&period;
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-parse_authority[`parse&lowbar;authority`]
| Parse an authority
|===

== 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 link:#boost-urls-parse_authority[`parse&lowbar;authority`] returns a `boost&colon;&colon;system&colon;&colon;result` containing either a valid link:#boost-urls-authority_view-2constructor-05[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== See Also

link:#boost-urls-parse_authority[`parse&lowbar;authority`]&period;

Constructors

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L118[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-authority_view-2constructor-0e[authority&lowbar;view]() noexcept;
----

[.small]#link:#boost-urls-authority_view-2constructor-0e[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-authority_view-2constructor-04[authority&lowbar;view](link:#boost-urls-authority_view[authority&lowbar;view] const& other) noexcept;
----

[.small]#link:#boost-urls-authority_view-2constructor-04[_» more&period;&period;&period;_]#

Construct from a string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
link:#boost-urls-authority_view-2constructor-03[authority&lowbar;view](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-authority_view-2constructor-03[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#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#L118[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
Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L162[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
authority&lowbar;view(link:#boost-urls-authority_view[authority&lowbar;view] const& other) noexcept;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

Construct from a string&period;

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L157[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#boost-urls-parse_authority[`parse&lowbar;authority`]&period;

Destructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L103[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

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

Assignment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L176[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-authority_view[authority&lowbar;view]&
operator&equals;(link:#boost-urls-authority_view[authority&lowbar;view] const& other) noexcept;
----

== Description

This function assigns the contents of `other` to this object&period;

== Exception Safety
Throws nothing&period;

== Return Value

A reference to this object

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to assign
|===

Return the complete authority

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L269[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

The complete authority

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#L1300[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
compare(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&hyphen;1` if `&ast;this &lt; other`, `0` if `this &equals;&equals; other`, and 1 if `this &gt; other`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The authority to compare
|===

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#L239[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 Value

A pointer to the first character

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#L222[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 Value

`true` if the authority is empty

Return the host

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L785[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host

Return the host

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L904[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host address

Return the host and port

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1273[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

The host and port

== See Also

link:#boost-urls-authority_view-has_port[`has&lowbar;port`], link:#boost-urls-authority_view-port[`port`], link:#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#L1115[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]
encoded&lowbar;host&lowbar;name() const noexcept;
----

== Description

If the host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host name

Return the password

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The password

== See Also

link:#boost-urls-authority_view-has_password[`has&lowbar;password`], link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`], link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-authority_view-password[`password`], link:#boost-urls-authority_view-user[`user`], link:#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#L522[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The user

== See Also

link:#boost-urls-authority_view-has_password[`has&lowbar;password`], link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`], link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-authority_view-password[`password`], link:#boost-urls-authority_view-user[`user`], link:#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#L419[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The userinfo

== See Also

link:#boost-urls-authority_view-has_password[`has&lowbar;password`], link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`], link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`], link:#boost-urls-authority_view-password[`password`], link:#boost-urls-authority_view-user[`user`], link:#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#L565[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`true` if a password is present

== See Also

link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`], link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`], link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-authority_view-password[`password`], link:#boost-urls-authority_view-user[`user`], link:#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#L1158[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`true` if a port is present, otherwise `false`

== See Also

link:#boost-urls-authority_view-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`], link:#boost-urls-authority_view-port[`port`], link:#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#L320[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`true` if a userinfo is present

== See Also

link:#boost-urls-authority_view-has_password[`has&lowbar;password`], link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`], link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`], link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-authority_view-password[`password`], link:#boost-urls-authority_view-user[`user`], link:#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#L740[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token to receive the result&period;
|===

Return the host

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L840[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host address

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token to receive the result&period;
|===

Return the host IPv4 address

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L945[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv4_address[ipv4&lowbar;address]
host&lowbar;ipv4&lowbar;address() const noexcept;
----

== Description

If the host type is link:#boost-urls-host_type[`host&lowbar;type&colon;&colon;ipv4`], this function returns the address as a value of type link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host IPv4 address

Return the host IPv6 address

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L994[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv6_address[ipv6&lowbar;address]
host&lowbar;ipv6&lowbar;address() const noexcept;
----

== Description

If the host type is link:#boost-urls-host_type[`host&lowbar;type&colon;&colon;ipv6`], this function returns the address as a value of type link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host IPv6 address

Return the host IPvFuture address

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1028[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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host IPvFuture address

Return the host name

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1068[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::return&lowbar;string]&gt;
StringToken::result&lowbar;type
host&lowbar;name(StringToken&& token);
----

== Description

If the host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host name

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token to receive the result
|===

Return the host type

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L699[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-host_type[urls::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host type

Return the password

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L612[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The password

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token to receive the result&period;
|===

== See Also

link:#boost-urls-authority_view-has_password[`has&lowbar;password`], link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`], link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`], link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-authority_view-user[`user`], link:#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#L1195[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

The port as a string

== See Also

link:#boost-urls-authority_view-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`], link:#boost-urls-authority_view-has_port[`has&lowbar;port`], link:#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#L1232[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

The port number

== See Also

link:#boost-urls-authority_view-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`], link:#boost-urls-authority_view-has_port[`has&lowbar;port`], link:#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#L201[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 Value

The number of characters in the authority

Return the user

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L468[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The user

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token to receive the result&period;
|===

== See Also

link:#boost-urls-authority_view-has_password[`has&lowbar;password`], link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`], link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`], link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-authority_view-password[`password`], link:#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#L366[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The userinfo

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token to receive the result&period;
|===

== See Also

link:#boost-urls-authority_view-has_password[`has&lowbar;password`], link:#boost-urls-authority_view-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-authority_view-encoded_password[`encoded&lowbar;password`], link:#boost-urls-authority_view-encoded_user[`encoded&lowbar;user`], link:#boost-urls-authority_view-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-authority_view-password[`password`], link:#boost-urls-authority_view-user[`user`]&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/decode_view.hpp#L70[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
| link:#boost-urls-decode_view-iterator[`iterator`] 
| An iterator of constant, decoded characters&period;
| link:#boost-urls-decode_view-const_iterator[`const&lowbar;iterator`] 
| An iterator of constant, decoded characters&period;
| link:#boost-urls-decode_view-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-decode_view-difference_type[`difference&lowbar;type`] 
| The signed integer type
| link:#boost-urls-decode_view-reference[`reference`] 
| The reference type
| link:#boost-urls-decode_view-size_type[`size&lowbar;type`] 
| The unsigned integer type
| link:#boost-urls-decode_view-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-decode_view-2constructor-08[`decode&lowbar;view`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-decode_view-back[`back`] 
| Return the last character
| link:#boost-urls-decode_view-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-decode_view-compare-0d[`compare`] 
| Return the result of comparing to another string
| link:#boost-urls-decode_view-empty[`empty`] 
| Return true if the string is empty
| link:#boost-urls-decode_view-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-decode_view-ends_with-08[`ends&lowbar;with`] 
| Checks if the string ends with the given prefix
| link:#boost-urls-decode_view-find[`find`] 
| Finds the first occurrence of character in this view
| link:#boost-urls-decode_view-front[`front`] 
| Return the first character
| link:#boost-urls-decode_view-options[`options`] 
| Return the decoding options
| link:#boost-urls-decode_view-remove_prefix[`remove&lowbar;prefix`] 
| Remove the first characters
| link:#boost-urls-decode_view-remove_suffix[`remove&lowbar;suffix`] 
| Remove the last characters
| link:#boost-urls-decode_view-rfind[`rfind`] 
| Finds the first occurrence of character in this view
| link:#boost-urls-decode_view-size[`size`] 
| Return the number of decoded characters
| link:#boost-urls-decode_view-starts_with-04[`starts&lowbar;with`] 
| Checks if the string begins with the given prefix
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-operator_lshift-034[boost::urls::operator&lt;&lt;]`
| Format the string with percent&hyphen;decoding applied to the output stream
| `link:#boost-urls-operator_ge-09c[boost::urls::operator&gt;&equals;]`
| Compare two decode views for greater than or equal
| `link:#boost-urls-operator_ge-09e[boost::urls::operator&gt;&equals;]`
| Compare two decode views for greater than or equal
| `link:#boost-urls-operator_ge-06[boost::urls::operator&gt;&equals;]`
| Compare two decode views for greater than or equal
| `link:#boost-urls-operator_gt-00[boost::urls::operator&gt;]`
| Compare two decode views for greater than
| `link:#boost-urls-operator_gt-0a[boost::urls::operator&gt;]`
| Compare two decode views for greater than
| `link:#boost-urls-operator_gt-03[boost::urls::operator&gt;]`
| Compare two decode views for greater than
| `link:#boost-urls-operator_le-06[boost::urls::operator&lt;&equals;]`
| Compare two decode views for less than or equal
| `link:#boost-urls-operator_le-0e[boost::urls::operator&lt;&equals;]`
| Compare two decode views for less than or equal
| `link:#boost-urls-operator_le-00[boost::urls::operator&lt;&equals;]`
| Compare two decode views for less than or equal
| `link:#boost-urls-operator_lt-03[boost::urls::operator&lt;]`
| Compare two decode views for less than
| `link:#boost-urls-operator_lt-047[boost::urls::operator&lt;]`
| Compare two decode views for less than
| `link:#boost-urls-operator_lt-051[boost::urls::operator&lt;]`
| Compare two decode views for less than
| `link:#boost-urls-operator_not_eq-0b[boost::urls::operator!&equals;]`
| Compare two decode views for inequality
| `link:#boost-urls-operator_not_eq-06[boost::urls::operator!&equals;]`
| Compare two decode views for inequality
| `link:#boost-urls-operator_not_eq-08[boost::urls::operator!&equals;]`
| Compare two decode views for inequality
| `link:#boost-urls-operator_eq-02[boost::urls::operator&equals;&equals;]`
| Compare two decode views for equality
| `link:#boost-urls-operator_eq-090[boost::urls::operator&equals;&equals;]`
| Compare two decode views for equality
| `link:#boost-urls-operator_eq-091[boost::urls::operator&equals;&equals;]`
| Compare two decode views for equality
|===

== 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#L128[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = link:#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#L107[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#L115[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#L104[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#L111[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#L100[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

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

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#L125[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-decode_view[boost::urls::decode&lowbar;view]`
| A reference to a valid, percent&hyphen;encoded string
|===

== 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;

Constructor

== Synopses

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

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-decode_view-2constructor-07[decode&lowbar;view]() noexcept = default;
----

[.small]#link:#boost-urls-decode_view-2constructor-07[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
link:#boost-urls-decode_view-2constructor-03[decode&lowbar;view](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] s,
    link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt = &lcub;&rcub;) noexcept;
----

[.small]#link:#boost-urls-decode_view-2constructor-03[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| 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#L157[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#L195[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
decode&lowbar;view(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] s,
    link:#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 link:#boost-urls-pct_string_view[`pct&lowbar;string&lowbar;view`] for the first argument can throw exceptions on invalid input&period;

== Parameters

[cols=2]
|===
| 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 the last character

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L339[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

The last decoded character

Return an iterator to the beginning

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L275[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

An iterator to the first decoded character

Return the result of comparing to another string

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L533[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

Return the result of comparing to another string


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
link:#boost-urls-decode_view-compare-01[compare](link:#boost-urls-decode_view[decode&lowbar;view] other) const noexcept;
----

[.small]#link:#boost-urls-decode_view-compare-01[_» more&period;&period;&period;_]#

Return the result of comparing to another string


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
link:#boost-urls-decode_view-compare-02[compare](core::string&lowbar;view other) const noexcept;
----

[.small]#link:#boost-urls-decode_view-compare-02[_» more&period;&period;&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

[cols=2]
|===
| 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#L554[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
int
compare(link:#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

[cols=2]
|===
| 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#L533[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

[cols=2]
|===
| Name
| Description
| *other*
| string to compare
|===

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#L228[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 Value

`true` if the string is empty

Return an iterator to the end

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L293[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-decode_view-iterator[iterator]
end() const noexcept;
----

== Description

== Example
[,cpp]
----
auto it = this->end();
----
== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to one past the last decoded character

Checks if the string ends with the given prefix

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L379[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

Checks if the string ends with the given prefix


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-decode_view-ends_with-04[ends&lowbar;with](core::string&lowbar;view s) const noexcept;
----

[.small]#link:#boost-urls-decode_view-ends_with-04[_» more&period;&period;&period;_]#

Checks if the string ends with the given prefix


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-decode_view-ends_with-0d[ends&lowbar;with](char ch) const noexcept;
----

[.small]#link:#boost-urls-decode_view-ends_with-0d[_» more&period;&period;&period;_]#

== Return Value

* `true` if the decoded string ends with `s`
* `true` if the decoded string ends with `ch`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to search for
| *ch*
| The character to search for
|===

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#L379[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;

== Return Value

`true` if the decoded string ends with `s`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to search for
|===

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#L419[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;

== Return Value

`true` if the decoded string ends with `ch`

== Parameters

[cols=2]
|===
| Name
| Description
| *ch*
| The character to search for
|===

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#L434[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-decode_view-const_iterator[const&lowbar;iterator]
find(char ch) const noexcept;
----

== Description

== Complexity
Linear&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to the first decoded occurrence of `ch` or `end()`

== Parameters

[cols=2]
|===
| Name
| Description
| *ch*
| The character to search for
|===

Return the first character

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L316[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

The first decoded character

Return the decoding options

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L502[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-encoding_opts[encoding&lowbar;opts]
options() const noexcept;
----

== Return Value

The decoding options used by this view

Remove the first characters

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L472[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
remove&lowbar;prefix(link:#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;

== Parameters

[cols=2]
|===
| Name
| Description
| *n*
| The number of characters to remove
|===

Remove the last characters

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
remove&lowbar;suffix(link:#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;

== Parameters

[cols=2]
|===
| Name
| Description
| *n*
| The number of characters to remove
|===

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#L449[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-decode_view-const_iterator[const&lowbar;iterator]
rfind(char ch) const noexcept;
----

== Description

== Complexity
Linear&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to the last occurrence of `ch` or `end()`

== Parameters

[cols=2]
|===
| Name
| Description
| *ch*
| The character to search for
|===

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"]
----
link:#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;

== Return Value

The number of decoded characters

Checks if the string begins with the given prefix

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L359[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

Checks if the string begins with the given prefix


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-decode_view-starts_with-01[starts&lowbar;with](core::string&lowbar;view s) const noexcept;
----

[.small]#link:#boost-urls-decode_view-starts_with-01[_» more&period;&period;&period;_]#

Checks if the string begins with the given prefix


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-decode_view-starts_with-0b[starts&lowbar;with](char ch) const noexcept;
----

[.small]#link:#boost-urls-decode_view-starts_with-0b[_» more&period;&period;&period;_]#

== Return Value

* `true` if the decoded string starts with `s`
* `true` if the decoded string starts with `ch`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to search for
| *ch*
| The character to search for
|===

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#L359[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;

== Return Value

`true` if the decoded string starts with `s`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to search for
|===

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#L399[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;

== Return Value

`true` if the decoded string starts with `ch`

== Parameters

[cols=2]
|===
| Name
| Description
| *ch*
| The character to search for
|===

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
| link:#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
| link:#boost-urls-encoding_opts-disallow_null[`disallow&lowbar;null`] 
| True if nulls are not allowed
| link:#boost-urls-encoding_opts-lower_case[`lower&lowbar;case`] 
| True if hexadecimal digits are emitted as lower case
| link:#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

link:#boost-urls-encode-0d[`encode`], link:#boost-urls-encoded_size[`encoded&lowbar;size`], link:#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#L117[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

[cols=2]
|===
| 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#L109[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#L98[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#L89[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

Although not prescribed by RFC 3986, many applications decode plus signs in URL queries as spaces&period; In particular, the form&hyphen;urlencoded Media Type in HTML for submitting forms uses this convention&period;

This option controls whether the PLUS character (&quot;&plus;&quot;) is used to represent the SP character (&quot; &quot;) when encoding or decoding&period;

When this option is `true`, both the encoded SP (&quot;%20&quot;) and the PLUS character (&quot;&plus;&quot;) represent a space (&quot; &quot;) when decoding&period; To represent a plus sign, its encoded form (&quot;%2B&quot;) is used&period;

The link:#boost-urls-encode-0d[`encode`] and `encode&lowbar;size` functions will encode spaces as plus signs when this option is `true`, regardless of the allowed character set&period; They will also encode plus signs as &quot;%2B&quot; when this option is `true`, regardless of the allowed character set&period;

Note that when a URL is normalized, all unreserved percent&hyphen;encoded characters are replaced with their unreserved equivalents&period; However, normalizing the URL query maintains the decoded and encoded &quot;&amp;&equals;&plus;&quot; as they are because they might have different meanings&period;

This behavior is not optional because normalization can only mitigate false negatives, but it should eliminate false positives&period; Making it optional would allow a false positive because there&apos;s at least one very relevant schema (HTTP) where a decoded or encoded &quot;&amp;&equals;&plus;&quot; has different meanings and represents different resources&period;

The same considerations apply to URL comparison algorithms in the library, as they treat URLs as if they were normalized&period;

== Specification
* https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1[]
* https://datatracker.ietf.org/doc/html/rfc1866#section-8.2.1[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.2[]

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
| link:#boost-urls-ignore_case_param-2constructor-0a[`ignore&lowbar;case&lowbar;param`]         [.small]#[constructor]#
| Constructor
| link:#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 link:#boost-urls-ignore_case[`ignore&lowbar;case`] is passed&period;

== See Also

link:#boost-urls-params_ref[`params&lowbar;ref`]

Constructor

== Synopses

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;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-ignore_case_param-2constructor-03[ignore&lowbar;case&lowbar;param]() noexcept = default;
----

[.small]#link:#boost-urls-ignore_case_param-2constructor-03[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-ignore_case_param-2constructor-00[ignore&lowbar;case&lowbar;param](&sol;&ast; implementation-defined &ast;&sol; value) noexcept;
----

[.small]#link:#boost-urls-ignore_case_param-2constructor-00[_» more&period;&period;&period;_]#

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; value) noexcept;
----

== Description

Construction from link:#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 link:#boost-urls-ignore_case[`ignore&lowbar;case`]&period;

== Example
When link:#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) );
----
== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to construct from
|===

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#L106[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 link:#boost-urls-ignore_case[`ignore&lowbar;case`]&period; Otherwise, they are default&hyphen;constructed and evaluate to `false`&period;

== Return Value

`true` if case should be ignored

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
| link:#boost-urls-ipv4_address-bytes_type[`bytes&lowbar;type`] 
| The type used to represent an address as an array of bytes
| link:#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
| link:#boost-urls-ipv4_address-2constructor-00[`ipv4&lowbar;address`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-ipv4_address-operator_assign[`operator&equals;`] 
| Copy Assignment&period;
| link:#boost-urls-ipv4_address-is_loopback[`is&lowbar;loopback`] 
| Return true if the address is a loopback address
| link:#boost-urls-ipv4_address-is_multicast[`is&lowbar;multicast`] 
| Return true if the address is a multicast address
| link:#boost-urls-ipv4_address-is_unspecified[`is&lowbar;unspecified`] 
| Return true if the address is unspecified
| link:#boost-urls-ipv4_address-to_buffer[`to&lowbar;buffer`] 
| Write a dotted decimal string representing the address to a buffer
| link:#boost-urls-ipv4_address-to_bytes[`to&lowbar;bytes`] 
| Return the address as bytes, in network byte order&period;
| link:#boost-urls-ipv4_address-to_string[`to&lowbar;string`] 
| Return the address as a string in dotted decimal format
| link:#boost-urls-ipv4_address-to_uint[`to&lowbar;uint`] 
| Return the address as an unsigned integer&period;
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-ipv4_address-any[`any`] 
| Return an address object that represents any address
| link:#boost-urls-ipv4_address-broadcast[`broadcast`] 
| Return an address object that represents the broadcast address
| link:#boost-urls-ipv4_address-loopback[`loopback`] 
| Return an address object that represents the loopback address
|===

== Static Data Members

[cols=2]
|===
| Name
| Description
| link:#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
| `link:#boost-urls-ipv6_address[boost::urls::ipv6&lowbar;address]`
| An IP version 6 style address&period;
| `link:#boost-urls-operator_lshift-0a[boost::urls::operator&lt;&lt;]`
| Format the address to an output stream&period;
| `link:#boost-urls-operator_not_eq-02[boost::urls::operator!&equals;]`
| Return true if two addresses are not equal
| `link:#boost-urls-operator_eq-0f2[boost::urls::operator&equals;&equals;]`
| Return true if two addresses are equal
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-parse_ipv4_address[`parse&lowbar;ipv4&lowbar;address`]
| Return an IPv4 address from an IP address string in dotted decimal form
|===

== 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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== See Also

link:#boost-urls-parse_ipv4_address[`parse&lowbar;ipv4&lowbar;address`], link:#boost-urls-ipv6_address[`ipv6&lowbar;address`]&period;

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;
----

Constructors

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L106[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

Constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-ipv4_address-2constructor-0c[ipv4&lowbar;address]() = default;
----

[.small]#link:#boost-urls-ipv4_address-2constructor-0c[_» more&period;&period;&period;_]#

Constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-ipv4_address-2constructor-0d[ipv4&lowbar;address](link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& other) = default;
----

[.small]#link:#boost-urls-ipv4_address-2constructor-0d[_» more&period;&period;&period;_]#

Construct from a string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
link:#boost-urls-ipv4_address-2constructor-08[ipv4&lowbar;address](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-ipv4_address-2constructor-08[_» more&period;&period;&period;_]#

Construct from an unsigned integer&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
link:#boost-urls-ipv4_address-2constructor-06[ipv4&lowbar;address](link:#boost-urls-ipv4_address-uint_type[uint&lowbar;type] u) noexcept;
----

[.small]#link:#boost-urls-ipv4_address-2constructor-06[_» more&period;&period;&period;_]#

Construct from an array of bytes&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
link:#boost-urls-ipv4_address-2constructor-0b[ipv4&lowbar;address](link:#boost-urls-ipv4_address-bytes_type[bytes&lowbar;type] const& bytes) noexcept;
----

[.small]#link:#boost-urls-ipv4_address-2constructor-0b[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input failed to parse correctly&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
| *u*
| The integer to construct from&period;
| *bytes*
| The value to construct from&period;
|===

== See Also

link:#boost-urls-parse_ipv4_address[`parse&lowbar;ipv4&lowbar;address`]&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(link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& other) = default;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

Construct from a string&period;

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L148[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 link:#boost-urls-parse_ipv4_address[`parse&lowbar;ipv4&lowbar;address`]&period;

== Exception Safety
Exceptions thrown on invalid input&period;

== Specification
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input failed to parse correctly&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

== See Also

link:#boost-urls-parse_ipv4_address[`parse&lowbar;ipv4&lowbar;address`]&period;

Construct from an unsigned integer&period;

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L106[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
ipv4&lowbar;address(link:#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

[cols=2]
|===
| 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#L119[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
ipv4&lowbar;address(link:#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

[cols=2]
|===
| Name
| Description
| *bytes*
| The value to construct from&period;
|===

Copy Assignment&period;

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/ipv4_address.hpp#L88[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-ipv4_address[ipv4&lowbar;address]&
operator&equals;(link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& other) = default;
----

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy&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#L233[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;loopback() const noexcept;
----

== Return Value

`true` if the address is a loopback address

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#L249[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;multicast() const noexcept;
----

== Return Value

`true` if the address is a multicast address,

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#L241[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
is&lowbar;unspecified() const noexcept;
----

== Return Value

`true` if the address is unspecified

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#L223[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

[cols=2]
|===
| 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

[cols=2]
|===
| 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#L157[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv4_address-bytes_type[bytes&lowbar;type]
to&lowbar;bytes() const noexcept;
----

== Return Value

The address as an array of bytes&period;

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#L201[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc4291#section-2.2[]

== 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

[cols=2]
|===
| 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#L165[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv4_address-uint_type[uint&lowbar;type]
to&lowbar;uint() const noexcept;
----

== Return Value

The address as an unsigned integer&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#L287[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
link:#boost-urls-ipv4_address[ipv4&lowbar;address]
any() noexcept;
----

== Return Value

The any address&period;

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#L309[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
link:#boost-urls-ipv4_address[ipv4&lowbar;address]
broadcast() noexcept;
----

== Return Value

The broadcast address&period;

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#L298[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
link:#boost-urls-ipv4_address[ipv4&lowbar;address]
loopback() noexcept;
----

== Return Value

The loopback address&period;

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;

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#L62[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
| link:#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
| link:#boost-urls-ipv6_address-2constructor-09[`ipv6&lowbar;address`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-ipv6_address-operator_assign[`operator&equals;`] 
| Copy Assignment
| link:#boost-urls-ipv6_address-is_loopback[`is&lowbar;loopback`] 
| Return true if the address is a loopback address
| link:#boost-urls-ipv6_address-is_unspecified[`is&lowbar;unspecified`] 
| Return true if the address is unspecified
| link:#boost-urls-ipv6_address-is_v4_mapped[`is&lowbar;v4&lowbar;mapped`] 
| Return true if the address is a mapped IPv4 address
| link:#boost-urls-ipv6_address-to_buffer[`to&lowbar;buffer`] 
| Write a dotted decimal string representing the address to a buffer
| link:#boost-urls-ipv6_address-to_bytes[`to&lowbar;bytes`] 
| Return the address as bytes, in network byte order
| link:#boost-urls-ipv6_address-to_string[`to&lowbar;string`] 
| Return the address as a string&period;
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-ipv6_address-loopback[`loopback`] 
| Return an address object that represents the loopback address
|===

== Static Data Members

[cols=2]
|===
| Name
| Description
| link:#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
| `link:#boost-urls-operator_lshift-0f6[boost::urls::operator&lt;&lt;]`
| Format the address to an output stream
| `link:#boost-urls-operator_not_eq-07[boost::urls::operator!&equals;]`
| Return true if two addresses are not equal
| `link:#boost-urls-operator_eq-0fd[boost::urls::operator&equals;&equals;]`
| Return true if two addresses are equal
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-parse_ipv6_address[`parse&lowbar;ipv6&lowbar;address`]
| Parse a string containing an IPv6 address&period;
|===

== 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
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== See Also

link:#boost-urls-ipv4_address[`ipv4&lowbar;address`], link:#boost-urls-parse_ipv6_address[`parse&lowbar;ipv6&lowbar;address`]&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#L87[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;

Constructors

== Synopses

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;`

Constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-ipv6_address-2constructor-04[ipv6&lowbar;address]() = default;
----

[.small]#link:#boost-urls-ipv6_address-2constructor-04[_» more&period;&period;&period;_]#

Constructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-ipv6_address-2constructor-06[ipv6&lowbar;address](link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& other) = default;
----

[.small]#link:#boost-urls-ipv6_address-2constructor-06[_» more&period;&period;&period;_]#

Construct from a string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv6_address-2constructor-00[ipv6&lowbar;address](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-ipv6_address-2constructor-00[_» more&period;&period;&period;_]#

Construct from an array of bytes&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv6_address-2constructor-0f[ipv6&lowbar;address](link:#boost-urls-ipv6_address-bytes_type[bytes&lowbar;type] const& bytes) noexcept;
----

[.small]#link:#boost-urls-ipv6_address-2constructor-0f[_» more&period;&period;&period;_]#

Construct from an IPv4 address&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv6_address-2constructor-08[ipv6&lowbar;address](link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& addr) noexcept;
----

[.small]#link:#boost-urls-ipv6_address-2constructor-08[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input failed to parse correctly&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
| *bytes*
| The value to construct from&period;
| *addr*
| The address to construct from&period;
|===

== See Also

link:#boost-urls-ipv6_address-is_unspecified[`is&lowbar;unspecified`]

link:#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#L101[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;

* https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[]

== See Also

link:#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#L105[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
ipv6&lowbar;address(link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& other) = default;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

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 link:#boost-urls-parse_ipv6_address[`parse&lowbar;ipv6&lowbar;address`]&period;

== Exception Safety
Exceptions thrown on invalid input&period;

== Specification
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input failed to parse correctly&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

== See Also

link:#boost-urls-parse_ipv6_address[`parse&lowbar;ipv6&lowbar;address`]&period;

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(link:#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

[cols=2]
|===
| 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(link:#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
* https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2[]

== Parameters

[cols=2]
|===
| Name
| Description
| *addr*
| The address to construct from&period;
|===

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
link:#boost-urls-ipv6_address[ipv6&lowbar;address]&
operator&equals;(link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& other) = default;
----

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy assign from
|===

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#L281[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
* https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3[]

== Return Value

`true` if the address is a loopback address

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#L265[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
* https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[]

== Return Value

`true` if the address is unspecified

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#L296[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
* https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2[]

== Return Value

`true` if the address is a mapped IPv4 address

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#L247[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

[cols=2]
|===
| 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

[cols=2]
|===
| 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#L177[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv6_address-bytes_type[bytes&lowbar;type]
to&lowbar;bytes() const noexcept;
----

== Return Value

The address as an array of bytes&period;

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#L224[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc4291#section-2.2[]

== 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

[cols=2]
|===
| Name
| Description
| *token*
| An optional string token&period;
|===

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#L342[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
link:#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
* https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3[]

== Return Value

The loopback address&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#L79[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

link:#boost-urls-ipv6_address-to_buffer[`to&lowbar;buffer`]&period;

The type of link:#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
| link:#boost-urls-param-2constructor-04[`param`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-param-operator_assign-0b2[`operator&equals;`] 
| Assignment
| link:#boost-urls-param-operator_ptr[`operator&hyphen;&gt;`] 
| Arrow support
|===

== Data Members

[cols=2]
|===
| Name
| Description
| link:#boost-urls-param-has_value[`has&lowbar;value`] 
| True if a value is present
| link:#boost-urls-param-key[`key`] 
| The key
| link:#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 link:#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
* https://en.wikipedia.org/wiki/Query_string[]

== See Also

link:#boost-urls-param_view[`param&lowbar;view`], link:#boost-urls-param_pct_view[`param&lowbar;pct&lowbar;view`]&period;

Constructors

== Synopses

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;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-param-2constructor-09b[param]() = default;
----

[.small]#link:#boost-urls-param-2constructor-09b[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-param-2constructor-0d[param](link:#boost-urls-param[param] const& other) = default;
----

[.small]#link:#boost-urls-param-2constructor-0d[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param-2constructor-07[param](link:#boost-urls-param[param]&& other) noexcept;
----

[.small]#link:#boost-urls-param-2constructor-07[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
link:#boost-urls-param-2constructor-0b[param](
    core::string&lowbar;view key,
    OptionalString const& value);
----

[.small]#link:#boost-urls-param-2constructor-0b[_» more&period;&period;&period;_]#

Aggregate construction


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param-2constructor-0a[param](
    core::string&lowbar;view key,
    core::string&lowbar;view value,
    bool has&lowbar;value) noexcept;
----

[.small]#link:#boost-urls-param-2constructor-0a[_» more&period;&period;&period;_]#

== Return Value

A reference to this object&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *OptionalString*
| An optional string type, such as `core&colon;&colon;string&lowbar;view`, `std&colon;&colon;nullptr`, link:#boost-urls-no_value_t[`no&lowbar;value&lowbar;t`], or `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to construct from&period;
| *key*
| The key to set&period;
| *value*
| The value to set&period;
| *has&lowbar;value*
| True if a value is present&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#L174[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
param(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L142[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param(link:#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;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L283[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

[cols=2]
|===
| Name
| Description
| *OptionalString*
| An optional string type, such as `core&colon;&colon;string&lowbar;view`, `std&colon;&colon;nullptr`, link:#boost-urls-no_value_t[`no&lowbar;value&lowbar;t`], or `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *key*
| The key to set&period;
| *value*
| The value to set&period;
|===

Aggregate construction

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L356[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;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *key*
| The key to set&period;
| *value*
| The value to set&period;
| *has&lowbar;value*
| True if a value is present&period;
|===

Assignment

== Synopses

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

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-param[param]&
link:#boost-urls-param-operator_assign-0cd[operator&equals;](link:#boost-urls-param[param] const& other) = default;
----

[.small]#link:#boost-urls-param-operator_assign-0cd[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param[param]&
link:#boost-urls-param-operator_assign-0b3[operator&equals;](link:#boost-urls-param[param]&& other) noexcept;
----

[.small]#link:#boost-urls-param-operator_assign-0b3[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param[param]&
link:#boost-urls-param-operator_assign-03[operator&equals;](link:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view] const& other);
----

[.small]#link:#boost-urls-param-operator_assign-03[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param[param]&
link:#boost-urls-param-operator_assign-0cb[operator&equals;](link:#boost-urls-param_view[param&lowbar;view] const& other);
----

[.small]#link:#boost-urls-param-operator_assign-0cb[_» more&period;&period;&period;_]#

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L229[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-param[param]&
operator&equals;(link:#boost-urls-param[param] const& other) = 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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L194[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param[param]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L332[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param[param]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L310[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param[param]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The parameter to copy&period;
|===

Arrow support

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

A pointer to the object&period;

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 link:#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#L674[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
| link:#boost-urls-param_pct_view-2constructor-0d[`param&lowbar;pct&lowbar;view`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-param_pct_view-operator_ptr[`operator&hyphen;&gt;`] 
| Arrow support
| link:#boost-urls-param_pct_view-2conversion-00[`operator param`] 
| Conversion
| link:#boost-urls-param_pct_view-2conversion-0c[`operator param&lowbar;view`] 
| Conversion to param&lowbar;view
|===

== Data Members

[cols=2]
|===
| Name
| Description
| link:#boost-urls-param_pct_view-has_value[`has&lowbar;value`] 
| True if a value is present
| link:#boost-urls-param_pct_view-key[`key`] 
| The key
| link:#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 link:#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
* https://en.wikipedia.org/wiki/Query_string[]

== See Also

link:#boost-urls-param[`param`], link:#boost-urls-param_view[`param&lowbar;view`]&period;

Constructors

== Synopses

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

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-param_pct_view-2constructor-00[param&lowbar;pct&lowbar;view]() = default;
----

[.small]#link:#boost-urls-param_pct_view-2constructor-00[_» more&period;&period;&period;_]#

Construction


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
link:#boost-urls-param_pct_view-2constructor-03[param&lowbar;pct&lowbar;view](link:#boost-urls-param_view[param&lowbar;view] const& p);
----

[.small]#link:#boost-urls-param_pct_view-2constructor-03[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param_pct_view-2constructor-0e[param&lowbar;pct&lowbar;view](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] value) noexcept;
----

[.small]#link:#boost-urls-param_pct_view-2constructor-0e[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
link:#boost-urls-param_pct_view-2constructor-05[param&lowbar;pct&lowbar;view](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    OptionalString const& value);
----

[.small]#link:#boost-urls-param_pct_view-2constructor-05[_» more&period;&period;&period;_]#

Aggregate construction


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param_pct_view-2constructor-02[param&lowbar;pct&lowbar;view](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] value,
    bool has&lowbar;value) noexcept;
----

[.small]#link:#boost-urls-param_pct_view-2constructor-02[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` or `value` contains an invalid percent escape&period;
|===

== Return Value

A param object

== Template Parameters

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *p*
| The param to construct from&period;
| *key*
| The key to set&period;
| *value*
| The value to set&period;
| *has&lowbar;value*
| True if a value is present
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L725[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;

Construction

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
param&lowbar;pct&lowbar;view(link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` or `value` contains an invalid percent escape&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L762[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param&lowbar;pct&lowbar;view(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` or `value` contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *key*
| The key to set&period;
| *value*
| The value to set&period;
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L814[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(
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` or `value` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

A param object

== Template Parameters

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *key*
| The key to set&period;
| *value*
| The optional value to set&period;
|===

Aggregate construction

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param&lowbar;pct&lowbar;view(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] value,
    bool has&lowbar;value) noexcept;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *key*
| The key
| *value*
| The value
| *has&lowbar;value*
| True if a value is present
|===

Arrow support

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

A pointer to this object

Conversion

== 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"]
----
explicit
operator link:#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;

== Return Value

A param object

Conversion to param&lowbar;view

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#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;

== Return Value

A param&lowbar;view object

True if a value is present

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L700[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#L684[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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#L692[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] value;
----

== Description

The presence of a value is indicated by link:#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#L427[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
| link:#boost-urls-param_view-2constructor-0e[`param&lowbar;view`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-param_view-operator_ptr[`operator&hyphen;&gt;`] 
| Arrow support
| link:#boost-urls-param_view-2conversion[`operator param`] 
| Conversion
|===

== Data Members

[cols=2]
|===
| Name
| Description
| link:#boost-urls-param_view-has_value[`has&lowbar;value`] 
| True if a value is present
| link:#boost-urls-param_view-key[`key`] 
| The key
| link:#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 link:#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; Some functions and objects might expect encoded strings in this view, while others expect decoded strings&period; The caller should be aware of the context in which the object will be used&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
* https://en.wikipedia.org/wiki/Query_string[]

== See Also

link:#boost-urls-param[`param`], link:#boost-urls-param_pct_view[`param&lowbar;pct&lowbar;view`]&period;

Constructors

== Synopses

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

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-param_view-2constructor-07a[param&lowbar;view]() = default;
----

[.small]#link:#boost-urls-param_view-2constructor-07a[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param_view-2constructor-07e[param&lowbar;view](link:#boost-urls-param[param] const& other) noexcept;
----

[.small]#link:#boost-urls-param_view-2constructor-07e[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class OptionalString&gt;
link:#boost-urls-param_view-2constructor-01[param&lowbar;view](
    core::string&lowbar;view key,
    OptionalString const& value) noexcept;
----

[.small]#link:#boost-urls-param_view-2constructor-01[_» more&period;&period;&period;_]#

Aggregate construction


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-param_view-2constructor-035[param&lowbar;view](
    core::string&lowbar;view key&lowbar;,
    core::string&lowbar;view value&lowbar;,
    bool has&lowbar;value&lowbar;) noexcept;
----

[.small]#link:#boost-urls-param_view-2constructor-035[_» more&period;&period;&period;_]#

== Template Parameters

[cols=2]
|===
| Name
| Description
| *OptionalString*
| An optional string type, such as `core&colon;&colon;string&lowbar;view`, `std&colon;&colon;nullptr`, link:#boost-urls-no_value_t[`no&lowbar;value&lowbar;t`], or `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The param to reference
| *key*
| The key to set&period;
| *value*
| The value to set&period;
| *key&lowbar;*
| The key to set&period;
| *value&lowbar;*
| The value to set&period;
| *has&lowbar;value&lowbar;*
| True if a value is present&period;
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L478[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#L555[boost&sol;url&sol;param&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
param&lowbar;view(link:#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

[cols=2]
|===
| Name
| Description
| *other*
| The param to reference
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L517[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

[cols=2]
|===
| Name
| Description
| *OptionalString*
| An optional string type, such as `core&colon;&colon;string&lowbar;view`, `std&colon;&colon;nullptr`, link:#boost-urls-no_value_t[`no&lowbar;value&lowbar;t`], or `optional&lt;core&colon;&colon;string&lowbar;view&gt;`&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *key*
| The key to set&period;
| *value*
| The value to set&period;
|===

Aggregate construction

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L607[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;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *key&lowbar;*
| The key to set&period;
| *value&lowbar;*
| The value to set&period;
| *has&lowbar;value&lowbar;*
| True if a value is present&period;
|===

Arrow support

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

A pointer to the object&period;

Conversion

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
operator link:#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;

== Return Value

A new query parameter&period;

True if a value is present

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/param.hpp#L453[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#L437[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#L445[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 link:#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 query parameter containers

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L48[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
| link:#boost-urls-params_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-params_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-params_base-reference[`reference`] 
| The reference type
| link:#boost-urls-params_base-size_type[`size&lowbar;type`] 
| An unsigned integer type to represent sizes&period;
| link:#boost-urls-params_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-params_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-params_base-contains[`contains`] 
| Return true if a matching key exists
| link:#boost-urls-params_base-count[`count`] 
| Return the number of matching keys
| link:#boost-urls-params_base-empty[`empty`] 
| Return true if there are no params
| link:#boost-urls-params_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-params_base-find-0f[`find`] 
| Find a matching key
| link:#boost-urls-params_base-find_last-04b[`find&lowbar;last`] 
| Find a matching key
| link:#boost-urls-params_base-size[`size`] 
| Return the number of params
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_view[boost::urls::params&lowbar;view]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_ref[boost::urls::params&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_ref[`params&lowbar;ref`]
| A view representing query parameters in a URL
| link:#boost-urls-params_view[`params&lowbar;view`]
| A view representing query parameters in a URL
|===

== Description

The library uses this base class to provide common member functions for containers of query parameters&period;

This class should not 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#L100[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = link:#boost-urls-params_base[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;

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#L129[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = link:#boost-urls-param[param];
----

== Description

This is the type of value returned when iterators of the view are dereferenced&period;

== See Also

link:#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#L137[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#L126[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = link:#boost-urls-param[param];
----

== Description

This is the type of value returned when iterators of the view are dereferenced&period;

== See Also

link:#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#L133[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#L116[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = link:#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

link:#boost-urls-param[`param`]&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#L233[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
begin() const noexcept;
----

== Description

== Complexity
Linear in the size of the first param&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to the beginning&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#L184[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

The buffer&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#L281[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
contains(
    core::string&lowbar;view key,
    link:#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;

== Return Value

`true` if a matching key exists&period;

== Parameters

[cols=2]
|===
| 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 link:#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#L317[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,
    link:#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;

== Return Value

The number of matching keys&period;

== Parameters

[cols=2]
|===
| 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 link:#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#L202[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 Value

`true` if there are no params&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#L246[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
end() const noexcept;
----

== Description

== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to the end&period;

Find a matching key

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L362[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_base-find-09[find](
    core::string&lowbar;view key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_base-find-09[_» more&period;&period;&period;_]#

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_base-find-04[find](
    link:#boost-urls-params_base[iterator] from,
    core::string&lowbar;view key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_base-find-04[_» more&period;&period;&period;_]#

== Return Value

an iterator to the param

== Parameters

[cols=2]
|===
| 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 link:#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#L362[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
find(
    core::string&lowbar;view key,
    link:#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

[cols=2]
|===
| 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 link:#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#L407[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
find(
    link:#boost-urls-params_base[iterator] from,
    core::string&lowbar;view key,
    link:#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

[cols=2]
|===
| 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 link:#boost-urls-ignore_case[`ignore&lowbar;case`] is passed here, the comparison is case&hyphen;insensitive&period;
|===

Find a matching key

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L448[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_base-find_last-04f[find&lowbar;last](
    core::string&lowbar;view key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_base-find_last-04f[_» more&period;&period;&period;_]#

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_base-find_last-0d[find&lowbar;last](
    link:#boost-urls-params_base[iterator] before,
    core::string&lowbar;view key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_base-find_last-0d[_» more&period;&period;&period;_]#

== Return Value

an iterator to the param

== Parameters

[cols=2]
|===
| 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 link:#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#L448[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
find&lowbar;last(
    core::string&lowbar;view key,
    link:#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

[cols=2]
|===
| 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 link:#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#L494[boost&sol;url&sol;params&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
find&lowbar;last(
    link:#boost-urls-params_base[iterator] before,
    core::string&lowbar;view key,
    link:#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

[cols=2]
|===
| 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 link:#boost-urls-ignore_case[`ignore&lowbar;case`] is passed here, the comparison is case&hyphen;insensitive&period;
|===

Return the number of params

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L220[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;

== Return Value

The number of params&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#L156[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 Value

The maximum number of characters possible&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
| link:#boost-urls-params_encoded_base-iterator[`iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_encoded_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_encoded_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-params_encoded_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-params_encoded_base-reference[`reference`] 
| The reference type
| link:#boost-urls-params_encoded_base-size_type[`size&lowbar;type`] 
| An unsigned integer type to represent sizes&period;
| link:#boost-urls-params_encoded_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-params_encoded_base-buffer[`buffer`] 
| Return the query corresponding to these params
| link:#boost-urls-params_encoded_base-contains[`contains`] 
| Return true if a matching key exists
| link:#boost-urls-params_encoded_base-count[`count`] 
| Return the number of matching keys
| link:#boost-urls-params_encoded_base-empty[`empty`] 
| Return true if there are no params
| link:#boost-urls-params_encoded_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-params_encoded_base-find-0c[`find`] 
| Find a matching key
| link:#boost-urls-params_encoded_base-find_last-0b[`find&lowbar;last`] 
| Find a matching key
| link:#boost-urls-params_encoded_base-size[`size`] 
| Return the number of params
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_encoded_view[boost::urls::params&lowbar;encoded&lowbar;view]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_encoded_ref[boost::urls::params&lowbar;encoded&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_ref[`params&lowbar;encoded&lowbar;ref`]
| A view representing query parameters in a URL
| link:#boost-urls-params_encoded_view[`params&lowbar;encoded&lowbar;view`]
| A view representing query parameters in a 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
* `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#L80[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = link:#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#L109[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = link:#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

link:#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#L117[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#L106[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = link:#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

link:#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#L113[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#L96[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using value&lowbar;type = link:#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

link:#boost-urls-param[`param`]&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#L77[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----

== Friends

[cols=2]
|===
| Name
| Description
| `boost::urls::operator!&equals;`
| 
| `boost::urls::operator&equals;&equals;`
| 
| `link:#boost-urls-params_encoded_ref[boost::urls::params&lowbar;encoded&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_encoded_base[boost::urls::params&lowbar;encoded&lowbar;base]`
| Common functionality for containers
|===

== 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#L226[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

An iterator to the beginning&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#L177[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

The query string&period;

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#L278[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
contains(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`true` if a matching key exists&period;

== Parameters

[cols=2]
|===
| 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 link:#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#L317[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
count(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

The number of matching keys&period;

== Parameters

[cols=2]
|===
| 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 link:#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#L195[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 Value

`true` if there are no params&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#L239[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
end() const noexcept;
----

== Description

== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to the end&period;

Find a matching key

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L369[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_base-find-03[find](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_encoded_base-find-03[_» more&period;&period;&period;_]#

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_base-find-00[find](
    link:#boost-urls-params_encoded_base-iterator[iterator] from,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_encoded_base-find-00[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

an iterator to the param

== Parameters

[cols=2]
|===
| 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 link:#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#L369[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
find(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

an iterator to the param

== Parameters

[cols=2]
|===
| 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 link:#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#L421[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
find(
    link:#boost-urls-params_encoded_base-iterator[iterator] from,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

an iterator to the param

== Parameters

[cols=2]
|===
| 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 link:#boost-urls-ignore_case[`ignore&lowbar;case`] is passed here, the comparison is case&hyphen;insensitive&period;
|===

Find a matching key

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_base.hpp#L469[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_base-find_last-05[find&lowbar;last](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_encoded_base-find_last-05[_» more&period;&period;&period;_]#

Find a matching key


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_base-find_last-0d[find&lowbar;last](
    link:#boost-urls-params_encoded_base-iterator[iterator] before,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) const noexcept;
----

[.small]#link:#boost-urls-params_encoded_base-find_last-0d[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

an iterator to the param

== Parameters

[cols=2]
|===
| 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 link:#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#L469[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
find&lowbar;last(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `key` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

an iterator to the param

== Parameters

[cols=2]
|===
| 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 link:#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#L516[boost&sol;url&sol;params&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
find&lowbar;last(
    link:#boost-urls-params_encoded_base-iterator[iterator] before,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| 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 link:#boost-urls-ignore_case[`ignore&lowbar;case`] is passed here, the comparison is case&hyphen;insensitive&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#L213[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;

== Return Value

The number of params&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#L136[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 Value

The maximum number of characters possible&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 link:#boost-urls-params_encoded_base[params&lowbar;encoded&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_encoded_base[params&lowbar;encoded&lowbar;base]`
| Common functionality for containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_base-iterator[`iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_encoded_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_encoded_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-params_encoded_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-params_encoded_base-reference[`reference`] 
| The reference type
| link:#boost-urls-params_encoded_base-size_type[`size&lowbar;type`] 
| An unsigned integer type to represent sizes&period;
| link:#boost-urls-params_encoded_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_ref-2constructor-01[`params&lowbar;encoded&lowbar;ref`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-params_encoded_ref-operator_assign-01[`operator&equals;`] 
| Assignment
| link:#boost-urls-params_encoded_ref-append-09[`append`] 
| Append params
| link:#boost-urls-params_encoded_ref-assign-05[`assign`] 
| Assign params
| link:#boost-urls-params_encoded_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-params_encoded_base-buffer[`buffer`] 
| Return the query corresponding to these params
| link:#boost-urls-params_encoded_ref-clear[`clear`] 
| Clear the contents of the container
| link:#boost-urls-params_encoded_base-contains[`contains`] 
| Return true if a matching key exists
| link:#boost-urls-params_encoded_base-count[`count`] 
| Return the number of matching keys
| link:#boost-urls-params_encoded_base-empty[`empty`] 
| Return true if there are no params
| link:#boost-urls-params_encoded_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-params_encoded_ref-erase-03[`erase`] 
| Erase params
| link:#boost-urls-params_encoded_base-find-0c[`find`] 
| Find a matching key
| link:#boost-urls-params_encoded_base-find_last-0b[`find&lowbar;last`] 
| Find a matching key
| link:#boost-urls-params_encoded_ref-insert-0e[`insert`] 
| Insert params
| link:#boost-urls-params_encoded_ref-replace-01[`replace`] 
| Replace params
| link:#boost-urls-params_encoded_ref-set-06[`set`] 
| Set a value
| link:#boost-urls-params_encoded_base-size[`size`] 
| Return the number of params
| link:#boost-urls-params_encoded_ref-unset[`unset`] 
| Remove the value on an element
| link:#boost-urls-params_encoded_ref-url[`url`] 
| Return the referenced url
| link:#boost-urls-params_encoded_ref-2conversion[`operator params&lowbar;encoded&lowbar;view`] 
| Conversion
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-url_base[boost::urls::url&lowbar;base]`
| Common functionality for containers
|===

== 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 link:#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;

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(link:#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

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

Assignment

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L143[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_ref[params&lowbar;encoded&lowbar;ref]&
link:#boost-urls-params_encoded_ref-operator_assign-02[operator&equals;](link:#boost-urls-params_encoded_ref[params&lowbar;encoded&lowbar;ref] const& other);
----

[.small]#link:#boost-urls-params_encoded_ref-operator_assign-02[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_ref[params&lowbar;encoded&lowbar;ref]&
link:#boost-urls-params_encoded_ref-operator_assign-03[operator&equals;](std::initializer&lowbar;list&lt;param&lowbar;pct&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_encoded_ref-operator_assign-03[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| 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#L143[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_ref[params&lowbar;encoded&lowbar;ref]&
operator&equals;(link:#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;

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| 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#L181[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_ref[params&lowbar;encoded&lowbar;ref]&
operator&equals;(std::initializer&lowbar;list&lt;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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of params to assign&period;
|===

Append params

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L368[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Append params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-append-0e[append](std::initializer&lowbar;list&lt;param&lowbar;pct&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_encoded_ref-append-0e[_» more&period;&period;&period;_]#

Append params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-append-07[append](link:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view] const& p);
----

[.small]#link:#boost-urls-params_encoded_ref-append-07[_» more&period;&period;&period;_]#

Append params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-append-08[append](
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_encoded_ref-append-08[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* An iterator to the first new element&period;
* An iterator to the new element&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of params to append&period;
| *p*
| The param to append&period;
| *first*
| The first element to append&period;
| *last*
| One past the last element to append&period;
|===

Append params

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L402[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
append(std::initializer&lowbar;list&lt;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

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *init*
| The list 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#L368[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
append(link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

An iterator to the new element&period;

== Parameters

[cols=2]
|===
| 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#L442[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#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

[cols=2]
|===
| 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;
* An iterator to the first new element&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *first*
| The first element to append&period;
| *last*
| One past the last element to append&period;
|===

Assign params

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L295[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Assign params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
link:#boost-urls-params_encoded_ref-assign-00[assign](std::initializer&lowbar;list&lt;param&lowbar;pct&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_encoded_ref-assign-00[_» more&period;&period;&period;_]#

Assign params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
link:#boost-urls-params_encoded_ref-assign-07[assign](
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_encoded_ref-assign-07[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of params to assign&period;
| *first*
| The first element to assign&period;
| *last*
| One past the last element to assign&period;
|===

Assign params

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L295[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;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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list 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#L333[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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *first*
| The first element to assign&period;
| *last*
| One past the last element 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#L256[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

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L605[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Erase params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-erase-08[erase](link:#boost-urls-params_encoded_base-iterator[iterator] pos) noexcept;
----

[.small]#link:#boost-urls-params_encoded_ref-erase-08[_» more&period;&period;&period;_]#

Erase params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-erase-0b[erase](
    link:#boost-urls-params_encoded_base-iterator[iterator] first,
    link:#boost-urls-params_encoded_base-iterator[iterator] last) noexcept;
----

[.small]#link:#boost-urls-params_encoded_ref-erase-0b[_» more&period;&period;&period;_]#

Erase params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
link:#boost-urls-params_encoded_ref-erase-00[erase](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) noexcept;
----

[.small]#link:#boost-urls-params_encoded_ref-erase-00[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| 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;
* An iterator to one past the removed range&period;
* An iterator to one past the removed range&period;
* The number of params removed from the container&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *pos*
| An iterator to the element&period;
| *first*
| The first element to remove&period;
| *last*
| One past the last element to remove&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 link:#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#L605[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
erase(link:#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

[cols=2]
|===
| 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#L630[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
erase(
    link:#boost-urls-params_encoded_base-iterator[iterator] first,
    link:#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;
* An iterator to one past the removed range&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *first*
| The first element to remove&period;
| *last*
| One past the last element to remove&period;
|===

Erase params

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L666[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
erase(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#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

[cols=2]
|===
| 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

[cols=2]
|===
| 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 link:#boost-urls-ignore_case[`ignore&lowbar;case`] is passed here, the comparison is case&hyphen;insensitive&period;
|===

Insert params

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L478[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Insert params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-insert-0b[insert](
    link:#boost-urls-params_encoded_base-iterator[iterator] before,
    std::initializer&lowbar;list&lt;param&lowbar;pct&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_encoded_ref-insert-0b[_» more&period;&period;&period;_]#

Insert params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-insert-03[insert](
    link:#boost-urls-params_encoded_base-iterator[iterator] before,
    link:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view] const& p);
----

[.small]#link:#boost-urls-params_encoded_ref-insert-03[_» more&period;&period;&period;_]#

Insert params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-insert-05[insert](
    link:#boost-urls-params_encoded_base-iterator[iterator] before,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_encoded_ref-insert-05[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| 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;
* An iterator to the inserted element&period;
* An iterator to the first element inserted, or `before` if `first &equals;&equals; last`&period;
* An iterator to the first element inserted&period;

== Parameters

[cols=2]
|===
| 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;
| *p*
| The param to insert&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Insert params

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L519[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
insert(
    link:#boost-urls-params_encoded_base-iterator[iterator] before,
    std::initializer&lowbar;list&lt;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

[cols=2]
|===
| 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

[cols=2]
|===
| 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;
|===

Insert params

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L478[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
insert(
    link:#boost-urls-params_encoded_base-iterator[iterator] before,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

An iterator to the inserted element&period;

== Parameters

[cols=2]
|===
| 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#L567[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_encoded_base-iterator[iterator]
insert(
    link:#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

[cols=2]
|===
| 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;
* An iterator to the first element inserted&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *before*
| An iterator before which the element is inserted&period; This may be equal to `end()`&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Replace params

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L714[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Replace params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-replace-0f[replace](
    link:#boost-urls-params_encoded_base-iterator[iterator] pos,
    link:#boost-urls-param_pct_view[param&lowbar;pct&lowbar;view] const& p);
----

[.small]#link:#boost-urls-params_encoded_ref-replace-0f[_» more&period;&period;&period;_]#

Replace params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-replace-08[replace](
    link:#boost-urls-params_encoded_base-iterator[iterator] from,
    link:#boost-urls-params_encoded_base-iterator[iterator] to,
    std::initializer&lowbar;list&lt;param&lowbar;pct&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_encoded_ref-replace-08[_» more&period;&period;&period;_]#

Replace params


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-replace-06[replace](
    link:#boost-urls-params_encoded_base-iterator[iterator] from,
    link:#boost-urls-params_encoded_base-iterator[iterator] to,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_encoded_ref-replace-06[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* An iterator to the element&period;
* An iterator to the first element inserted, or one past `to` if `init&period;size() &equals;&equals; 0`&period;
* An iterator to the first element inserted, or one past `to` if `first &equals;&equals; last`&period;
* An iterator to the first element inserted, or one past `to` if `first &equals;&equals; last`&period;

== Parameters

[cols=2]
|===
| 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;
| *from*
| The first element to replace&period;
| *to*
| One past the last element to replace&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Replace params

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L714[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
replace(
    link:#boost-urls-params_encoded_base-iterator[iterator] pos,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

An iterator to the element&period;

== Parameters

[cols=2]
|===
| 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#L754[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
replace(
    link:#boost-urls-params_encoded_base-iterator[iterator] from,
    link:#boost-urls-params_encoded_base-iterator[iterator] to,
    std::initializer&lowbar;list&lt;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

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *from,to*
| The range of params to replace&period;
| *init*
| The list 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#L802[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_encoded_base-iterator[iterator]
replace(
    link:#boost-urls-params_encoded_base-iterator[iterator] from,
    link:#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

[cols=2]
|===
| 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;
* An iterator to the first element inserted, or one past `to` if `first &equals;&equals; last`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *from*
| The first element to replace&period;
| *to*
| One past the last element to replace&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Set a value

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L889[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Set a value


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-set-0d[set](
    link:#boost-urls-params_encoded_base-iterator[iterator] pos,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] value);
----

[.small]#link:#boost-urls-params_encoded_ref-set-0d[_» more&period;&period;&period;_]#

Set a value


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
link:#boost-urls-params_encoded_ref-set-07[set](
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] value,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;);
----

[.small]#link:#boost-urls-params_encoded_ref-set-07[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `value` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* An iterator to the element&period;
* An iterator to the appended or modified element&period;

== Parameters

[cols=2]
|===
| 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 link:#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#L889[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
set(
    link:#boost-urls-params_encoded_base-iterator[iterator] pos,
    link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `value` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

An iterator to the element&period;

== Parameters

[cols=2]
|===
| 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#L961[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
set(
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] key,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] value,
    link:#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

[cols=2]
|===
| 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

[cols=2]
|===
| 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 link:#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#L842[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_base-iterator[iterator]
unset(link:#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

[cols=2]
|===
| 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#L223[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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.
----
== Return Value

A reference to the url&period;

Conversion

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L195[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#boost-urls-params_encoded_view[params&lowbar;encoded&lowbar;view]() const noexcept;
----

== Description

== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

A view of the params&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_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 link:#boost-urls-params_encoded_base[params&lowbar;encoded&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_encoded_base[params&lowbar;encoded&lowbar;base]`
| Common functionality for containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_base-iterator[`iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_encoded_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_encoded_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-params_encoded_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-params_encoded_base-reference[`reference`] 
| The reference type
| link:#boost-urls-params_encoded_base-size_type[`size&lowbar;type`] 
| An unsigned integer type to represent sizes&period;
| link:#boost-urls-params_encoded_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_view-2constructor-0b[`params&lowbar;encoded&lowbar;view`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-params_encoded_view-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-params_encoded_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-params_encoded_base-buffer[`buffer`] 
| Return the query corresponding to these params
| link:#boost-urls-params_encoded_base-contains[`contains`] 
| Return true if a matching key exists
| link:#boost-urls-params_encoded_base-count[`count`] 
| Return the number of matching keys
| link:#boost-urls-params_encoded_base-empty[`empty`] 
| Return true if there are no params
| link:#boost-urls-params_encoded_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-params_encoded_base-find-0c[`find`] 
| Find a matching key
| link:#boost-urls-params_encoded_base-find_last-0b[`find&lowbar;last`] 
| Find a matching key
| link:#boost-urls-params_encoded_base-size[`size`] 
| Return the number of params
| link:#boost-urls-params_encoded_view-2conversion[`operator params&lowbar;view`] 
| Conversion
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_encoded_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-parse_query[boost::urls::parse&lowbar;query]`
| Parse a string and return an encoded params view
| `link:#boost-urls-params_encoded_ref[boost::urls::params&lowbar;encoded&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_view[boost::urls::params&lowbar;view]`
| A view representing query parameters in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== 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 link:#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;

Constructor

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L171[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-params_encoded_view-2constructor-02[params&lowbar;encoded&lowbar;view]() = default;
----

[.small]#link:#boost-urls-params_encoded_view-2constructor-02[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-params_encoded_view-2constructor-06[params&lowbar;encoded&lowbar;view](link:#boost-urls-params_encoded_view[params&lowbar;encoded&lowbar;view] const& other) = default;
----

[.small]#link:#boost-urls-params_encoded_view-2constructor-06[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_view-2constructor-0c[params&lowbar;encoded&lowbar;view](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-params_encoded_view-2constructor-0c[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid query parameter string&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy
| *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#L116[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(link:#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

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L171[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid query parameter string&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

Assignment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L199[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-params_encoded_view[params&lowbar;encoded&lowbar;view]&
operator&equals;(link:#boost-urls-params_encoded_view[params&lowbar;encoded&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

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to assign
|===

Conversion

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L234[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#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

== Return Value

A new view with percent escapes decoded&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_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 link:#boost-urls-params_base[params&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_base[params&lowbar;base]`
| Common functionality for query parameter containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_ref-iterator[`iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-params_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-params_base-reference[`reference`] 
| The reference type
| link:#boost-urls-params_base-size_type[`size&lowbar;type`] 
| An unsigned integer type to represent sizes&period;
| link:#boost-urls-params_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_ref-2constructor-0e[`params&lowbar;ref`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-params_ref-operator_assign-0b[`operator&equals;`] 
| Assignment
| link:#boost-urls-params_ref-append-00[`append`] 
| Append elements
| link:#boost-urls-params_ref-assign-05[`assign`] 
| Assign elements
| link:#boost-urls-params_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-params_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-params_ref-clear[`clear`] 
| Clear the contents of the container
| link:#boost-urls-params_base-contains[`contains`] 
| Return true if a matching key exists
| link:#boost-urls-params_base-count[`count`] 
| Return the number of matching keys
| link:#boost-urls-params_base-empty[`empty`] 
| Return true if there are no params
| link:#boost-urls-params_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-params_ref-erase-0fb[`erase`] 
| Erase elements
| link:#boost-urls-params_base-find-0f[`find`] 
| Find a matching key
| link:#boost-urls-params_base-find_last-04b[`find&lowbar;last`] 
| Find a matching key
| link:#boost-urls-params_ref-insert-0d[`insert`] 
| Insert elements
| link:#boost-urls-params_ref-replace-09[`replace`] 
| Replace elements
| link:#boost-urls-params_ref-set-0f[`set`] 
| Set a value
| link:#boost-urls-params_base-size[`size`] 
| Return the number of params
| link:#boost-urls-params_ref-unset[`unset`] 
| Remove the value on an element
| link:#boost-urls-params_ref-url[`url`] 
| Return the referenced url
| link:#boost-urls-params_ref-2conversion[`operator params&lowbar;view`] 
| Conversion
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-url_base[boost::urls::url&lowbar;base]`
| Common functionality for containers
|===

== 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;

A Bidirectional iterator to a query parameter

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/impl/params_base.hpp#L22[boost&sol;url&sol;impl&sol;params&lowbar;base&period;hpp]&gt;`

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

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_ref[boost::urls::params&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_base[boost::urls::params&lowbar;base]`
| Common functionality for query parameter containers
|===

== 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;

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;

Constructor

== Synopses

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;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-params_ref-2constructor-0b[params&lowbar;ref](link:#boost-urls-params_ref[params&lowbar;ref] const& other) = default;
----

[.small]#link:#boost-urls-params_ref-2constructor-0b[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref-2constructor-09[params&lowbar;ref](
    link:#boost-urls-params_ref[params&lowbar;ref] const& other,
    link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt) noexcept;
----

[.small]#link:#boost-urls-params_ref-2constructor-09[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| 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(link:#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

[cols=2]
|===
| 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(
    link:#boost-urls-params_ref[params&lowbar;ref] const& other,
    link:#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 link:#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

[cols=2]
|===
| 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;
|===

Assignment

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L185[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref[params&lowbar;ref]&
link:#boost-urls-params_ref-operator_assign-0c[operator&equals;](link:#boost-urls-params_ref[params&lowbar;ref] const& other);
----

[.small]#link:#boost-urls-params_ref-operator_assign-0c[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref[params&lowbar;ref]&
link:#boost-urls-params_ref-operator_assign-03[operator&equals;](std::initializer&lowbar;list&lt;param&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_ref-operator_assign-03[_» more&period;&period;&period;_]#

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| 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#L185[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref[params&lowbar;ref]&
operator&equals;(link:#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;

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| 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#L216[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref[params&lowbar;ref]&
operator&equals;(std::initializer&lowbar;list&lt;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;

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of params to assign&period;
|===

Append elements

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L386[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

Append elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-append-07[append](std::initializer&lowbar;list&lt;param&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_ref-append-07[_» more&period;&period;&period;_]#

Append elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-append-0f[append](link:#boost-urls-param_view[param&lowbar;view] const& p);
----

[.small]#link:#boost-urls-params_ref-append-0f[_» more&period;&period;&period;_]#

Append elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-append-0c[append](
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_ref-append-0c[_» more&period;&period;&period;_]#

== Return Value

* An iterator to the first new element&period;
* An iterator to the new element&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of params to append&period;
| *p*
| The param to append&period;
| *first*
| The first element to append&period;
| *last*
| One past the last element to append&period;
|===

Append elements

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L416[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
append(std::initializer&lowbar;list&lt;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

[cols=2]
|===
| Name
| Description
| *init*
| The list 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#L386[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
append(link:#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

[cols=2]
|===
| 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#L450[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_base[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

[cols=2]
|===
| Name
| Description
| *first*
| The first element to append&period;
| *last*
| One past the last element to append&period;
|===

Assign elements

== Synopses

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

Assign elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
link:#boost-urls-params_ref-assign-098[assign](std::initializer&lowbar;list&lt;param&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_ref-assign-098[_» more&period;&period;&period;_]#

Assign elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
link:#boost-urls-params_ref-assign-02[assign](
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_ref-assign-02[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of params to assign&period;
| *first*
| The first element to assign&period;
| *last*
| One past the last element to assign&period;
|===

Assign elements

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
assign(std::initializer&lowbar;list&lt;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

[cols=2]
|===
| Name
| Description
| *init*
| The list 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#L355[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

[cols=2]
|===
| Name
| Description
| *first*
| The first element to assign&period;
| *last*
| One past the last element 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#L286[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

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L600[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

Erase elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-erase-05[erase](link:#boost-urls-params_base[iterator] pos) noexcept;
----

[.small]#link:#boost-urls-params_ref-erase-05[_» more&period;&period;&period;_]#

Erase elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-erase-0f9[erase](
    link:#boost-urls-params_base[iterator] first,
    link:#boost-urls-params_base[iterator] last) noexcept;
----

[.small]#link:#boost-urls-params_ref-erase-0f9[_» more&period;&period;&period;_]#

Erase elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::size&lowbar;t
link:#boost-urls-params_ref-erase-00[erase](
    core::string&lowbar;view key,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;) noexcept;
----

[.small]#link:#boost-urls-params_ref-erase-00[_» more&period;&period;&period;_]#

== Return Value

* An iterator to one past the removed element&period;
* An iterator to one past the removed range&period;
* The number of elements removed from the container&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *pos*
| An iterator to the element&period;
| *first*
| The first element to remove&period;
| *last*
| One past the last element to remove&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 link:#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#L600[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
erase(link:#boost-urls-params_base[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

[cols=2]
|===
| 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#L622[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
erase(
    link:#boost-urls-params_base[iterator] first,
    link:#boost-urls-params_base[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

[cols=2]
|===
| Name
| Description
| *first*
| The first element to remove&period;
| *last*
| One past the last element to remove&period;
|===

Erase elements

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L655[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,
    link:#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

[cols=2]
|===
| 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 link:#boost-urls-ignore_case[`ignore&lowbar;case`] is passed here, the comparison is case&hyphen;insensitive&period;
|===

Insert elements

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L482[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

Insert elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-insert-02[insert](
    link:#boost-urls-params_base[iterator] before,
    std::initializer&lowbar;list&lt;param&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_ref-insert-02[_» more&period;&period;&period;_]#

Insert elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-insert-08a[insert](
    link:#boost-urls-params_base[iterator] before,
    link:#boost-urls-param_view[param&lowbar;view] const& p);
----

[.small]#link:#boost-urls-params_ref-insert-08a[_» more&period;&period;&period;_]#

Insert elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-insert-05[insert](
    link:#boost-urls-params_base[iterator] before,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_ref-insert-05[_» more&period;&period;&period;_]#

== Return Value

* An iterator to the first element inserted, or `before` if `init&period;size() &equals;&equals; 0`&period;
* An iterator to the inserted element&period;
* An iterator to the first element inserted, or `before` if `first &equals;&equals; last`&period;
* An iterator to the first element inserted, or `before` if `first &equals;&equals; last`&period;

== Parameters

[cols=2]
|===
| 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;
| *p*
| The param to insert&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Insert elements

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L519[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
insert(
    link:#boost-urls-params_base[iterator] before,
    std::initializer&lowbar;list&lt;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

[cols=2]
|===
| 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;
|===

Insert elements

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L482[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
insert(
    link:#boost-urls-params_base[iterator] before,
    link:#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

[cols=2]
|===
| 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#L562[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_base[iterator]
insert(
    link:#boost-urls-params_base[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;
* An iterator to the first element inserted, or `before` if `first &equals;&equals; last`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *before*
| An iterator before which the element is inserted&period; This may be equal to `end()`&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Replace elements

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L694[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

Replace elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-replace-0d[replace](
    link:#boost-urls-params_base[iterator] pos,
    link:#boost-urls-param_view[param&lowbar;view] const& p);
----

[.small]#link:#boost-urls-params_ref-replace-0d[_» more&period;&period;&period;_]#

Replace elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-replace-0b[replace](
    link:#boost-urls-params_base[iterator] from,
    link:#boost-urls-params_base[iterator] to,
    std::initializer&lowbar;list&lt;param&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-params_ref-replace-0b[_» more&period;&period;&period;_]#

Replace elements


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-replace-01[replace](
    link:#boost-urls-params_base[iterator] from,
    link:#boost-urls-params_base[iterator] to,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-params_ref-replace-01[_» more&period;&period;&period;_]#

== Return Value

* An iterator to the element&period;
* An iterator to the first element inserted, or one past `to` if `init&period;size() &equals;&equals; 0`&period;
* An iterator to the first element inserted, or one past `to` if `first &equals;&equals; last`&period;
* An iterator to the first element inserted, or one past `to` if `first &equals;&equals; last`&period;

== Parameters

[cols=2]
|===
| 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;
| *from*
| The first element to replace&period;
| *to*
| One past the last element to replace&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Replace elements

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L694[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
replace(
    link:#boost-urls-params_base[iterator] pos,
    link:#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

[cols=2]
|===
| 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#L730[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
replace(
    link:#boost-urls-params_base[iterator] from,
    link:#boost-urls-params_base[iterator] to,
    std::initializer&lowbar;list&lt;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

[cols=2]
|===
| Name
| Description
| *from,to*
| The range of elements to replace&period;
| *init*
| The list 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#L773[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-params_base[iterator]
replace(
    link:#boost-urls-params_base[iterator] from,
    link:#boost-urls-params_base[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;
* An iterator to the first element inserted, or one past `to` if `first &equals;&equals; last`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *from*
| The first element to replace&period;
| *to*
| One past the last element to replace&period;
| *first*
| The first element to insert&period;
| *last*
| One past the last element to insert&period;
|===

Set a value

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L851[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

Set a value


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-set-09[set](
    link:#boost-urls-params_base[iterator] pos,
    core::string&lowbar;view value);
----

[.small]#link:#boost-urls-params_ref-set-09[_» more&period;&period;&period;_]#

Set a value


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
link:#boost-urls-params_ref-set-01[set](
    core::string&lowbar;view key,
    core::string&lowbar;view value,
    link:#boost-urls-ignore_case_param[ignore&lowbar;case&lowbar;param] ic = &lcub;&rcub;);
----

[.small]#link:#boost-urls-params_ref-set-01[_» more&period;&period;&period;_]#

== Return Value

* An iterator to the element&period;
* An iterator to the appended or modified element&period;

== Parameters

[cols=2]
|===
| 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 link:#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#L851[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
set(
    link:#boost-urls-params_base[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

[cols=2]
|===
| 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#L913[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
set(
    core::string&lowbar;view key,
    core::string&lowbar;view value,
    link:#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

[cols=2]
|===
| 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 link:#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#L813[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_base[iterator]
unset(link:#boost-urls-params_base[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

[cols=2]
|===
| 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#L253[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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.
----
== Return Value

A reference to the url&period;

Conversion

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L225[boost&sol;url&sol;params&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#boost-urls-params_view[params&lowbar;view]() const noexcept;
----

== Return Value

A view of the query parameters&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_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 link:#boost-urls-params_base[params&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_base[params&lowbar;base]`
| Common functionality for query parameter containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_view-iterator[`iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a query parameter
| link:#boost-urls-params_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-params_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-params_base-reference[`reference`] 
| The reference type
| link:#boost-urls-params_base-size_type[`size&lowbar;type`] 
| An unsigned integer type to represent sizes&period;
| link:#boost-urls-params_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_view-2constructor-06[`params&lowbar;view`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-params_view-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-params_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-params_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-params_base-contains[`contains`] 
| Return true if a matching key exists
| link:#boost-urls-params_base-count[`count`] 
| Return the number of matching keys
| link:#boost-urls-params_base-empty[`empty`] 
| Return true if there are no params
| link:#boost-urls-params_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-params_base-find-0f[`find`] 
| Find a matching key
| link:#boost-urls-params_base-find_last-04b[`find&lowbar;last`] 
| Find a matching key
| link:#boost-urls-params_base-size[`size`] 
| Return the number of params
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-params_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_ref[boost::urls::params&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_encoded_view[boost::urls::params&lowbar;encoded&lowbar;view]`
| A view representing query parameters in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== 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;

A Bidirectional iterator to a query parameter

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/impl/params_base.hpp#L22[boost&sol;url&sol;impl&sol;params&lowbar;base&period;hpp]&gt;`

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

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_ref[boost::urls::params&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_base[boost::urls::params&lowbar;base]`
| Common functionality for query parameter containers
|===

== 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;

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;

Constructor

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L135[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view-2constructor-0d[params&lowbar;view]() = default;
----

[.small]#link:#boost-urls-params_view-2constructor-0d[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-params_view-2constructor-091[params&lowbar;view](link:#boost-urls-params_view[params&lowbar;view] const& other) = default;
----

[.small]#link:#boost-urls-params_view-2constructor-091[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view-2constructor-09a[params&lowbar;view](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-params_view-2constructor-09a[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view-2constructor-04[params&lowbar;view](
    core::string&lowbar;view s,
    link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt);
----

[.small]#link:#boost-urls-params_view-2constructor-04[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view-2constructor-01[params&lowbar;view](
    link:#boost-urls-params_view[params&lowbar;view] const& other,
    link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt) noexcept;
----

[.small]#link:#boost-urls-params_view-2constructor-01[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid query parameter string&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy
| *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#L105[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
params&lowbar;view(link:#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

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L191[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid query parameter string&period;
|===

== Parameters

[cols=2]
|===
| 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#L258[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,
    link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid query parameter string&period;
|===

== Parameters

[cols=2]
|===
| 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#L135[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;view(
    link:#boost-urls-params_view[params&lowbar;view] const& other,
    link:#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 link:#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

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy
| *opt*
| The options for decoding
|===

Assignment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_view.hpp#L286[boost&sol;url&sol;params&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]&
operator&equals;(link:#boost-urls-params_view[params&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

== Return Value

A reference to this object

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to assign
|===

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 link:#boost-urls-grammar-string_view_base[grammar::string&lowbar;view&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-grammar-string_view_base[grammar::string&lowbar;view&lowbar;base]`
| Common functionality for string views
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-const_iterator[`const&lowbar;iterator`] 
| The const iterator type
| link:#boost-urls-grammar-string_view_base-const_pointer[`const&lowbar;pointer`] 
| The const pointer type
| link:#boost-urls-grammar-string_view_base-const_reference[`const&lowbar;reference`] 
| The const reference type
| link:#boost-urls-grammar-string_view_base-const_reverse_iterator[`const&lowbar;reverse&lowbar;iterator`] 
| The const reverse iterator type
| link:#boost-urls-grammar-string_view_base-difference_type[`difference&lowbar;type`] 
| The difference type
| link:#boost-urls-grammar-string_view_base-iterator[`iterator`] 
| The iterator type
| link:#boost-urls-grammar-string_view_base-pointer[`pointer`] 
| The pointer type
| link:#boost-urls-grammar-string_view_base-reference[`reference`] 
| The reference type
| link:#boost-urls-grammar-string_view_base-reverse_iterator[`reverse&lowbar;iterator`] 
| The reverse iterator type
| link:#boost-urls-grammar-string_view_base-size_type[`size&lowbar;type`] 
| The size type
| link:#boost-urls-grammar-string_view_base-traits_type[`traits&lowbar;type`] 
| The character traits
| link:#boost-urls-grammar-string_view_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-pct_string_view-2constructor-01[`pct&lowbar;string&lowbar;view`]         [.small]#[constructor]#
| Constructors
| link:#boost-urls-pct_string_view-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-grammar-string_view_base-at[`at`] 
| Access a character
| link:#boost-urls-grammar-string_view_base-back[`back`] 
| Return the last character
| link:#boost-urls-grammar-string_view_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-grammar-string_view_base-cbegin[`cbegin`] 
| Return an iterator to the beginning
| link:#boost-urls-grammar-string_view_base-cend[`cend`] 
| Return an iterator to the end
| link:#boost-urls-grammar-string_view_base-compare-06[`compare`] 
| Return the result of comparing to another string
| link:#boost-urls-grammar-string_view_base-contains-0a[`contains`] 
| Return true if matching characters are found
| link:#boost-urls-grammar-string_view_base-copy[`copy`] 
| Copy the characters to another buffer
| link:#boost-urls-grammar-string_view_base-crbegin[`crbegin`] 
| Return a reverse iterator to the end
| link:#boost-urls-grammar-string_view_base-crend[`crend`] 
| Return a reverse iterator to the beginning
| link:#boost-urls-grammar-string_view_base-data[`data`] 
| Return a pointer to the character buffer
| link:#boost-urls-pct_string_view-decode[`decode`] 
| Return the string with percent&hyphen;decoding
| link:#boost-urls-pct_string_view-decoded_size[`decoded&lowbar;size`] 
| Return the decoded size
| link:#boost-urls-grammar-string_view_base-empty[`empty`] 
| Return true if the string is empty
| link:#boost-urls-grammar-string_view_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-grammar-string_view_base-ends_with-09[`ends&lowbar;with`] 
| Return true if a matching suffix exists
| link:#boost-urls-grammar-string_view_base-find-0e[`find`] 
| Return the position of matching characters
| link:#boost-urls-grammar-string_view_base-find_first_not_of-01[`find&lowbar;first&lowbar;not&lowbar;of`] 
| Return the position of the first non&hyphen;match
| link:#boost-urls-grammar-string_view_base-find_first_of-047[`find&lowbar;first&lowbar;of`] 
| Return the position of the first match
| link:#boost-urls-grammar-string_view_base-find_last_not_of-03e[`find&lowbar;last&lowbar;not&lowbar;of`] 
| Return the position of the last non&hyphen;match
| link:#boost-urls-grammar-string_view_base-find_last_of-0b[`find&lowbar;last&lowbar;of`] 
| Return the position of the last match
| link:#boost-urls-grammar-string_view_base-front[`front`] 
| Return the first character
| link:#boost-urls-grammar-string_view_base-length[`length`] 
| Return the size
| link:#boost-urls-grammar-string_view_base-max_size[`max&lowbar;size`] 
| Return the maximum allowed size
| link:#boost-urls-pct_string_view-operator_star[`operator&ast;`] 
| Return the string as a range of decoded characters
| link:#boost-urls-pct_string_view-operator_ptr[`operator&hyphen;&gt;`] 
| Arrow support
| link:#boost-urls-grammar-string_view_base-operator_subs[`operator&lsqb;&rsqb;`] 
| Access a character
| link:#boost-urls-grammar-string_view_base-rbegin[`rbegin`] 
| Return a reverse iterator to the end
| link:#boost-urls-grammar-string_view_base-rend[`rend`] 
| Return a reverse iterator to the beginning
| link:#boost-urls-grammar-string_view_base-rfind-05[`rfind`] 
| Return the position of matching characters
| link:#boost-urls-grammar-string_view_base-size[`size`] 
| Return the size
| link:#boost-urls-grammar-string_view_base-starts_with-02[`starts&lowbar;with`] 
| Return true if a matching prefix exists
| link:#boost-urls-grammar-string_view_base-substr[`substr`] 
| Return a view to part of the string
| link:#boost-urls-pct_string_view-swap[`swap`] 
| Swap
| link:#boost-urls-grammar-string_view_base-2conversion-06[`operator std::string`] 
| Conversion
| link:#boost-urls-grammar-string_view_base-2conversion-0e[`operator std::string&lowbar;view`] 
| Conversion
|===

== Static Data Members

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-npos[`npos`] 
| A constant used to represent &quot;no position&quot;
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-grammar-string_view_base-swap[`swap`] 
| Swap
|===

== Protected Data Members

[cols=2]
|===
| Name
| Description
| link:#boost-urls-grammar-string_view_base-s_[`s&lowbar;`] 
| The referenced character buffer
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-make_pct_string_view[boost::urls::make&lowbar;pct&lowbar;string&lowbar;view]`
| Return a valid percent&hyphen;encoded string
|===

== 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;

Constructors

== Synopses

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

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-pct_string_view-2constructor-00[pct&lowbar;string&lowbar;view]() = default;
----

[.small]#link:#boost-urls-pct_string_view-2constructor-00[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-pct_string_view-2constructor-07[pct&lowbar;string&lowbar;view](link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] const& other) = default;
----

[.small]#link:#boost-urls-pct_string_view-2constructor-07[_» more&period;&period;&period;_]#

Constructor (deleted)


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view-2constructor-0f[pct&lowbar;string&lowbar;view](std::nullptr&lowbar;t value) = delete;
----

[.small]#link:#boost-urls-pct_string_view-2constructor-0f[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view-2constructor-0d[pct&lowbar;string&lowbar;view](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-pct_string_view-2constructor-0d[_» more&period;&period;&period;_]#

Constructor


[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
link:#boost-urls-pct_string_view-2constructor-0c[pct&lowbar;string&lowbar;view](String const& s);
----

[.small]#link:#boost-urls-pct_string_view-2constructor-0c[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view-2constructor-06[pct&lowbar;string&lowbar;view](
    char const* s,
    std::size&lowbar;t len);
----

[.small]#link:#boost-urls-pct_string_view-2constructor-06[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The string contains an invalid percent encoding&period;
|===

== Template Parameters

[cols=2]
|===
| Name
| Description
| *String*
| A type convertible to `core&colon;&colon;string&lowbar;view`
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The string to copy&period;
| *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#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#L126[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(link:#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;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L174[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 value) = delete;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *value*
| The object to construct from
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/pct_string_view.hpp#L231[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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The string contains an invalid percent encoding&period;
|===

== Parameters

[cols=2]
|===
| 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#L154[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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The string contains an invalid percent encoding&period;
|===

== Template Parameters

[cols=2]
|===
| Name
| Description
| *String*
| A type convertible to `core&colon;&colon;string&lowbar;view`
|===

== Parameters

[cols=2]
|===
| 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#L200[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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The string contains an invalid percent encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to construct from&period;
| *len*
| The length of the string&period;
|===

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The string to copy&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#L342[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::return&lowbar;string]&gt;
StringToken::result&lowbar;type
decode(
    link:#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;

== Return Value

The decoded string&period;

== Parameters

[cols=2]
|===
| 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

link:#boost-urls-encoding_opts[`encoding&lowbar;opts`], link:#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#L280[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 Value

The number of characters in the decoded string&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#L300[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-decode_view[decode&lowbar;view]
operator&ast;() const noexcept;
----

== Description

== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

A range of decoded characters&period;

== See Also

link:#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#L367[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] const*
operator&hyphen;&gt;() const noexcept;
----

== Return Value

A pointer to this object&period;

Swap

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]& s) noexcept;
----

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The object to swap with
|===

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
| link:#boost-urls-segments_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-segments_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-segments_base-reference[`reference`] 
| The reference type
| link:#boost-urls-segments_base-size_type[`size&lowbar;type`] 
| An unsigned integer type used to represent size&period;
| link:#boost-urls-segments_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_base-back[`back`] 
| Return the last segment
| link:#boost-urls-segments_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-segments_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-segments_base-empty[`empty`] 
| Return true if there are no segments
| link:#boost-urls-segments_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-segments_base-front[`front`] 
| Return the first segment
| link:#boost-urls-segments_base-is_absolute[`is&lowbar;absolute`] 
| Returns true if this references an absolute path&period;
| link:#boost-urls-segments_base-size[`size`] 
| Return the number of segments
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_view[boost::urls::segments&lowbar;view]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_ref[boost::urls::segments&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_ref[`segments&lowbar;ref`]
| A view representing path segments in a URL
| link:#boost-urls-segments_view[`segments&lowbar;view`]
| A view representing path segments in a 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
* `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_base.hpp#L76[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = link:#boost-urls-segments_base[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#L99[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#L107[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#L96[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#L103[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#L89[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() );
----
Return the last segment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L282[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 Value

The last segment&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#L297[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[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 Value

An iterator to the first segment&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#L155[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

A string containing the path&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#L196[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 Value

`true` if there are no segments, otherwise `false`&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#L311[boost&sol;url&sol;segments&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
end() const noexcept;
----

== Description

== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to one past the last segment&period;

Return the first segment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L249[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;

== Return Value

The first segment&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#L177[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 Value

`true` if the path is absolute, otherwise `false`&period;

Return the number of segments

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L215[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;

== Return Value

The number of segments&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#L126[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;

== Return Value

The maximum number of characters possible&period;

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
| link:#boost-urls-segments_encoded_base-iterator[`iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_encoded_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_encoded_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-segments_encoded_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-segments_encoded_base-reference[`reference`] 
| The reference type
| link:#boost-urls-segments_encoded_base-size_type[`size&lowbar;type`] 
| An unsigned integer type used to represent size&period;
| link:#boost-urls-segments_encoded_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_base-back[`back`] 
| Return the last segment
| link:#boost-urls-segments_encoded_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-segments_encoded_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-segments_encoded_base-empty[`empty`] 
| Return true if there are no segments
| link:#boost-urls-segments_encoded_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-segments_encoded_base-front[`front`] 
| Return the first segment
| link:#boost-urls-segments_encoded_base-is_absolute[`is&lowbar;absolute`] 
| Returns true if this references an absolute path&period;
| link:#boost-urls-segments_encoded_base-size[`size`] 
| Return the number of segments
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_encoded_view[boost::urls::segments&lowbar;encoded&lowbar;view]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_encoded_ref[boost::urls::segments&lowbar;encoded&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_ref[`segments&lowbar;encoded&lowbar;ref`]
| A view representing path segments in a URL
| link:#boost-urls-segments_encoded_view[`segments&lowbar;encoded&lowbar;view`]
| A view representing path segments in a 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
* `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#L79[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;iterator = link:#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#L102[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using const&lowbar;reference = link:#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#L110[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#L99[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
using reference = link:#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#L106[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#L92[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 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#L76[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class iterator { /* see-below */ };
----

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_encoded_ref[boost::urls::segments&lowbar;encoded&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_encoded_base[boost::urls::segments&lowbar;encoded&lowbar;base]`
| Common functionality for containers
| `link:#boost-urls-url_base[boost::urls::url&lowbar;base]`
| Common functionality for containers
|===

== 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#L291[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

The last segment&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#L306[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

An iterator to the first segment&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#L158[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 Value

A string view of the buffer&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#L199[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 Value

`true` if there are no segments, otherwise `false`&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#L320[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
end() const noexcept;
----

== Description

== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

An iterator to one past the last segment&period;

Return the first segment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L252[boost&sol;url&sol;segments&lowbar;encoded&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

The first segment&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#L180[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 Value

`true` if the path is absolute, otherwise `false`&period;

Return the number of 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"]
----
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;

== Return Value

The number of segments&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#L129[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;

== Return Value

The maximum number of characters possible&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_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 link:#boost-urls-segments_encoded_base[segments&lowbar;encoded&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_encoded_base[segments&lowbar;encoded&lowbar;base]`
| Common functionality for containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_base-iterator[`iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_encoded_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_encoded_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-segments_encoded_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-segments_encoded_base-reference[`reference`] 
| The reference type
| link:#boost-urls-segments_encoded_base-size_type[`size&lowbar;type`] 
| An unsigned integer type used to represent size&period;
| link:#boost-urls-segments_encoded_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_ref-2constructor-0a[`segments&lowbar;encoded&lowbar;ref`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-segments_encoded_ref-operator_assign-0a[`operator&equals;`] 
| Assignment
| link:#boost-urls-segments_encoded_ref-assign-00[`assign`] 
| Assign segments
| link:#boost-urls-segments_encoded_base-back[`back`] 
| Return the last segment
| link:#boost-urls-segments_encoded_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-segments_encoded_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-segments_encoded_ref-clear[`clear`] 
| Clear the contents of the container
| link:#boost-urls-segments_encoded_base-empty[`empty`] 
| Return true if there are no segments
| link:#boost-urls-segments_encoded_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-segments_encoded_ref-erase-01[`erase`] 
| Erase segments
| link:#boost-urls-segments_encoded_base-front[`front`] 
| Return the first segment
| link:#boost-urls-segments_encoded_ref-insert-00[`insert`] 
| Insert segments
| link:#boost-urls-segments_encoded_base-is_absolute[`is&lowbar;absolute`] 
| Returns true if this references an absolute path&period;
| link:#boost-urls-segments_encoded_ref-pop_back[`pop&lowbar;back`] 
| Remove the last segment
| link:#boost-urls-segments_encoded_ref-push_back[`push&lowbar;back`] 
| Append a segment
| link:#boost-urls-segments_encoded_ref-replace-0d[`replace`] 
| Replace segments
| link:#boost-urls-segments_encoded_base-size[`size`] 
| Return the number of segments
| link:#boost-urls-segments_encoded_ref-url[`url`] 
| Return the referenced url
| link:#boost-urls-segments_encoded_ref-2conversion[`operator segments&lowbar;encoded&lowbar;view`] 
| Conversion
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-url_base[boost::urls::url&lowbar;base]`
| Common functionality for containers
|===

== 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 link:#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

link:#boost-urls-segments_encoded_view[`segments&lowbar;encoded&lowbar;view`], link:#boost-urls-segments_view[`segments&lowbar;view`], link:#boost-urls-segments_ref[`segments&lowbar;ref`]&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(link:#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

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

Assignment

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L160[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref]&
link:#boost-urls-segments_encoded_ref-operator_assign-02c[operator&equals;](link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref] const& other);
----

[.small]#link:#boost-urls-segments_encoded_ref-operator_assign-02c[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref]&
link:#boost-urls-segments_encoded_ref-operator_assign-08[operator&equals;](std::initializer&lowbar;list&lt;pct&lowbar;string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_encoded_ref-operator_assign-08[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref]&
link:#boost-urls-segments_encoded_ref-operator_assign-02e[operator&equals;](link:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view] const& other);
----

[.small]#link:#boost-urls-segments_encoded_ref-operator_assign-02e[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* A reference to this object&period;
* A reference to this&period;

== Parameters

[cols=2]
|===
| 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#L160[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L213[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref]&
operator&equals;(std::initializer&lowbar;list&lt;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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

A reference to this&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L165[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The segments to assign&period;
|===

Assign segments

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L326[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Assign segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
link:#boost-urls-segments_encoded_ref-assign-0e[assign](std::initializer&lowbar;list&lt;pct&lowbar;string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_encoded_ref-assign-0e[_» more&period;&period;&period;_]#

Assign segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
link:#boost-urls-segments_encoded_ref-assign-0b[assign](
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-segments_encoded_ref-assign-0b[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| 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#L326[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;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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The list contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of segments to assign&period;
|===

Assign segments

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L366[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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The range contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *first*
| The first element in the range&period;
| *last*
| One past the last element in the range&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#L284[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

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L537[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Erase segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-erase-006[erase](link:#boost-urls-segments_encoded_base-iterator[iterator] pos) noexcept;
----

[.small]#link:#boost-urls-segments_encoded_ref-erase-006[_» more&period;&period;&period;_]#

Erase segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-erase-00a[erase](
    link:#boost-urls-segments_encoded_base-iterator[iterator] first,
    link:#boost-urls-segments_encoded_base-iterator[iterator] last) noexcept;
----

[.small]#link:#boost-urls-segments_encoded_ref-erase-00a[_» more&period;&period;&period;_]#

== Return Value

* An iterator to one past the removed segment&period;
* An iterator to one past the removed range&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *pos*
| An iterator to the element&period;
| *first*
| The first element in the range to erase&period;
| *last*
| One past the last element in the range to erase&period;
|===

Erase segments

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L537[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
erase(link:#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

[cols=2]
|===
| 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#L561[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
erase(
    link:#boost-urls-segments_encoded_base-iterator[iterator] first,
    link:#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

[cols=2]
|===
| Name
| Description
| *first*
| The first element in the range to erase&period;
| *last*
| One past the last element in the range to erase&period;
|===

Insert segments

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L405[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Insert segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-insert-04e[insert](
    link:#boost-urls-segments_encoded_base-iterator[iterator] before,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] s);
----

[.small]#link:#boost-urls-segments_encoded_ref-insert-04e[_» more&period;&period;&period;_]#

Insert segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-insert-0d[insert](
    link:#boost-urls-segments_encoded_base-iterator[iterator] before,
    std::initializer&lowbar;list&lt;pct&lowbar;string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_encoded_ref-insert-0d[_» more&period;&period;&period;_]#

Insert segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-insert-07[insert](
    link:#boost-urls-segments_encoded_base-iterator[iterator] before,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-segments_encoded_ref-insert-07[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The segment contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* An iterator to the inserted segment&period;
* An iterator to the first element inserted, or `before` if `init&period;size() &equals;&equals; 0`&period;
* An iterator to the first segment inserted, or `before` if `init&period;empty()`&period;

== Parameters

[cols=2]
|===
| 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#L405[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
insert(
    link:#boost-urls-segments_encoded_base-iterator[iterator] before,
    link:#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

[cols=2]
|===
| 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

[cols=2]
|===
| 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#L458[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
insert(
    link:#boost-urls-segments_encoded_base-iterator[iterator] before,
    std::initializer&lowbar;list&lt;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

[cols=2]
|===
| 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

[cols=2]
|===
| 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;
|===

Insert segments

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L509[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_encoded_base-iterator[iterator]
insert(
    link:#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

[cols=2]
|===
| 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

[cols=2]
|===
| 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;
|===

Remove the last segment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L778[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#L757[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
push&lowbar;back(link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The string contains an invalid percent&hyphen;encoding&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The segment to append&period;
|===

Replace segments

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L594[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-replace-07[replace](
    link:#boost-urls-segments_encoded_base-iterator[iterator] pos,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] s);
----

[.small]#link:#boost-urls-segments_encoded_ref-replace-07[_» more&period;&period;&period;_]#

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-replace-06[replace](
    link:#boost-urls-segments_encoded_base-iterator[iterator] from,
    link:#boost-urls-segments_encoded_base-iterator[iterator] to,
    link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view] s);
----

[.small]#link:#boost-urls-segments_encoded_ref-replace-06[_» more&period;&period;&period;_]#

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-replace-08[replace](
    link:#boost-urls-segments_encoded_base-iterator[iterator] from,
    link:#boost-urls-segments_encoded_base-iterator[iterator] to,
    std::initializer&lowbar;list&lt;pct&lowbar;string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_encoded_ref-replace-08[_» more&period;&period;&period;_]#

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_encoded_base-iterator[iterator]
link:#boost-urls-segments_encoded_ref-replace-0f[replace](
    link:#boost-urls-segments_encoded_base-iterator[iterator] from,
    link:#boost-urls-segments_encoded_base-iterator[iterator] to,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-segments_encoded_ref-replace-0f[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The string contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* An iterator to the replaced segment&period;
* An iterator to the new segment&period;
* An iterator to the first segment inserted, or one past `to` if `init&period;size() &equals;&equals; 0`&period;

== Parameters

[cols=2]
|===
| 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#L594[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
replace(
    link:#boost-urls-segments_encoded_base-iterator[iterator] pos,
    link:#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

[cols=2]
|===
| 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#L630[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
replace(
    link:#boost-urls-segments_encoded_base-iterator[iterator] from,
    link:#boost-urls-segments_encoded_base-iterator[iterator] to,
    link:#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

[cols=2]
|===
| 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

[cols=2]
|===
| 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#L676[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_base-iterator[iterator]
replace(
    link:#boost-urls-segments_encoded_base-iterator[iterator] from,
    link:#boost-urls-segments_encoded_base-iterator[iterator] to,
    std::initializer&lowbar;list&lt;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

[cols=2]
|===
| 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

[cols=2]
|===
| 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;
|===

Replace segments

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L721[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_encoded_base-iterator[iterator]
replace(
    link:#boost-urls-segments_encoded_base-iterator[iterator] from,
    link:#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

[cols=2]
|===
| 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

[cols=2]
|===
| 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;
|===

Return the referenced url

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L251[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

A reference to the url&period;

Conversion

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_ref.hpp#L225[boost&sol;url&sol;segments&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view]() const noexcept;
----

== Return Value

A view of the segments&period;

== See Also

link:#boost-urls-segments_encoded_view[`segments&lowbar;encoded&lowbar;view`]&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 link:#boost-urls-segments_encoded_base[segments&lowbar;encoded&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_encoded_base[segments&lowbar;encoded&lowbar;base]`
| Common functionality for containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_base-iterator[`iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_encoded_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_encoded_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-segments_encoded_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-segments_encoded_base-reference[`reference`] 
| The reference type
| link:#boost-urls-segments_encoded_base-size_type[`size&lowbar;type`] 
| An unsigned integer type used to represent size&period;
| link:#boost-urls-segments_encoded_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_view-2constructor-0b1[`segments&lowbar;encoded&lowbar;view`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-segments_encoded_view-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-segments_encoded_base-back[`back`] 
| Return the last segment
| link:#boost-urls-segments_encoded_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-segments_encoded_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-segments_encoded_base-empty[`empty`] 
| Return true if there are no segments
| link:#boost-urls-segments_encoded_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-segments_encoded_base-front[`front`] 
| Return the first segment
| link:#boost-urls-segments_encoded_base-is_absolute[`is&lowbar;absolute`] 
| Returns true if this references an absolute path&period;
| link:#boost-urls-segments_encoded_base-size[`size`] 
| Return the number of segments
| link:#boost-urls-segments_encoded_view-2conversion[`operator segments&lowbar;view`] 
| Conversion
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_encoded_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-parse_path[boost::urls::parse&lowbar;path]`
| Parse a string and return an encoded segment view
| `link:#boost-urls-segments_encoded_ref[boost::urls::segments&lowbar;encoded&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== 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 link:#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

link:#boost-urls-segments_view[`segments&lowbar;view`], link:#boost-urls-segments_encoded_ref[`segments&lowbar;encoded&lowbar;ref`], link:#boost-urls-segments_ref[`segments&lowbar;ref`]&period;

Constructor

== Synopses

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;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-segments_encoded_view-2constructor-0c[segments&lowbar;encoded&lowbar;view]() = default;
----

[.small]#link:#boost-urls-segments_encoded_view-2constructor-0c[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-segments_encoded_view-2constructor-0b6[segments&lowbar;encoded&lowbar;view](link:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view] const& other) noexcept = default;
----

[.small]#link:#boost-urls-segments_encoded_view-2constructor-0b6[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_view-2constructor-02[segments&lowbar;encoded&lowbar;view](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-segments_encoded_view-2constructor-02[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid path&period;
|===

== Parameters

[cols=2]
|===
| 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(link:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view] const& other) 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

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The object to copy construct from
|===

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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid path&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

Assignment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L195[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view]&
operator&equals;(link:#boost-urls-segments_encoded_view[segments&lowbar;encoded&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

== Return Value

Reference to this object

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The segments to copy&period;
|===

Conversion

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_view.hpp#L231[boost&sol;url&sol;segments&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#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

== Return Value

A view of the segments&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_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 link:#boost-urls-segments_base[segments&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_base[segments&lowbar;base]`
| Common functionality for containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_ref-iterator[`iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-segments_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-segments_base-reference[`reference`] 
| The reference type
| link:#boost-urls-segments_base-size_type[`size&lowbar;type`] 
| An unsigned integer type used to represent size&period;
| link:#boost-urls-segments_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_ref-2constructor-09[`segments&lowbar;ref`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-segments_ref-operator_assign-0a[`operator&equals;`] 
| Assignment
| link:#boost-urls-segments_ref-assign-0c[`assign`] 
| Assign segments
| link:#boost-urls-segments_base-back[`back`] 
| Return the last segment
| link:#boost-urls-segments_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-segments_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-segments_ref-clear[`clear`] 
| Clear the contents of the container
| link:#boost-urls-segments_base-empty[`empty`] 
| Return true if there are no segments
| link:#boost-urls-segments_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-segments_ref-erase-0e[`erase`] 
| Erase segments
| link:#boost-urls-segments_base-front[`front`] 
| Return the first segment
| link:#boost-urls-segments_ref-insert-0a[`insert`] 
| Insert segments
| link:#boost-urls-segments_base-is_absolute[`is&lowbar;absolute`] 
| Returns true if this references an absolute path&period;
| link:#boost-urls-segments_ref-pop_back[`pop&lowbar;back`] 
| Remove the last segment
| link:#boost-urls-segments_ref-push_back[`push&lowbar;back`] 
| Append a segment
| link:#boost-urls-segments_ref-replace-0d[`replace`] 
| Replace segments
| link:#boost-urls-segments_base-size[`size`] 
| Return the number of segments
| link:#boost-urls-segments_ref-url[`url`] 
| Return the referenced url
| link:#boost-urls-segments_ref-2conversion[`operator segments&lowbar;view`] 
| Conversion
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_encoded_ref[boost::urls::segments&lowbar;encoded&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-url_base[boost::urls::url&lowbar;base]`
| Common functionality for containers
|===

== 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

link:#boost-urls-segments_encoded_ref[`segments&lowbar;encoded&lowbar;ref`], link:#boost-urls-segments_encoded_view[`segments&lowbar;encoded&lowbar;view`], link:#boost-urls-segments_view[`segments&lowbar;view`]&period;

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;
----

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_ref[boost::urls::segments&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_base[boost::urls::segments&lowbar;base]`
| Common functionality for containers
|===

== 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;

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(link:#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

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

Assignment

== Synopses

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

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_ref[segments&lowbar;ref]&
link:#boost-urls-segments_ref-operator_assign-0d[operator&equals;](link:#boost-urls-segments_ref[segments&lowbar;ref] const& other);
----

[.small]#link:#boost-urls-segments_ref-operator_assign-0d[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_ref[segments&lowbar;ref]&
link:#boost-urls-segments_ref-operator_assign-0f[operator&equals;](std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_ref-operator_assign-0f[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_ref[segments&lowbar;ref]&
link:#boost-urls-segments_ref-operator_assign-08[operator&equals;](link:#boost-urls-segments_view[segments&lowbar;view] const& other);
----

[.small]#link:#boost-urls-segments_ref-operator_assign-08[_» more&period;&period;&period;_]#

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L157[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_ref[segments&lowbar;ref]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L205[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *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#L162[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_ref[segments&lowbar;ref]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The segments to assign&period;
|===

Assign segments

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L313[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

Assign segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
link:#boost-urls-segments_ref-assign-08[assign](std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_ref-assign-08[_» more&period;&period;&period;_]#

Assign segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
void
link:#boost-urls-segments_ref-assign-0d[assign](
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-segments_ref-assign-0d[_» more&period;&period;&period;_]#

== Parameters

[cols=2]
|===
| 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#L313[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

[cols=2]
|===
| Name
| Description
| *init*
| The list 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#L348[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

[cols=2]
|===
| Name
| Description
| *first*
| The beginning of the range of segments to assign&period;
| *last*
| The end of the range 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#L276[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

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L503[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

Erase segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-erase-0af2[erase](link:#boost-urls-segments_base[iterator] pos) noexcept;
----

[.small]#link:#boost-urls-segments_ref-erase-0af2[_» more&period;&period;&period;_]#

Erase segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-erase-0af5[erase](
    link:#boost-urls-segments_base[iterator] first,
    link:#boost-urls-segments_base[iterator] last) noexcept;
----

[.small]#link:#boost-urls-segments_ref-erase-0af5[_» more&period;&period;&period;_]#

== Return Value

* An iterator to one past the removed segment&period;
* An iterator to one past the removed range&period;

== Parameters

[cols=2]
|===
| 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#L503[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
erase(link:#boost-urls-segments_base[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

[cols=2]
|===
| 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#L528[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
erase(
    link:#boost-urls-segments_base[iterator] first,
    link:#boost-urls-segments_base[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

[cols=2]
|===
| Name
| Description
| *first*
| The beginning of the range to remove&period;
| *last*
| The end of the range to remove&period;
|===

Insert segments

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L382[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

Insert segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-insert-050[insert](
    link:#boost-urls-segments_base[iterator] before,
    core::string&lowbar;view s);
----

[.small]#link:#boost-urls-segments_ref-insert-050[_» more&period;&period;&period;_]#

Insert segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-insert-09[insert](
    link:#boost-urls-segments_base[iterator] before,
    std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_ref-insert-09[_» more&period;&period;&period;_]#

Insert segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-insert-07[insert](
    link:#boost-urls-segments_base[iterator] before,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-segments_ref-insert-07[_» more&period;&period;&period;_]#

== Return Value

* An iterator to the inserted segment&period;
* An iterator to the first element inserted, or `before` if `init&period;size() &equals;&equals; 0`&period;
* An iterator to the first segment inserted, or `before` if `init&period;empty()`&period;

== Parameters

[cols=2]
|===
| 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#L382[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
insert(
    link:#boost-urls-segments_base[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

[cols=2]
|===
| 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#L430[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
insert(
    link:#boost-urls-segments_base[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

[cols=2]
|===
| 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;
|===

Insert segments

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L475[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_base[iterator]
insert(
    link:#boost-urls-segments_base[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

[cols=2]
|===
| 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;
|===

Remove the last segment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L722[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#L701[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

[cols=2]
|===
| Name
| Description
| *s*
| The segment to append&period;
|===

Replace segments

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L560[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-replace-05[replace](
    link:#boost-urls-segments_base[iterator] pos,
    core::string&lowbar;view s);
----

[.small]#link:#boost-urls-segments_ref-replace-05[_» more&period;&period;&period;_]#

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-replace-04[replace](
    link:#boost-urls-segments_base[iterator] from,
    link:#boost-urls-segments_base[iterator] to,
    core::string&lowbar;view s);
----

[.small]#link:#boost-urls-segments_ref-replace-04[_» more&period;&period;&period;_]#

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-replace-02[replace](
    link:#boost-urls-segments_base[iterator] from,
    link:#boost-urls-segments_base[iterator] to,
    std::initializer&lowbar;list&lt;core::string&lowbar;view&gt; init);
----

[.small]#link:#boost-urls-segments_ref-replace-02[_» more&period;&period;&period;_]#

Replace segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_base[iterator]
link:#boost-urls-segments_ref-replace-07[replace](
    link:#boost-urls-segments_base[iterator] from,
    link:#boost-urls-segments_base[iterator] to,
    FwdIt first,
    FwdIt last);
----

[.small]#link:#boost-urls-segments_ref-replace-07[_» more&period;&period;&period;_]#

== Return Value

* An iterator to the replaced segment&period;
* An iterator to the new segment&period;
* An iterator to the first segment inserted, or one past `to` if `init&period;size() &equals;&equals; 0`&period;

== Parameters

[cols=2]
|===
| 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#L560[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
replace(
    link:#boost-urls-segments_base[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

[cols=2]
|===
| 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#L591[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
replace(
    link:#boost-urls-segments_base[iterator] from,
    link:#boost-urls-segments_base[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

[cols=2]
|===
| 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#L632[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_base[iterator]
replace(
    link:#boost-urls-segments_base[iterator] from,
    link:#boost-urls-segments_base[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

[cols=2]
|===
| 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;
|===

Replace segments

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L672[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
link:#boost-urls-segments_base[iterator]
replace(
    link:#boost-urls-segments_base[iterator] from,
    link:#boost-urls-segments_base[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

[cols=2]
|===
| 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;
|===

Return the referenced url

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_ref.hpp#L243[boost&sol;url&sol;segments&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

A reference to the url&period;

Conversion

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator link:#boost-urls-segments_view[segments&lowbar;view]() const noexcept;
----

== Return Value

A view of the segments&period;

== See Also

link:#boost-urls-segments_view[`segments&lowbar;view`]&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 link:#boost-urls-segments_base[segments&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_base[segments&lowbar;base]`
| Common functionality for containers
|===

== Types

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_view-iterator[`iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_base-const_iterator[`const&lowbar;iterator`] 
| A Bidirectional iterator to a path segment
| link:#boost-urls-segments_base-const_reference[`const&lowbar;reference`] 
| The reference type
| link:#boost-urls-segments_base-difference_type[`difference&lowbar;type`] 
| A signed integer type used to represent differences&period;
| link:#boost-urls-segments_base-reference[`reference`] 
| The reference type
| link:#boost-urls-segments_base-size_type[`size&lowbar;type`] 
| An unsigned integer type used to represent size&period;
| link:#boost-urls-segments_base-value_type[`value&lowbar;type`] 
| The value type
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_view-2constructor-0c9[`segments&lowbar;view`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-segments_view-operator_assign[`operator&equals;`] 
| Assignment
| link:#boost-urls-segments_base-back[`back`] 
| Return the last segment
| link:#boost-urls-segments_base-begin[`begin`] 
| Return an iterator to the beginning
| link:#boost-urls-segments_base-buffer[`buffer`] 
| Return the referenced character buffer&period;
| link:#boost-urls-segments_base-empty[`empty`] 
| Return true if there are no segments
| link:#boost-urls-segments_base-end[`end`] 
| Return an iterator to the end
| link:#boost-urls-segments_base-front[`front`] 
| Return the first segment
| link:#boost-urls-segments_base-is_absolute[`is&lowbar;absolute`] 
| Returns true if this references an absolute path&period;
| link:#boost-urls-segments_base-size[`size`] 
| Return the number of segments
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-segments_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_ref[boost::urls::segments&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_encoded_view[boost::urls::segments&lowbar;encoded&lowbar;view]`
| A view representing path segments in a URL
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== 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

link:#boost-urls-segments_encoded_view[`segments&lowbar;encoded&lowbar;view`], link:#boost-urls-segments_encoded_ref[`segments&lowbar;encoded&lowbar;ref`], link:#boost-urls-segments_ref[`segments&lowbar;ref`]&period;

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;
----

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-segments_ref[boost::urls::segments&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_base[boost::urls::segments&lowbar;base]`
| Common functionality for containers
|===

== 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;

Constructor

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L165[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-segments_view-2constructor-0c6[segments&lowbar;view]() = default;
----

[.small]#link:#boost-urls-segments_view-2constructor-0c6[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-segments_view-2constructor-0d[segments&lowbar;view](link:#boost-urls-segments_view[segments&lowbar;view] const& other) = default;
----

[.small]#link:#boost-urls-segments_view-2constructor-0d[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_view-2constructor-0e[segments&lowbar;view](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-segments_view-2constructor-0e[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid path&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
| *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#L113[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
segments&lowbar;view(link:#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

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

Constructor

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L165[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid path&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

Assignment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_view.hpp#L193[boost&sol;url&sol;segments&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
link:#boost-urls-segments_view[segments&lowbar;view]&
operator&equals;(link:#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

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&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 link:#boost-urls-static_url_base[static&lowbar;url&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-static_url_base[static&lowbar;url&lowbar;base]`
| Common implementation for all static URLs
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-static_url-2constructor-05[`static&lowbar;url`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-static_url-2destructor[`&#126;static&lowbar;url`] [.small]#[destructor]# [.small]#[virtual]#
| Destructor
| link:#boost-urls-static_url-operator_assign-07[`operator&equals;`] 
| Assignment
| link:#boost-urls-url_view_base-authority[`authority`] 
| Return the authority
| link:#boost-urls-url_view_base-buffer[`buffer`] 
| Return the url string
| link:#boost-urls-url_base-c_str[`c&lowbar;str`] 
| Return the url as a null&hyphen;terminated string
| link:#boost-urls-url_base-capacity[`capacity`] 
| Return the number of characters that can be stored without reallocating
| link:#boost-urls-url_base-clear[`clear`] 
| Clear the contents while preserving the capacity
| link:#boost-urls-url_view_base-compare[`compare`] 
| Return the result of comparing this with another url
| link:#boost-urls-url_view_base-data[`data`] 
| Return a pointer to the url&apos;s character buffer
| link:#boost-urls-url_view_base-empty[`empty`] 
| Return true if the url is empty
| link:#boost-urls-url_view_base-encoded_authority[`encoded&lowbar;authority`] 
| Return the authority&period;
| link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-encoded_host[`encoded&lowbar;host`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_address[`encoded&lowbar;host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`] 
| Return the host and port
| link:#boost-urls-url_view_base-encoded_host_name[`encoded&lowbar;host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`] 
| Return the origin
| link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`] 
| Return the password
| link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`] 
| Return the path
| link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`] 
| Return the query
| link:#boost-urls-url_view_base-encoded_resource[`encoded&lowbar;resource`] 
| Return the resource
| link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-encoded_target[`encoded&lowbar;target`] 
| Return the target
| link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`] 
| Return the user
| link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-encoded_zone_id[`encoded&lowbar;zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-fragment[`fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-has_authority[`has&lowbar;authority`] 
| Return true if an authority is present
| link:#boost-urls-url_view_base-has_fragment[`has&lowbar;fragment`] 
| Return true if a fragment is present
| link:#boost-urls-url_view_base-has_password[`has&lowbar;password`] 
| Return true if a password is present
| link:#boost-urls-url_view_base-has_port[`has&lowbar;port`] 
| Return true if a port is present
| link:#boost-urls-url_view_base-has_query[`has&lowbar;query`] 
| Return true if a query is present
| link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`] 
| Return true a scheme is present
| link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`] 
| Return true if a userinfo is present
| link:#boost-urls-url_view_base-host[`host`] 
| Return the host
| link:#boost-urls-url_view_base-host_address[`host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-host_ipv4_address[`host&lowbar;ipv4&lowbar;address`] 
| Return the host IPv4 address
| link:#boost-urls-url_view_base-host_ipv6_address[`host&lowbar;ipv6&lowbar;address`] 
| Return the host IPv6 address
| link:#boost-urls-url_view_base-host_ipvfuture[`host&lowbar;ipvfuture`] 
| Return the host IPvFuture address
| link:#boost-urls-url_view_base-host_name[`host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-host_type[`host&lowbar;type`] 
| Return the host type
| link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`] 
| Return true if the path is absolute
| link:#boost-urls-static_url-normalize[`normalize`] 
| Normalize the URL components
| link:#boost-urls-static_url-normalize_authority[`normalize&lowbar;authority`] 
| Normalize the URL authority
| link:#boost-urls-static_url-normalize_fragment[`normalize&lowbar;fragment`] 
| Normalize the URL fragment
| link:#boost-urls-static_url-normalize_path[`normalize&lowbar;path`] 
| Normalize the URL path
| link:#boost-urls-static_url-normalize_query[`normalize&lowbar;query`] 
| Normalize the URL query
| link:#boost-urls-static_url-normalize_scheme[`normalize&lowbar;scheme`] 
| Normalize the URL scheme
| link:#boost-urls-url_base-params-0c1[`params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-password[`password`] 
| Return the password
| link:#boost-urls-url_view_base-path[`path`] 
| Return the path
| link:#boost-urls-url_view_base-persist[`persist`] 
| Return a shared, persistent copy of the url
| link:#boost-urls-url_view_base-port[`port`] 
| Return the port
| link:#boost-urls-url_view_base-port_number[`port&lowbar;number`] 
| Return the port
| link:#boost-urls-url_view_base-query[`query`] 
| Return the query
| link:#boost-urls-static_url-remove_authority[`remove&lowbar;authority`] 
| Remove the authority
| link:#boost-urls-static_url-remove_fragment[`remove&lowbar;fragment`] 
| Remove the fragment
| link:#boost-urls-static_url-remove_origin[`remove&lowbar;origin`] 
| Remove the origin component
| link:#boost-urls-static_url-remove_password[`remove&lowbar;password`] 
| Remove the password
| link:#boost-urls-static_url-remove_port[`remove&lowbar;port`] 
| Remove the port
| link:#boost-urls-static_url-remove_query[`remove&lowbar;query`] 
| Remove the query
| link:#boost-urls-static_url-remove_scheme[`remove&lowbar;scheme`] 
| Remove the scheme
| link:#boost-urls-static_url-remove_userinfo[`remove&lowbar;userinfo`] 
| Remove the userinfo
| link:#boost-urls-url_base-reserve[`reserve`] 
| Adjust the capacity without changing the size
| link:#boost-urls-url_base-resolve[`resolve`] 
| Resolve a URL reference against this base URL
| link:#boost-urls-url_view_base-scheme[`scheme`] 
| Return the scheme
| link:#boost-urls-url_view_base-scheme_id[`scheme&lowbar;id`] 
| Return the scheme
| link:#boost-urls-url_base-segments-07[`segments`] 
| Return the path as a container of segments
| link:#boost-urls-static_url-set_encoded_authority[`set&lowbar;encoded&lowbar;authority`] 
| Set the authority
| link:#boost-urls-static_url-set_encoded_fragment[`set&lowbar;encoded&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`] 
| Set the host
| link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-url_base-set_encoded_params[`set&lowbar;encoded&lowbar;params`] 
| Set the query params
| link:#boost-urls-static_url-set_encoded_password[`set&lowbar;encoded&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-static_url-set_encoded_path[`set&lowbar;encoded&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-static_url-set_encoded_query[`set&lowbar;encoded&lowbar;query`] 
| Set the query
| link:#boost-urls-static_url-set_encoded_user[`set&lowbar;encoded&lowbar;user`] 
| Set the user
| link:#boost-urls-static_url-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`] 
| Set the userinfo&period;
| link:#boost-urls-static_url-set_fragment[`set&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-static_url-set_host[`set&lowbar;host`] 
| Set the host
| link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`] 
| Set the host to an address
| link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`] 
| Set the host to an address
| link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`] 
| Set the host to an address
| link:#boost-urls-static_url-set_host_name[`set&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-static_url-set_params[`set&lowbar;params`] 
| Set the query params
| link:#boost-urls-static_url-set_password[`set&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-static_url-set_path[`set&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-url_base-set_path_absolute[`set&lowbar;path&lowbar;absolute`] 
| Set if the path is absolute
| link:#boost-urls-static_url-set_port[`set&lowbar;port`] 
| Set the port
| link:#boost-urls-static_url-set_port_number[`set&lowbar;port&lowbar;number`] 
| Set the port
| link:#boost-urls-static_url-set_query[`set&lowbar;query`] 
| Set the query
| link:#boost-urls-static_url-set_scheme[`set&lowbar;scheme`] 
| Set the scheme
| link:#boost-urls-static_url-set_scheme_id[`set&lowbar;scheme&lowbar;id`] 
| Set the scheme
| link:#boost-urls-static_url-set_user[`set&lowbar;user`] 
| Set the user
| link:#boost-urls-static_url-set_userinfo[`set&lowbar;userinfo`] 
| Set the userinfo
| link:#boost-urls-url_view_base-size[`size`] 
| Return the number of characters in the url
| link:#boost-urls-url_view_base-user[`user`] 
| Return the user
| link:#boost-urls-url_view_base-userinfo[`userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-zone_id[`zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-2conversion[`operator core::string&lowbar;view`] 
| Return the URL as a core&colon;&colon;string&lowbar;view
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-digest[`digest`] 
| Calculate a hash of the url
|===

== Friends

[cols=2]
|===
| Name
| Description
| `std::&lowbar;&lowbar;1::hash`
| 
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-format_to-02[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-format_to-0b[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-operator_not_eq-040[`operator!&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_lt-04a[`operator&lt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_le-0a[`operator&lt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_eq-013[`operator&equals;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_gt-09[`operator&gt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_ge-00[`operator&gt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-resolve[`resolve`]
| Resolve a URL reference against a base 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

[cols=2]
|===
| Name
| Description
| *Capacity*
| The maximum capacity in characters, not including the null terminator&period;
|===

== See Also

link:#boost-urls-url[`url`], link:#boost-urls-url_view[`url&lowbar;view`]&period;

Constructor

== Synopses

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;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url-2constructor-098[static&lowbar;url]() noexcept;
----

[.small]#link:#boost-urls-static_url-2constructor-098[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url-2constructor-09f[static&lowbar;url](link:#boost-urls-static_url[static&lowbar;url] const& u) noexcept;
----

[.small]#link:#boost-urls-static_url-2constructor-09f[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
link:#boost-urls-static_url-2constructor-08[static&lowbar;url](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-static_url-2constructor-08[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url-2constructor-0b[static&lowbar;url](link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u);
----

[.small]#link:#boost-urls-static_url-2constructor-0b[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input does not contain a valid url&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| The url to copy&period;
| *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#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
https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[]

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(link:#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
Throws nothing&period;

== Parameters

[cols=2]
|===
| 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#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input does not contain a valid url&period;
|===

== Parameters

[cols=2]
|===
| 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#L271[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static&lowbar;url(link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| Capacity would be exceeded&period;
|===

== Parameters

[cols=2]
|===
| 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;

Assignment

== Synopses

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

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
link:#boost-urls-static_url-operator_assign-06[operator&equals;](link:#boost-urls-static_url[static&lowbar;url] const& u) noexcept;
----

[.small]#link:#boost-urls-static_url-operator_assign-06[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
link:#boost-urls-static_url-operator_assign-0c[operator&equals;](link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u);
----

[.small]#link:#boost-urls-static_url-operator_assign-0c[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| Capacity would be exceeded&period;
|===

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L299[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L332[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
operator&equals;(link:#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

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| Capacity would be exceeded&period;
|===

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| The url to copy&period;
|===

Normalize the URL components

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL authority

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL fragment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L437[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL path

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL query

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL scheme

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Remove the authority

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L356[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-static_url-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#L417[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-static_url-remove_fragment[`remove&lowbar;fragment`], link:#boost-urls-static_url-set_encoded_fragment[`set&lowbar;encoded&lowbar;fragment`], link:#boost-urls-static_url-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#L424[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

`&ast;this`

Remove the password

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/static_url.hpp#L373[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-static_url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-static_url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-static_url-set_password[`set&lowbar;password`], link:#boost-urls-static_url-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#L398[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-static_url-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#L414[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-static_url-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-static_url-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#L351[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-static_url-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#L363[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-static_url-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`], link:#boost-urls-static_url-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#L354[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;authority(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The authority string to set&period;
|===

== See Also

link:#boost-urls-static_url-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#L421[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;fragment(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_fragment[`remove&lowbar;fragment`], link:#boost-urls-static_url-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#L378[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;host(link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-static_url-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"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;host&lowbar;address(link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-static_url-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#L392[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;host&lowbar;name(link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-static_url-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#L371[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;password(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period; This string may contain any characters, including nulls&period;
|===

== See Also

link:#boost-urls-static_url-remove_password[`remove&lowbar;password`], link:#boost-urls-static_url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-static_url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-static_url-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#L405[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;path(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-static_url-set_path[`set&lowbar;path`], link:#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#L410[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;query(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-static_url-remove_query[`remove&lowbar;query`], link:#boost-urls-static_url-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#L367[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;user(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_password[`remove&lowbar;password`], link:#boost-urls-static_url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-static_url-set_password[`set&lowbar;password`], link:#boost-urls-static_url-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#L361[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;encoded&lowbar;userinfo(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_userinfo[`remove&lowbar;userinfo`], link:#boost-urls-static_url-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#L419[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_fragment[`remove&lowbar;fragment`], link:#boost-urls-static_url-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#L376[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-static_url-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"]
----
link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-static_url-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"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;host&lowbar;ipv4(link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& addr);
----

== Description

The host is set to the specified IPv4 address&period; The host type is link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *addr*
| The address to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-static_url-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"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;host&lowbar;ipv6(link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& addr);
----

== Description

The host is set to the specified IPv6 address&period; The host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *addr*
| The address to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-static_url-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#L388[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-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"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-static_url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-static_url-set_host[`set&lowbar;host`], link:#boost-urls-static_url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-static_url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-static_url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-static_url-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#L412[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;params(
    std::initializer&lowbar;list&lt;param&lowbar;view&gt; ps,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
            >3.4.  Query (rfc3986)</a>
        @li <a href=[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *ps*
| The params to set&period;
| *opts*
| The options for encoding&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-static_url-remove_query[`remove&lowbar;query`], link:#boost-urls-static_url-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-static_url-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#L369[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period; This string may contain any characters, including nulls&period;
|===

== See Also

link:#boost-urls-static_url-remove_password[`remove&lowbar;password`], link:#boost-urls-static_url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-static_url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-static_url-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"]
----
link:#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 link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`] or link:#boost-urls-url_base-segments-07[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-static_url-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#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#L396[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The port string to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_port[`remove&lowbar;port`], link:#boost-urls-static_url-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#L394[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *n*
| The port number to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_port[`remove&lowbar;port`], link:#boost-urls-static_url-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#L408[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-static_url-remove_query[`remove&lowbar;query`], link:#boost-urls-static_url-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#L347[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The scheme to set&period;
|===

== See Also

link:#boost-urls-static_url-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#L349[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-static_url[static&lowbar;url]&
set&lowbar;scheme&lowbar;id(link:#boost-urls-scheme[urls::scheme] id);
----

== Description

This function sets the scheme to the specified known link:#boost-urls-scheme[`urls&colon;&colon;scheme`] id, which may not be link:#boost-urls-scheme[`scheme&colon;&colon;unknown`] or else an exception is thrown&period; If the id is link:#boost-urls-scheme[`scheme&colon;&colon;none`], this function behaves as if link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| 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#L365[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_password[`remove&lowbar;password`], link:#boost-urls-static_url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-static_url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-static_url-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#L359[boost&sol;url&sol;static&lowbar;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-static_url-remove_userinfo[`remove&lowbar;userinfo`], link:#boost-urls-static_url-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`]&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 link:#boost-urls-url_base[url&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-url_base[url&lowbar;base]`
| Common functionality for containers
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-authority[`authority`] 
| Return the authority
| link:#boost-urls-url_view_base-buffer[`buffer`] 
| Return the url string
| link:#boost-urls-url_base-c_str[`c&lowbar;str`] 
| Return the url as a null&hyphen;terminated string
| link:#boost-urls-url_base-capacity[`capacity`] 
| Return the number of characters that can be stored without reallocating
| link:#boost-urls-url_base-clear[`clear`] 
| Clear the contents while preserving the capacity
| link:#boost-urls-url_view_base-compare[`compare`] 
| Return the result of comparing this with another url
| link:#boost-urls-url_view_base-data[`data`] 
| Return a pointer to the url&apos;s character buffer
| link:#boost-urls-url_view_base-empty[`empty`] 
| Return true if the url is empty
| link:#boost-urls-url_view_base-encoded_authority[`encoded&lowbar;authority`] 
| Return the authority&period;
| link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-encoded_host[`encoded&lowbar;host`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_address[`encoded&lowbar;host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`] 
| Return the host and port
| link:#boost-urls-url_view_base-encoded_host_name[`encoded&lowbar;host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`] 
| Return the origin
| link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`] 
| Return the password
| link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`] 
| Return the path
| link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`] 
| Return the query
| link:#boost-urls-url_view_base-encoded_resource[`encoded&lowbar;resource`] 
| Return the resource
| link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-encoded_target[`encoded&lowbar;target`] 
| Return the target
| link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`] 
| Return the user
| link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-encoded_zone_id[`encoded&lowbar;zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-fragment[`fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-has_authority[`has&lowbar;authority`] 
| Return true if an authority is present
| link:#boost-urls-url_view_base-has_fragment[`has&lowbar;fragment`] 
| Return true if a fragment is present
| link:#boost-urls-url_view_base-has_password[`has&lowbar;password`] 
| Return true if a password is present
| link:#boost-urls-url_view_base-has_port[`has&lowbar;port`] 
| Return true if a port is present
| link:#boost-urls-url_view_base-has_query[`has&lowbar;query`] 
| Return true if a query is present
| link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`] 
| Return true a scheme is present
| link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`] 
| Return true if a userinfo is present
| link:#boost-urls-url_view_base-host[`host`] 
| Return the host
| link:#boost-urls-url_view_base-host_address[`host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-host_ipv4_address[`host&lowbar;ipv4&lowbar;address`] 
| Return the host IPv4 address
| link:#boost-urls-url_view_base-host_ipv6_address[`host&lowbar;ipv6&lowbar;address`] 
| Return the host IPv6 address
| link:#boost-urls-url_view_base-host_ipvfuture[`host&lowbar;ipvfuture`] 
| Return the host IPvFuture address
| link:#boost-urls-url_view_base-host_name[`host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-host_type[`host&lowbar;type`] 
| Return the host type
| link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`] 
| Return true if the path is absolute
| link:#boost-urls-url_base-normalize[`normalize`] 
| Normalize the URL components
| link:#boost-urls-url_base-normalize_authority[`normalize&lowbar;authority`] 
| Normalize the URL authority
| link:#boost-urls-url_base-normalize_fragment[`normalize&lowbar;fragment`] 
| Normalize the URL fragment
| link:#boost-urls-url_base-normalize_path[`normalize&lowbar;path`] 
| Normalize the URL path
| link:#boost-urls-url_base-normalize_query[`normalize&lowbar;query`] 
| Normalize the URL query
| link:#boost-urls-url_base-normalize_scheme[`normalize&lowbar;scheme`] 
| Normalize the URL scheme
| link:#boost-urls-url_base-params-0c1[`params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-password[`password`] 
| Return the password
| link:#boost-urls-url_view_base-path[`path`] 
| Return the path
| link:#boost-urls-url_view_base-persist[`persist`] 
| Return a shared, persistent copy of the url
| link:#boost-urls-url_view_base-port[`port`] 
| Return the port
| link:#boost-urls-url_view_base-port_number[`port&lowbar;number`] 
| Return the port
| link:#boost-urls-url_view_base-query[`query`] 
| Return the query
| link:#boost-urls-url_base-remove_authority[`remove&lowbar;authority`] 
| Remove the authority
| link:#boost-urls-url_base-remove_fragment[`remove&lowbar;fragment`] 
| Remove the fragment
| link:#boost-urls-url_base-remove_origin[`remove&lowbar;origin`] 
| Remove the origin component
| link:#boost-urls-url_base-remove_password[`remove&lowbar;password`] 
| Remove the password
| link:#boost-urls-url_base-remove_port[`remove&lowbar;port`] 
| Remove the port
| link:#boost-urls-url_base-remove_query[`remove&lowbar;query`] 
| Remove the query
| link:#boost-urls-url_base-remove_scheme[`remove&lowbar;scheme`] 
| Remove the scheme
| link:#boost-urls-url_base-remove_userinfo[`remove&lowbar;userinfo`] 
| Remove the userinfo
| link:#boost-urls-url_base-reserve[`reserve`] 
| Adjust the capacity without changing the size
| link:#boost-urls-url_base-resolve[`resolve`] 
| Resolve a URL reference against this base URL
| link:#boost-urls-url_view_base-scheme[`scheme`] 
| Return the scheme
| link:#boost-urls-url_view_base-scheme_id[`scheme&lowbar;id`] 
| Return the scheme
| link:#boost-urls-url_base-segments-07[`segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_base-set_encoded_authority[`set&lowbar;encoded&lowbar;authority`] 
| Set the authority
| link:#boost-urls-url_base-set_encoded_fragment[`set&lowbar;encoded&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`] 
| Set the host
| link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-url_base-set_encoded_params[`set&lowbar;encoded&lowbar;params`] 
| Set the query params
| link:#boost-urls-url_base-set_encoded_password[`set&lowbar;encoded&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`] 
| Set the query
| link:#boost-urls-url_base-set_encoded_user[`set&lowbar;encoded&lowbar;user`] 
| Set the user
| link:#boost-urls-url_base-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`] 
| Set the userinfo&period;
| link:#boost-urls-url_base-set_fragment[`set&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-url_base-set_host[`set&lowbar;host`] 
| Set the host
| link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_name[`set&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-url_base-set_params[`set&lowbar;params`] 
| Set the query params
| link:#boost-urls-url_base-set_password[`set&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-url_base-set_path[`set&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-url_base-set_path_absolute[`set&lowbar;path&lowbar;absolute`] 
| Set if the path is absolute
| link:#boost-urls-url_base-set_port[`set&lowbar;port`] 
| Set the port
| link:#boost-urls-url_base-set_port_number[`set&lowbar;port&lowbar;number`] 
| Set the port
| link:#boost-urls-url_base-set_query[`set&lowbar;query`] 
| Set the query
| link:#boost-urls-url_base-set_scheme[`set&lowbar;scheme`] 
| Set the scheme
| link:#boost-urls-url_base-set_scheme_id[`set&lowbar;scheme&lowbar;id`] 
| Set the scheme
| link:#boost-urls-url_base-set_user[`set&lowbar;user`] 
| Set the user
| link:#boost-urls-url_base-set_userinfo[`set&lowbar;userinfo`] 
| Set the userinfo
| link:#boost-urls-url_view_base-size[`size`] 
| Return the number of characters in the url
| link:#boost-urls-url_view_base-user[`user`] 
| Return the user
| link:#boost-urls-url_view_base-userinfo[`userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-zone_id[`zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-2conversion[`operator core::string&lowbar;view`] 
| Return the URL as a core&colon;&colon;string&lowbar;view
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-digest[`digest`] 
| Calculate a hash of the url
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-static_url[boost::urls::static&lowbar;url]`
| A modifiable container for a URL&period;
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-format_to-02[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-format_to-0b[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-operator_not_eq-040[`operator!&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_lt-04a[`operator&lt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_le-0a[`operator&lt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_eq-013[`operator&equals;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_gt-09[`operator&gt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_ge-00[`operator&gt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-resolve[`resolve`]
| Resolve a URL reference against a base URL
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-static_url[`static&lowbar;url`]
| A modifiable container for a URL&period;
|===

== 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`

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 link:#boost-urls-url_base[url&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-url_base[url&lowbar;base]`
| Common functionality for containers
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url-2constructor-0a[`url`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-url-2destructor[`&#126;url`] [.small]#[destructor]# [.small]#[virtual]#
| Destructor
| link:#boost-urls-url-operator_assign-064[`operator&equals;`] 
| Assignment
| link:#boost-urls-url_view_base-authority[`authority`] 
| Return the authority
| link:#boost-urls-url_view_base-buffer[`buffer`] 
| Return the url string
| link:#boost-urls-url_base-c_str[`c&lowbar;str`] 
| Return the url as a null&hyphen;terminated string
| link:#boost-urls-url_base-capacity[`capacity`] 
| Return the number of characters that can be stored without reallocating
| link:#boost-urls-url_base-clear[`clear`] 
| Clear the contents while preserving the capacity
| link:#boost-urls-url_view_base-compare[`compare`] 
| Return the result of comparing this with another url
| link:#boost-urls-url_view_base-data[`data`] 
| Return a pointer to the url&apos;s character buffer
| link:#boost-urls-url_view_base-empty[`empty`] 
| Return true if the url is empty
| link:#boost-urls-url_view_base-encoded_authority[`encoded&lowbar;authority`] 
| Return the authority&period;
| link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-encoded_host[`encoded&lowbar;host`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_address[`encoded&lowbar;host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`] 
| Return the host and port
| link:#boost-urls-url_view_base-encoded_host_name[`encoded&lowbar;host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`] 
| Return the origin
| link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`] 
| Return the password
| link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`] 
| Return the path
| link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`] 
| Return the query
| link:#boost-urls-url_view_base-encoded_resource[`encoded&lowbar;resource`] 
| Return the resource
| link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-encoded_target[`encoded&lowbar;target`] 
| Return the target
| link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`] 
| Return the user
| link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-encoded_zone_id[`encoded&lowbar;zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-fragment[`fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-has_authority[`has&lowbar;authority`] 
| Return true if an authority is present
| link:#boost-urls-url_view_base-has_fragment[`has&lowbar;fragment`] 
| Return true if a fragment is present
| link:#boost-urls-url_view_base-has_password[`has&lowbar;password`] 
| Return true if a password is present
| link:#boost-urls-url_view_base-has_port[`has&lowbar;port`] 
| Return true if a port is present
| link:#boost-urls-url_view_base-has_query[`has&lowbar;query`] 
| Return true if a query is present
| link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`] 
| Return true a scheme is present
| link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`] 
| Return true if a userinfo is present
| link:#boost-urls-url_view_base-host[`host`] 
| Return the host
| link:#boost-urls-url_view_base-host_address[`host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-host_ipv4_address[`host&lowbar;ipv4&lowbar;address`] 
| Return the host IPv4 address
| link:#boost-urls-url_view_base-host_ipv6_address[`host&lowbar;ipv6&lowbar;address`] 
| Return the host IPv6 address
| link:#boost-urls-url_view_base-host_ipvfuture[`host&lowbar;ipvfuture`] 
| Return the host IPvFuture address
| link:#boost-urls-url_view_base-host_name[`host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-host_type[`host&lowbar;type`] 
| Return the host type
| link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`] 
| Return true if the path is absolute
| link:#boost-urls-url-normalize[`normalize`] 
| Normalize the URL components
| link:#boost-urls-url-normalize_authority[`normalize&lowbar;authority`] 
| Normalize the URL authority
| link:#boost-urls-url-normalize_fragment[`normalize&lowbar;fragment`] 
| Normalize the URL fragment
| link:#boost-urls-url-normalize_path[`normalize&lowbar;path`] 
| Normalize the URL path
| link:#boost-urls-url-normalize_query[`normalize&lowbar;query`] 
| Normalize the URL query
| link:#boost-urls-url-normalize_scheme[`normalize&lowbar;scheme`] 
| Normalize the URL scheme
| link:#boost-urls-url_base-params-0c1[`params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-password[`password`] 
| Return the password
| link:#boost-urls-url_view_base-path[`path`] 
| Return the path
| link:#boost-urls-url_view_base-persist[`persist`] 
| Return a shared, persistent copy of the url
| link:#boost-urls-url_view_base-port[`port`] 
| Return the port
| link:#boost-urls-url_view_base-port_number[`port&lowbar;number`] 
| Return the port
| link:#boost-urls-url_view_base-query[`query`] 
| Return the query
| link:#boost-urls-url-remove_authority[`remove&lowbar;authority`] 
| Remove the authority
| link:#boost-urls-url-remove_fragment[`remove&lowbar;fragment`] 
| Remove the fragment
| link:#boost-urls-url-remove_origin[`remove&lowbar;origin`] 
| Remove the origin component
| link:#boost-urls-url-remove_password[`remove&lowbar;password`] 
| Remove the password
| link:#boost-urls-url-remove_port[`remove&lowbar;port`] 
| Remove the port
| link:#boost-urls-url-remove_query[`remove&lowbar;query`] 
| Remove the query
| link:#boost-urls-url-remove_scheme[`remove&lowbar;scheme`] 
| Remove the scheme
| link:#boost-urls-url-remove_userinfo[`remove&lowbar;userinfo`] 
| Remove the userinfo
| link:#boost-urls-url_base-reserve[`reserve`] 
| Adjust the capacity without changing the size
| link:#boost-urls-url_base-resolve[`resolve`] 
| Resolve a URL reference against this base URL
| link:#boost-urls-url_view_base-scheme[`scheme`] 
| Return the scheme
| link:#boost-urls-url_view_base-scheme_id[`scheme&lowbar;id`] 
| Return the scheme
| link:#boost-urls-url_base-segments-07[`segments`] 
| Return the path as a container of segments
| link:#boost-urls-url-set_encoded_authority[`set&lowbar;encoded&lowbar;authority`] 
| Set the authority
| link:#boost-urls-url-set_encoded_fragment[`set&lowbar;encoded&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`] 
| Set the host
| link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-url-set_encoded_params[`set&lowbar;encoded&lowbar;params`] 
| Set the query params
| link:#boost-urls-url-set_encoded_password[`set&lowbar;encoded&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-url-set_encoded_path[`set&lowbar;encoded&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-url-set_encoded_query[`set&lowbar;encoded&lowbar;query`] 
| Set the query
| link:#boost-urls-url-set_encoded_user[`set&lowbar;encoded&lowbar;user`] 
| Set the user
| link:#boost-urls-url-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`] 
| Set the userinfo&period;
| link:#boost-urls-url-set_fragment[`set&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-url-set_host[`set&lowbar;host`] 
| Set the host
| link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`] 
| Set the host to an address
| link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`] 
| Set the host to an address
| link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`] 
| Set the host to an address
| link:#boost-urls-url-set_host_name[`set&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-url-set_params[`set&lowbar;params`] 
| Set the query params
| link:#boost-urls-url-set_password[`set&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-url-set_path[`set&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-url_base-set_path_absolute[`set&lowbar;path&lowbar;absolute`] 
| Set if the path is absolute
| link:#boost-urls-url-set_port[`set&lowbar;port`] 
| Set the port
| link:#boost-urls-url-set_port_number[`set&lowbar;port&lowbar;number`] 
| Set the port
| link:#boost-urls-url-set_query[`set&lowbar;query`] 
| Set the query
| link:#boost-urls-url-set_scheme[`set&lowbar;scheme`] 
| Set the scheme
| link:#boost-urls-url-set_scheme_id[`set&lowbar;scheme&lowbar;id`] 
| Set the scheme
| link:#boost-urls-url-set_user[`set&lowbar;user`] 
| Set the user
| link:#boost-urls-url-set_userinfo[`set&lowbar;userinfo`] 
| Set the userinfo
| link:#boost-urls-url_view_base-size[`size`] 
| Return the number of characters in the url
| link:#boost-urls-url-swap[`swap`] 
| Swap the contents&period;
| link:#boost-urls-url_view_base-user[`user`] 
| Return the user
| link:#boost-urls-url_view_base-userinfo[`userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-zone_id[`zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-2conversion[`operator core::string&lowbar;view`] 
| Return the URL as a core&colon;&colon;string&lowbar;view
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-digest[`digest`] 
| Calculate a hash of the url
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-swap[boost::urls::swap]`
| Swap
| `std::hash&lt;url&gt;`
|
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-format-02[`format`]
| Format arguments into a URL
| link:#boost-urls-format-05[`format`]
| Format arguments into a URL
| link:#boost-urls-format_to-02[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-format_to-0b[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-operator_not_eq-040[`operator!&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_lt-04a[`operator&lt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_le-0a[`operator&lt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_eq-013[`operator&equals;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_gt-09[`operator&gt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_ge-00[`operator&gt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-resolve[`resolve`]
| Resolve a URL reference against a base 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
* https://tools.ietf.org/html/rfc3986[]

== See Also

link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`], link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`], link:#boost-urls-parse_uri[`parse&lowbar;uri`], link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`], link:#boost-urls-url_base-resolve[`resolve`]&period;

Constructor

== Synopses

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;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url-2constructor-0f0[url]() noexcept;
----

[.small]#link:#boost-urls-url-2constructor-0f0[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url-2constructor-0f7[url](link:#boost-urls-url[url] const& u);
----

[.small]#link:#boost-urls-url-2constructor-0f7[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url-2constructor-01[url](link:#boost-urls-url[url]&& u) noexcept;
----

[.small]#link:#boost-urls-url-2constructor-01[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
link:#boost-urls-url-2constructor-002[url](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-url-2constructor-002[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url-2constructor-001[url](link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u);
----

[.small]#link:#boost-urls-url-2constructor-001[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;
| `system&lowbar;error`
| The input does not contain a valid url&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| The url to copy&period;
| *s*
| The string to parse&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
https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[]

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(link:#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

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;
|===

== Parameters

[cols=2]
|===
| 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#L194[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url(link:#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

[cols=2]
|===
| 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#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input does not contain a valid url&period;
|===

== Parameters

[cols=2]
|===
| 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#L217[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url(link:#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

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;
|===

== Parameters

[cols=2]
|===
| 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;

Assignment

== Synopses

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

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
link:#boost-urls-url-operator_assign-063[operator&equals;](link:#boost-urls-url[url] const& u);
----

[.small]#link:#boost-urls-url-operator_assign-063[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
link:#boost-urls-url-operator_assign-09[operator&equals;](link:#boost-urls-url[url]&& u) noexcept;
----

[.small]#link:#boost-urls-url-operator_assign-09[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
link:#boost-urls-url-operator_assign-0b[operator&equals;](link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u);
----

[.small]#link:#boost-urls-url-operator_assign-0b[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;
|===

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L329[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L272[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| 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#L299[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
operator&equals;(link:#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

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;
|===

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| The url to copy&period;
|===

Normalize the URL components

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL authority

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL fragment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL path

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL query

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL scheme

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Remove the authority

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url-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#L485[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url-remove_fragment[`remove&lowbar;fragment`], link:#boost-urls-url-set_encoded_fragment[`set&lowbar;encoded&lowbar;fragment`], link:#boost-urls-url-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#L492[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

`&ast;this`

Remove the password

== 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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-url-set_password[`set&lowbar;password`], link:#boost-urls-url-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#L464[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url-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#L482[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-url-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#L417[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url-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#L429[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`], link:#boost-urls-url-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#L420[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;authority(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The authority string to set&period;
|===

== See Also

link:#boost-urls-url-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#L489[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;fragment(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-remove_fragment[`remove&lowbar;fragment`], link:#boost-urls-url-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#L444[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;host(link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-url-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#L448[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;host&lowbar;address(link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-url-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#L458[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;host&lowbar;name(link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-url-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#L480[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;params(std::initializer&lowbar;list&lt;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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *ps*
| The params to set&period;
|===

== See Also

link:#boost-urls-url-set_params[`set&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url-remove_query[`remove&lowbar;query`], link:#boost-urls-url-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-url-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#L437[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;password(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period; This string may contain any characters, including nulls&period;
|===

== See Also

link:#boost-urls-url-remove_password[`remove&lowbar;password`], link:#boost-urls-url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-url-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#L471[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;path(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-url-set_path[`set&lowbar;path`], link:#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#L476[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;query(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url-remove_query[`remove&lowbar;query`], link:#boost-urls-url-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#L433[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;user(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-remove_password[`remove&lowbar;password`], link:#boost-urls-url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url-set_password[`set&lowbar;password`], link:#boost-urls-url-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#L427[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;encoded&lowbar;userinfo(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-remove_userinfo[`remove&lowbar;userinfo`], link:#boost-urls-url-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#L487[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-remove_fragment[`remove&lowbar;fragment`], link:#boost-urls-url-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#L442[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-url-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#L446[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-url-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#L450[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;host&lowbar;ipv4(link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& addr);
----

== Description

The host is set to the specified IPv4 address&period; The host type is link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *addr*
| The address to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-url-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#L452[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;host&lowbar;ipv6(link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& addr);
----

== Description

The host is set to the specified IPv6 address&period; The host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *addr*
| The address to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#boost-urls-url-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#L454[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-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#L456[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url-set_host[`set&lowbar;host`], link:#boost-urls-url-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url-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#L478[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;params(
    std::initializer&lowbar;list&lt;param&lowbar;view&gt; ps,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
            >3.4.  Query (rfc3986)</a>
        @li <a href=[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *ps*
| The params to set&period;
| *opts*
| The options for encoding&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url-remove_query[`remove&lowbar;query`], link:#boost-urls-url-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-url-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#L435[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period; This string may contain any characters, including nulls&period;
|===

== See Also

link:#boost-urls-url-remove_password[`remove&lowbar;password`], link:#boost-urls-url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-url-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#L469[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`] or link:#boost-urls-url_base-segments-07[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-url-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#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#L462[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The port string to set&period;
|===

== See Also

link:#boost-urls-url-remove_port[`remove&lowbar;port`], link:#boost-urls-url-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#L460[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *n*
| The port number to set&period;
|===

== See Also

link:#boost-urls-url-remove_port[`remove&lowbar;port`], link:#boost-urls-url-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#L474[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url-remove_query[`remove&lowbar;query`], link:#boost-urls-url-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#L413[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The scheme to set&period;
|===

== See Also

link:#boost-urls-url-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#L415[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]&
set&lowbar;scheme&lowbar;id(link:#boost-urls-scheme[urls::scheme] id);
----

== Description

This function sets the scheme to the specified known link:#boost-urls-scheme[`urls&colon;&colon;scheme`] id, which may not be link:#boost-urls-scheme[`scheme&colon;&colon;unknown`] or else an exception is thrown&period; If the id is link:#boost-urls-scheme[`scheme&colon;&colon;none`], this function behaves as if link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| 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#L431[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-remove_password[`remove&lowbar;password`], link:#boost-urls-url-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-url-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#L425[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url-remove_userinfo[`remove&lowbar;userinfo`], link:#boost-urls-url-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#L363[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(link:#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

[cols=2]
|===
| Name
| Description
| *other*
| The object to swap with
|===

Common functionality for containers

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class url&lowbar;base
    : public link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-authority[`authority`] 
| Return the authority
| link:#boost-urls-url_view_base-buffer[`buffer`] 
| Return the url string
| link:#boost-urls-url_base-c_str[`c&lowbar;str`] 
| Return the url as a null&hyphen;terminated string
| link:#boost-urls-url_base-capacity[`capacity`] 
| Return the number of characters that can be stored without reallocating
| link:#boost-urls-url_base-clear[`clear`] 
| Clear the contents while preserving the capacity
| link:#boost-urls-url_view_base-compare[`compare`] 
| Return the result of comparing this with another url
| link:#boost-urls-url_view_base-data[`data`] 
| Return a pointer to the url&apos;s character buffer
| link:#boost-urls-url_view_base-empty[`empty`] 
| Return true if the url is empty
| link:#boost-urls-url_view_base-encoded_authority[`encoded&lowbar;authority`] 
| Return the authority&period;
| link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-encoded_host[`encoded&lowbar;host`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_address[`encoded&lowbar;host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`] 
| Return the host and port
| link:#boost-urls-url_view_base-encoded_host_name[`encoded&lowbar;host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`] 
| Return the origin
| link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`] 
| Return the password
| link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`] 
| Return the path
| link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`] 
| Return the query
| link:#boost-urls-url_view_base-encoded_resource[`encoded&lowbar;resource`] 
| Return the resource
| link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-encoded_target[`encoded&lowbar;target`] 
| Return the target
| link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`] 
| Return the user
| link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-encoded_zone_id[`encoded&lowbar;zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-fragment[`fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-has_authority[`has&lowbar;authority`] 
| Return true if an authority is present
| link:#boost-urls-url_view_base-has_fragment[`has&lowbar;fragment`] 
| Return true if a fragment is present
| link:#boost-urls-url_view_base-has_password[`has&lowbar;password`] 
| Return true if a password is present
| link:#boost-urls-url_view_base-has_port[`has&lowbar;port`] 
| Return true if a port is present
| link:#boost-urls-url_view_base-has_query[`has&lowbar;query`] 
| Return true if a query is present
| link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`] 
| Return true a scheme is present
| link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`] 
| Return true if a userinfo is present
| link:#boost-urls-url_view_base-host[`host`] 
| Return the host
| link:#boost-urls-url_view_base-host_address[`host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-host_ipv4_address[`host&lowbar;ipv4&lowbar;address`] 
| Return the host IPv4 address
| link:#boost-urls-url_view_base-host_ipv6_address[`host&lowbar;ipv6&lowbar;address`] 
| Return the host IPv6 address
| link:#boost-urls-url_view_base-host_ipvfuture[`host&lowbar;ipvfuture`] 
| Return the host IPvFuture address
| link:#boost-urls-url_view_base-host_name[`host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-host_type[`host&lowbar;type`] 
| Return the host type
| link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`] 
| Return true if the path is absolute
| link:#boost-urls-url_base-normalize[`normalize`] 
| Normalize the URL components
| link:#boost-urls-url_base-normalize_authority[`normalize&lowbar;authority`] 
| Normalize the URL authority
| link:#boost-urls-url_base-normalize_fragment[`normalize&lowbar;fragment`] 
| Normalize the URL fragment
| link:#boost-urls-url_base-normalize_path[`normalize&lowbar;path`] 
| Normalize the URL path
| link:#boost-urls-url_base-normalize_query[`normalize&lowbar;query`] 
| Normalize the URL query
| link:#boost-urls-url_base-normalize_scheme[`normalize&lowbar;scheme`] 
| Normalize the URL scheme
| link:#boost-urls-url_base-params-0c1[`params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-password[`password`] 
| Return the password
| link:#boost-urls-url_view_base-path[`path`] 
| Return the path
| link:#boost-urls-url_view_base-persist[`persist`] 
| Return a shared, persistent copy of the url
| link:#boost-urls-url_view_base-port[`port`] 
| Return the port
| link:#boost-urls-url_view_base-port_number[`port&lowbar;number`] 
| Return the port
| link:#boost-urls-url_view_base-query[`query`] 
| Return the query
| link:#boost-urls-url_base-remove_authority[`remove&lowbar;authority`] 
| Remove the authority
| link:#boost-urls-url_base-remove_fragment[`remove&lowbar;fragment`] 
| Remove the fragment
| link:#boost-urls-url_base-remove_origin[`remove&lowbar;origin`] 
| Remove the origin component
| link:#boost-urls-url_base-remove_password[`remove&lowbar;password`] 
| Remove the password
| link:#boost-urls-url_base-remove_port[`remove&lowbar;port`] 
| Remove the port
| link:#boost-urls-url_base-remove_query[`remove&lowbar;query`] 
| Remove the query
| link:#boost-urls-url_base-remove_scheme[`remove&lowbar;scheme`] 
| Remove the scheme
| link:#boost-urls-url_base-remove_userinfo[`remove&lowbar;userinfo`] 
| Remove the userinfo
| link:#boost-urls-url_base-reserve[`reserve`] 
| Adjust the capacity without changing the size
| link:#boost-urls-url_base-resolve[`resolve`] 
| Resolve a URL reference against this base URL
| link:#boost-urls-url_view_base-scheme[`scheme`] 
| Return the scheme
| link:#boost-urls-url_view_base-scheme_id[`scheme&lowbar;id`] 
| Return the scheme
| link:#boost-urls-url_base-segments-07[`segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_base-set_encoded_authority[`set&lowbar;encoded&lowbar;authority`] 
| Set the authority
| link:#boost-urls-url_base-set_encoded_fragment[`set&lowbar;encoded&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`] 
| Set the host
| link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-url_base-set_encoded_params[`set&lowbar;encoded&lowbar;params`] 
| Set the query params
| link:#boost-urls-url_base-set_encoded_password[`set&lowbar;encoded&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`] 
| Set the query
| link:#boost-urls-url_base-set_encoded_user[`set&lowbar;encoded&lowbar;user`] 
| Set the user
| link:#boost-urls-url_base-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`] 
| Set the userinfo&period;
| link:#boost-urls-url_base-set_fragment[`set&lowbar;fragment`] 
| Set the fragment&period;
| link:#boost-urls-url_base-set_host[`set&lowbar;host`] 
| Set the host
| link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`] 
| Set the host to an address
| link:#boost-urls-url_base-set_host_name[`set&lowbar;host&lowbar;name`] 
| Set the host to a name
| link:#boost-urls-url_base-set_params[`set&lowbar;params`] 
| Set the query params
| link:#boost-urls-url_base-set_password[`set&lowbar;password`] 
| Set the password&period;
| link:#boost-urls-url_base-set_path[`set&lowbar;path`] 
| Set the path&period;
| link:#boost-urls-url_base-set_path_absolute[`set&lowbar;path&lowbar;absolute`] 
| Set if the path is absolute
| link:#boost-urls-url_base-set_port[`set&lowbar;port`] 
| Set the port
| link:#boost-urls-url_base-set_port_number[`set&lowbar;port&lowbar;number`] 
| Set the port
| link:#boost-urls-url_base-set_query[`set&lowbar;query`] 
| Set the query
| link:#boost-urls-url_base-set_scheme[`set&lowbar;scheme`] 
| Set the scheme
| link:#boost-urls-url_base-set_scheme_id[`set&lowbar;scheme&lowbar;id`] 
| Set the scheme
| link:#boost-urls-url_base-set_user[`set&lowbar;user`] 
| Set the user
| link:#boost-urls-url_base-set_userinfo[`set&lowbar;userinfo`] 
| Set the userinfo
| link:#boost-urls-url_view_base-size[`size`] 
| Return the number of characters in the url
| link:#boost-urls-url_view_base-user[`user`] 
| Return the user
| link:#boost-urls-url_view_base-userinfo[`userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-zone_id[`zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-2conversion[`operator core::string&lowbar;view`] 
| Return the URL as a core&colon;&colon;string&lowbar;view
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-digest[`digest`] 
| Calculate a hash of the url
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-resolve[boost::urls::resolve]`
| Resolve a URL reference against a base URL
| `link:#boost-urls-params_encoded_ref[boost::urls::params&lowbar;encoded&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-segments_encoded_ref[boost::urls::segments&lowbar;encoded&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_ref[boost::urls::segments&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-params_ref[boost::urls::params&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-static_url_base[boost::urls::static&lowbar;url&lowbar;base]`
| Common implementation for all static URLs
| `link:#boost-urls-url[boost::urls::url]`
| A modifiable container for a URL&period;
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-format_to-02[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-format_to-0b[`format&lowbar;to`]
| Format arguments into a URL
| link:#boost-urls-operator_not_eq-040[`operator!&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_lt-04a[`operator&lt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_le-0a[`operator&lt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_eq-013[`operator&equals;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_gt-09[`operator&gt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_ge-00[`operator&gt;&equals;`]
| Return the result of comparing two URLs
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-static_url_base[`static&lowbar;url&lowbar;base`]
| Common implementation for all static URLs
| link:#boost-urls-url[`url`]
| A modifiable container for a URL&period;
|===

== 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#L128[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 Value

A pointer to a null&hyphen;terminated string containing the URL&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;

== Return Value

`&ast;this`

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

== Synopses

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

Return the query as a container of parameters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_ref[params&lowbar;encoded&lowbar;ref]
link:#boost-urls-url_base-encoded_params-06[encoded&lowbar;params]() noexcept;
----

[.small]#link:#boost-urls-url_base-encoded_params-06[_» more&period;&period;&period;_]#

Return the query as a container of parameters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_encoded_view[params&lowbar;encoded&lowbar;view]
link:#boost-urls-url_base-encoded_params-02[encoded&lowbar;params]() const noexcept;
----

[.small]#link:#boost-urls-url_base-encoded_params-02[_» more&period;&period;&period;_]#

== Return Value

* `&ast;this`
* A bidirectional view of key&sol;value pairs&period;

== See Also

link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-url_base-set_query[`set&lowbar;query`]&period;

link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#boost-urls-url_base-params-0c1[`params`], link:#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#L2244[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#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#L2192[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

A bidirectional view of key&sol;value pairs&period;

== See Also

link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url_view_base-query[`query`]&period;

Return the path as a container of segments

== Synopses

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

Return the path as a container of segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_ref[segments&lowbar;encoded&lowbar;ref]
link:#boost-urls-url_base-encoded_segments-0e8[encoded&lowbar;segments]() noexcept;
----

[.small]#link:#boost-urls-url_base-encoded_segments-0e8[_» more&period;&period;&period;_]#

Return the path as a container of segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_encoded_view[segments&lowbar;encoded&lowbar;view]
link:#boost-urls-url_base-encoded_segments-0e5[encoded&lowbar;segments]() const noexcept;
----

[.small]#link:#boost-urls-url_base-encoded_segments-0e5[_» more&period;&period;&period;_]#

== Return Value

* `&ast;this`
* A bidirectional view of encoded segments&period;

== See Also

link:#boost-urls-url_base-encoded_segments-0e8[`encoded&lowbar;segments`], link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#boost-urls-url_base-set_path[`set&lowbar;path`], link:#boost-urls-url_base-set_path_absolute[`set&lowbar;path&lowbar;absolute`]&period;

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_view_base-path[`path`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-segments_encoded_view[`segments&lowbar;encoded&lowbar;view`]&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#L1958[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#boost-urls-url_base-set_path[`set&lowbar;path`], link:#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#L1962[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

A bidirectional view of encoded segments&period;

== See Also

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_view_base-path[`path`], link:#boost-urls-url_base-segments-07[`segments`], link:#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#L2613[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL authority

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL fragment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL path

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL query

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Normalize the URL scheme

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`&ast;this`

Return the query as a container of parameters

== Synopses

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

Return the query as a container of parameters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref[params&lowbar;ref]
link:#boost-urls-url_base-params-03[params]() noexcept;
----

[.small]#link:#boost-urls-url_base-params-03[_» more&period;&period;&period;_]#

Return the query as a container of parameters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]
link:#boost-urls-url_base-params-0b[params]() const noexcept;
----

[.small]#link:#boost-urls-url_base-params-0b[_» more&period;&period;&period;_]#

Return the query as a container of parameters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref[params&lowbar;ref]
link:#boost-urls-url_base-params-0c8[params](link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt) noexcept;
----

[.small]#link:#boost-urls-url_base-params-0c8[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]
link:#boost-urls-url_view_base-params-05[params](link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt) const noexcept;
----

[.small]#link:#boost-urls-url_view_base-params-05[_» more&period;&period;&period;_]#

== Return Value

* `&ast;this`
* A bidirectional view of key&sol;value pairs&period;
* A range of references to the parameters&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *opt*
| The options for decoding&period; If this parameter is omitted, the `space&lowbar;as&lowbar;plus` is used&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-url_base-set_query[`set&lowbar;query`]&period;

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#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#L2126[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#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#L2130[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]
params() const noexcept;
----

== Return Value

A bidirectional view of key&sol;value pairs&period;

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#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#L2188[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_ref[params&lowbar;ref]
params(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

A range of references to the parameters&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *opt*
| The options for decoding&period; If this parameter is omitted, the `space&lowbar;as&lowbar;plus` is used&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#boost-urls-url_base-set_query[`set&lowbar;query`]&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]
params(link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt) const noexcept;
----

Remove the authority

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

`&ast;this`

== See Also

link:#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#L2454[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-remove_fragment[`remove&lowbar;fragment`], link:#boost-urls-url_base-set_encoded_fragment[`set&lowbar;encoded&lowbar;fragment`], link:#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#L2588[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

`&ast;this`

Remove the password

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url_base-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#boost-urls-url_base-set_password[`set&lowbar;password`], link:#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#L1640[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== See Also

link:#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#L2407[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#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#L319[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`&ast;this`

== See Also

link:#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#L586[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-set_encoded_userinfo[`set&lowbar;encoded&lowbar;userinfo`], link:#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

[cols=2]
|===
| Name
| Thrown on
| `bad&lowbar;alloc`
| Allocation failure
|===

== Parameters

[cols=2]
|===
| 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#L2831[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;void&gt;
resolve(link:#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 `boost&colon;&colon;system&colon;&colon;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 https://www.rfc-editor.org/errata/eid4547[]&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
https://datatracker.ietf.org/doc/html/rfc3986#section-5[]

== Return Value

An empty `boost&colon;&colon;system&colon;&colon;result` upon success, otherwise an error code if `!base&period;has&lowbar;scheme()`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *ref*
| The URL reference to resolve&period;
|===

== See Also

link:#boost-urls-url[`url`], link:#boost-urls-url_view[`url&lowbar;view`]&period;

Return the path as a container of segments

== Synopses

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

Return the path as a container of segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_ref[urls::segments&lowbar;ref]
link:#boost-urls-url_base-segments-0e[segments]() noexcept;
----

[.small]#link:#boost-urls-url_base-segments-0e[_» more&period;&period;&period;_]#

Return the path as a container of segments


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_view[segments&lowbar;view]
link:#boost-urls-url_base-segments-04[segments]() const noexcept;
----

[.small]#link:#boost-urls-url_base-segments-04[_» more&period;&period;&period;_]#

== Return Value

* `&ast;this`
* A bidirectional view of segments&period;

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#boost-urls-url_base-set_path[`set&lowbar;path`], link:#boost-urls-url_base-set_path_absolute[`set&lowbar;path&lowbar;absolute`]&period;

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`]&period; link:#boost-urls-url_view_base-path[`path`], link:#boost-urls-segments_view[`segments&lowbar;view`]&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#L1895[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-segments_ref[urls::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`&ast;this`

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#boost-urls-url_base-set_path[`set&lowbar;path`], link:#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#L1899[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

A bidirectional view of segments&period;

== See Also

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`]&period; link:#boost-urls-url_view_base-path[`path`], link:#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#L365[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;authority(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;eror`
| The string contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The authority string to set&period;
|===

== See Also

link:#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#L2555[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;fragment(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* `&ast;this`
* `&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_fragment[`remove&lowbar;fragment`], link:#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#L1028[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;host(link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#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#L1231[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;host&lowbar;address(link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#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#L1510[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;host&lowbar;name(link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#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#L2363[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;params(std::initializer&lowbar;list&lt;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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| some element in `ps` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *ps*
| The params to set&period;
|===

== See Also

link:#boost-urls-url_base-set_params[`set&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#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#L805[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;password(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period; This string may contain any characters, including nulls&period;
|===

== See Also

link:#boost-urls-url_base-remove_password[`remove&lowbar;password`], link:#boost-urls-url_base-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url_base-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#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#L1838[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;path(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-url_base-set_path[`set&lowbar;path`], link:#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#L2076[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;query(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#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#L693[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;user(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

* `&ast;this`
* `&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_password[`remove&lowbar;password`], link:#boost-urls-url_base-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url_base-set_password[`set&lowbar;password`], link:#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#L543[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;encoded&lowbar;userinfo(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_userinfo[`remove&lowbar;userinfo`], link:#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#L2500[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_fragment[`remove&lowbar;fragment`], link:#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#L942[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#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#L1127[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#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#L1288[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;host&lowbar;ipv4(link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& addr);
----

== Description

The host is set to the specified IPv4 address&period; The host type is link:#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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *addr*
| The address to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#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#L1354[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;host&lowbar;ipv6(link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& addr);
----

== Description

The host is set to the specified IPv6 address&period; The host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *addr*
| The address to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipvfuture[`set&lowbar;host&lowbar;ipvfuture`], link:#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#L1408[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#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#L1456[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-set_encoded_host[`set&lowbar;encoded&lowbar;host`], link:#boost-urls-url_base-set_encoded_host_address[`set&lowbar;encoded&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_encoded_host_name[`set&lowbar;encoded&lowbar;host&lowbar;name`], link:#boost-urls-url_base-set_host[`set&lowbar;host`], link:#boost-urls-url_base-set_host_address[`set&lowbar;host&lowbar;address`], link:#boost-urls-url_base-set_host_ipv4[`set&lowbar;host&lowbar;ipv4`], link:#boost-urls-url_base-set_host_ipv6[`set&lowbar;host&lowbar;ipv6`], link:#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#L2299[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;params(
    std::initializer&lowbar;list&lt;param&lowbar;view&gt; ps,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
            >3.4.  Query (rfc3986)</a>
        @li <a href=[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *ps*
| The params to set&period;
| *opts*
| The options for encoding&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#boost-urls-url_base-set_encoded_query[`set&lowbar;encoded&lowbar;query`], link:#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#L747[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period; This string may contain any characters, including nulls&period;
|===

== See Also

link:#boost-urls-url_base-remove_password[`remove&lowbar;password`], link:#boost-urls-url_base-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url_base-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#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#L1771[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`] or link:#boost-urls-url_base-segments-07[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#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#L1704[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

true on success&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *absolute*
| If `true`, the path is made absolute&period;
|===

== See Also

link:#boost-urls-url_base-encoded_segments-0a[`encoded&lowbar;segments`], link:#boost-urls-url_base-segments-07[`segments`], link:#boost-urls-url_base-set_encoded_path[`set&lowbar;encoded&lowbar;path`], link:#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#L1600[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` does not contain a valid port&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The port string to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_port[`remove&lowbar;port`], link:#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"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *n*
| The port number to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_port[`remove&lowbar;port`], link:#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#L2020[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-encoded_params-0b[`encoded&lowbar;params`], link:#boost-urls-url_base-params-0c1[`params`], link:#boost-urls-url_base-remove_query[`remove&lowbar;query`], link:#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#L246[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `s` contains an invalid scheme&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The scheme to set&period;
|===

== See Also

link:#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#L281[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_base[url&lowbar;base]&
set&lowbar;scheme&lowbar;id(link:#boost-urls-scheme[urls::scheme] id);
----

== Description

This function sets the scheme to the specified known link:#boost-urls-scheme[`urls&colon;&colon;scheme`] id, which may not be link:#boost-urls-scheme[`scheme&colon;&colon;unknown`] or else an exception is thrown&period; If the id is link:#boost-urls-scheme[`scheme&colon;&colon;none`], this function behaves as if link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The scheme is invalid&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| 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#L636[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_password[`remove&lowbar;password`], link:#boost-urls-url_base-set_encoded_password[`set&lowbar;encoded&lowbar;password`], link:#boost-urls-url_base-set_encoded_user[`set&lowbar;encoded&lowbar;user`], link:#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#L476[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to set&period;
|===

== See Also

link:#boost-urls-url_base-remove_userinfo[`remove&lowbar;userinfo`], link:#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 link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base];
----

== Base Classes

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base]`
| Common functionality for containers
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view-2constructor-0c2[`url&lowbar;view`]         [.small]#[constructor]#
| Constructor
| link:#boost-urls-url_view-2destructor[`&#126;url&lowbar;view`] [.small]#[destructor]#
| Destructor
| link:#boost-urls-url_view-operator_assign-01[`operator&equals;`] 
| Assignment
| link:#boost-urls-url_view_base-authority[`authority`] 
| Return the authority
| link:#boost-urls-url_view_base-buffer[`buffer`] 
| Return the url string
| link:#boost-urls-url_view_base-compare[`compare`] 
| Return the result of comparing this with another url
| link:#boost-urls-url_view_base-data[`data`] 
| Return a pointer to the url&apos;s character buffer
| link:#boost-urls-url_view_base-empty[`empty`] 
| Return true if the url is empty
| link:#boost-urls-url_view_base-encoded_authority[`encoded&lowbar;authority`] 
| Return the authority&period;
| link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-encoded_host[`encoded&lowbar;host`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_address[`encoded&lowbar;host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`] 
| Return the host and port
| link:#boost-urls-url_view_base-encoded_host_name[`encoded&lowbar;host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`] 
| Return the origin
| link:#boost-urls-url_view_base-encoded_params[`encoded&lowbar;params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`] 
| Return the password
| link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`] 
| Return the path
| link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`] 
| Return the query
| link:#boost-urls-url_view_base-encoded_resource[`encoded&lowbar;resource`] 
| Return the resource
| link:#boost-urls-url_view_base-encoded_segments[`encoded&lowbar;segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-encoded_target[`encoded&lowbar;target`] 
| Return the target
| link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`] 
| Return the user
| link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-encoded_zone_id[`encoded&lowbar;zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-fragment[`fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-has_authority[`has&lowbar;authority`] 
| Return true if an authority is present
| link:#boost-urls-url_view_base-has_fragment[`has&lowbar;fragment`] 
| Return true if a fragment is present
| link:#boost-urls-url_view_base-has_password[`has&lowbar;password`] 
| Return true if a password is present
| link:#boost-urls-url_view_base-has_port[`has&lowbar;port`] 
| Return true if a port is present
| link:#boost-urls-url_view_base-has_query[`has&lowbar;query`] 
| Return true if a query is present
| link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`] 
| Return true a scheme is present
| link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`] 
| Return true if a userinfo is present
| link:#boost-urls-url_view_base-host[`host`] 
| Return the host
| link:#boost-urls-url_view_base-host_address[`host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-host_ipv4_address[`host&lowbar;ipv4&lowbar;address`] 
| Return the host IPv4 address
| link:#boost-urls-url_view_base-host_ipv6_address[`host&lowbar;ipv6&lowbar;address`] 
| Return the host IPv6 address
| link:#boost-urls-url_view_base-host_ipvfuture[`host&lowbar;ipvfuture`] 
| Return the host IPvFuture address
| link:#boost-urls-url_view_base-host_name[`host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-host_type[`host&lowbar;type`] 
| Return the host type
| link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`] 
| Return true if the path is absolute
| link:#boost-urls-url_view_base-params-065[`params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-password[`password`] 
| Return the password
| link:#boost-urls-url_view_base-path[`path`] 
| Return the path
| link:#boost-urls-url_view_base-persist[`persist`] 
| Return a shared, persistent copy of the url
| link:#boost-urls-url_view_base-port[`port`] 
| Return the port
| link:#boost-urls-url_view_base-port_number[`port&lowbar;number`] 
| Return the port
| link:#boost-urls-url_view_base-query[`query`] 
| Return the query
| link:#boost-urls-url_view_base-scheme[`scheme`] 
| Return the scheme
| link:#boost-urls-url_view_base-scheme_id[`scheme&lowbar;id`] 
| Return the scheme
| link:#boost-urls-url_view_base-segments[`segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-size[`size`] 
| Return the number of characters in the url
| link:#boost-urls-url_view_base-user[`user`] 
| Return the user
| link:#boost-urls-url_view_base-userinfo[`userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-zone_id[`zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-2conversion[`operator core::string&lowbar;view`] 
| Return the URL as a core&colon;&colon;string&lowbar;view
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-digest[`digest`] 
| Calculate a hash of the url
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-params_encoded_base[boost::urls::params&lowbar;encoded&lowbar;base]`
| Common functionality for containers
| `link:#boost-urls-params_base[boost::urls::params&lowbar;base]`
| Common functionality for query parameter containers
| `link:#boost-urls-url_view_base[boost::urls::url&lowbar;view&lowbar;base]`
| Common functionality for containers
| `std::hash&lt;url&lowbar;view&gt;`
|
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-operator_not_eq-040[`operator!&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_lt-04a[`operator&lt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_le-0a[`operator&lt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_eq-013[`operator&equals;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_gt-09[`operator&gt;`]
| Return the result of comparing two URLs
| link:#boost-urls-operator_ge-00[`operator&gt;&equals;`]
| Return the result of comparing two URLs
| link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`]
| Return a reference to a parsed URL string
| link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`]
| Return a reference to a parsed URL string
| link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`]
| Return a reference to a parsed URL string
| link:#boost-urls-parse_uri[`parse&lowbar;uri`]
| Return a reference to a parsed URL string
| link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`]
| Return a reference to a parsed URL string
| link:#boost-urls-resolve[`resolve`]
| Resolve a URL reference against a base 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 link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`] return a `boost&colon;&colon;system&colon;&colon;result` containing either a valid link:#boost-urls-url_view-2constructor-0c2[`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
* https://tools.ietf.org/html/rfc3986[]

== See Also

link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`], link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`], link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`], link:#boost-urls-parse_uri[`parse&lowbar;uri`], link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`]&period;

Constructor

== Synopses

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;`

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view-2constructor-0cb[url&lowbar;view]() noexcept;
----

[.small]#link:#boost-urls-url_view-2constructor-0cb[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view-2constructor-024[url&lowbar;view](link:#boost-urls-url_view[url&lowbar;view] const& other) noexcept;
----

[.small]#link:#boost-urls-url_view-2constructor-024[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view-2constructor-025[url&lowbar;view](core::string&lowbar;view s);
----

[.small]#link:#boost-urls-url_view-2constructor-025[_» more&period;&period;&period;_]#

Constructor


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view-2constructor-0a[url&lowbar;view](link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& other) noexcept;
----

[.small]#link:#boost-urls-url_view-2constructor-0a[_» more&period;&period;&period;_]#

Constructor


[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
link:#boost-urls-url_view-2constructor-00[url&lowbar;view](String const& s);
----

[.small]#link:#boost-urls-url_view-2constructor-00[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input failed to parse correctly&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
| *s*
| The string to parse&period;
|===

== See Also

link:#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#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
https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[]

Constructor

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url&lowbar;view(link:#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;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The input failed to parse correctly&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

== See Also

link:#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#L267[boost&sol;url&sol;url&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
url&lowbar;view(link:#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;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

Constructor

== 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
url&lowbar;view(String const& 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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[]

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

== See Also

link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`]&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;

Assignment

== Synopses

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

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view[url&lowbar;view]&
link:#boost-urls-url_view-operator_assign-02[operator&equals;](link:#boost-urls-url_view[url&lowbar;view] const& other) noexcept;
----

[.small]#link:#boost-urls-url_view-operator_assign-02[_» more&period;&period;&period;_]#

Assignment


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view[url&lowbar;view]&
link:#boost-urls-url_view-operator_assign-0f[operator&equals;](link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& other) noexcept;
----

[.small]#link:#boost-urls-url_view-operator_assign-0f[_» more&period;&period;&period;_]#

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view[url&lowbar;view]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&period;
|===

Assignment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url_view[url&lowbar;view]&
operator&equals;(link:#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;

== Return Value

A reference to this object&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The other view&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#L343[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;

== Return Value

The maximum number of characters possible&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
| link:#boost-urls-url_view_base-authority[`authority`] 
| Return the authority
| link:#boost-urls-url_view_base-buffer[`buffer`] 
| Return the url string
| link:#boost-urls-url_view_base-compare[`compare`] 
| Return the result of comparing this with another url
| link:#boost-urls-url_view_base-data[`data`] 
| Return a pointer to the url&apos;s character buffer
| link:#boost-urls-url_view_base-empty[`empty`] 
| Return true if the url is empty
| link:#boost-urls-url_view_base-encoded_authority[`encoded&lowbar;authority`] 
| Return the authority&period;
| link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-encoded_host[`encoded&lowbar;host`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_address[`encoded&lowbar;host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`] 
| Return the host and port
| link:#boost-urls-url_view_base-encoded_host_name[`encoded&lowbar;host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`] 
| Return the origin
| link:#boost-urls-url_view_base-encoded_params[`encoded&lowbar;params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`] 
| Return the password
| link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`] 
| Return the path
| link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`] 
| Return the query
| link:#boost-urls-url_view_base-encoded_resource[`encoded&lowbar;resource`] 
| Return the resource
| link:#boost-urls-url_view_base-encoded_segments[`encoded&lowbar;segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-encoded_target[`encoded&lowbar;target`] 
| Return the target
| link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`] 
| Return the user
| link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-encoded_zone_id[`encoded&lowbar;zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-fragment[`fragment`] 
| Return the fragment
| link:#boost-urls-url_view_base-has_authority[`has&lowbar;authority`] 
| Return true if an authority is present
| link:#boost-urls-url_view_base-has_fragment[`has&lowbar;fragment`] 
| Return true if a fragment is present
| link:#boost-urls-url_view_base-has_password[`has&lowbar;password`] 
| Return true if a password is present
| link:#boost-urls-url_view_base-has_port[`has&lowbar;port`] 
| Return true if a port is present
| link:#boost-urls-url_view_base-has_query[`has&lowbar;query`] 
| Return true if a query is present
| link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`] 
| Return true a scheme is present
| link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`] 
| Return true if a userinfo is present
| link:#boost-urls-url_view_base-host[`host`] 
| Return the host
| link:#boost-urls-url_view_base-host_address[`host&lowbar;address`] 
| Return the host
| link:#boost-urls-url_view_base-host_ipv4_address[`host&lowbar;ipv4&lowbar;address`] 
| Return the host IPv4 address
| link:#boost-urls-url_view_base-host_ipv6_address[`host&lowbar;ipv6&lowbar;address`] 
| Return the host IPv6 address
| link:#boost-urls-url_view_base-host_ipvfuture[`host&lowbar;ipvfuture`] 
| Return the host IPvFuture address
| link:#boost-urls-url_view_base-host_name[`host&lowbar;name`] 
| Return the host name
| link:#boost-urls-url_view_base-host_type[`host&lowbar;type`] 
| Return the host type
| link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`] 
| Return true if the path is absolute
| link:#boost-urls-url_view_base-params-065[`params`] 
| Return the query as a container of parameters
| link:#boost-urls-url_view_base-password[`password`] 
| Return the password
| link:#boost-urls-url_view_base-path[`path`] 
| Return the path
| link:#boost-urls-url_view_base-persist[`persist`] 
| Return a shared, persistent copy of the url
| link:#boost-urls-url_view_base-port[`port`] 
| Return the port
| link:#boost-urls-url_view_base-port_number[`port&lowbar;number`] 
| Return the port
| link:#boost-urls-url_view_base-query[`query`] 
| Return the query
| link:#boost-urls-url_view_base-scheme[`scheme`] 
| Return the scheme
| link:#boost-urls-url_view_base-scheme_id[`scheme&lowbar;id`] 
| Return the scheme
| link:#boost-urls-url_view_base-segments[`segments`] 
| Return the path as a container of segments
| link:#boost-urls-url_view_base-size[`size`] 
| Return the number of characters in the url
| link:#boost-urls-url_view_base-user[`user`] 
| Return the user
| link:#boost-urls-url_view_base-userinfo[`userinfo`] 
| Return the userinfo
| link:#boost-urls-url_view_base-zone_id[`zone&lowbar;id`] 
| Return the IPv6 Zone ID
| link:#boost-urls-url_view_base-2conversion[`operator core::string&lowbar;view`] 
| Return the URL as a core&colon;&colon;string&lowbar;view
|===

== Static Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-max_size[`max&lowbar;size`] 
| Return the maximum number of characters possible
|===

== Protected Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_view_base-digest[`digest`] 
| Calculate a hash of the url
|===

== Friends

[cols=2]
|===
| Name
| Description
| `link:#boost-urls-operator_lshift-0c[boost::urls::operator&lt;&lt;]`
| Format the url to the output stream
| `link:#boost-urls-operator_ge-00[boost::urls::operator&gt;&equals;]`
| Return the result of comparing two URLs
| `link:#boost-urls-operator_gt-09[boost::urls::operator&gt;]`
| Return the result of comparing two URLs
| `link:#boost-urls-operator_le-0a[boost::urls::operator&lt;&equals;]`
| Return the result of comparing two URLs
| `link:#boost-urls-operator_lt-04a[boost::urls::operator&lt;]`
| Return the result of comparing two URLs
| `link:#boost-urls-operator_not_eq-040[boost::urls::operator!&equals;]`
| Return the result of comparing two URLs
| `link:#boost-urls-operator_eq-013[boost::urls::operator&equals;&equals;]`
| Return the result of comparing two URLs
| `link:#boost-urls-segments_view[boost::urls::segments&lowbar;view]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_ref[boost::urls::segments&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_encoded_view[boost::urls::segments&lowbar;encoded&lowbar;view]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_encoded_ref[boost::urls::segments&lowbar;encoded&lowbar;ref]`
| A view representing path segments in a URL
| `link:#boost-urls-segments_encoded_base[boost::urls::segments&lowbar;encoded&lowbar;base]`
| Common functionality for containers
| `link:#boost-urls-segments_base[boost::urls::segments&lowbar;base]`
| Common functionality for containers
| `link:#boost-urls-params_view[boost::urls::params&lowbar;view]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_ref[boost::urls::params&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_encoded_view[boost::urls::params&lowbar;encoded&lowbar;view]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_encoded_ref[boost::urls::params&lowbar;encoded&lowbar;ref]`
| A view representing query parameters in a URL
| `link:#boost-urls-params_encoded_base[boost::urls::params&lowbar;encoded&lowbar;base]`
| Common functionality for containers
| `link:#boost-urls-params_base[boost::urls::params&lowbar;base]`
| Common functionality for query parameter containers
| `link:#boost-urls-static_url_base[boost::urls::static&lowbar;url&lowbar;base]`
| Common implementation for all static URLs
| `link:#boost-urls-url_view[boost::urls::url&lowbar;view]`
| A non&hyphen;owning reference to a valid URL
| `link:#boost-urls-url_base[boost::urls::url&lowbar;base]`
| Common functionality for containers
| `link:#boost-urls-url[boost::urls::url]`
| A modifiable container for a URL&period;
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-resolve[`resolve`]
| Resolve a URL reference against a base URL
|===

== Derived Classes

[cols=2]
|===
| Name
| Description
| link:#boost-urls-url_base[`url&lowbar;base`]
| Common functionality for containers
| link:#boost-urls-url_view[`url&lowbar;view`]
| A non&hyphen;owning reference to a valid 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#L547[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-authority_view[authority&lowbar;view]
authority() const noexcept;
----

== Description

This function returns the authority as an link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

An authority&lowbar;view representing the authority&period;

== See Also

link:#boost-urls-url_view_base-encoded_authority[`encoded&lowbar;authority`], link:#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#L265[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 Value

The url as a string&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#L2428[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
compare(link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

&hyphen;1 if `&ast;this &lt; other`, 0 if `this &equals;&equals; other`, and 1 if `this &gt; other`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *other*
| The url to compare
|===

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#L241[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;

== Return Value

A pointer to the first character&period;

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#L221[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[]

== Return Value

`true` if the url is empty&period;

Return the authority&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

The authority as a string&period;

== See Also

link:#boost-urls-url_view_base-authority[`authority`], link:#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#L2262[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

The fragment portion of the url&period;

== See Also

link:#boost-urls-url_view_base-fragment[`fragment`], link:#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#L1103[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host address as a string&period;

Return the host

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host address as a string&period;

Return the host and port

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

The host and port portion of the url&period;

== See Also

link:#boost-urls-url_view_base-has_port[`has&lowbar;port`], link:#boost-urls-url_view_base-port[`port`], link:#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#L1424[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]
encoded&lowbar;host&lowbar;name() const noexcept;
----

== Description

If the host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host name as a percent&hyphen;encoded string&period;

Return the origin

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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;

== Return Value

The origin portion of the url&period;

== See Also

link:#boost-urls-url_view_base-encoded_resource[`encoded&lowbar;resource`], link:#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#L2112[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

A bidirectional view of key&sol;value pairs&period;

== See Also

link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#boost-urls-url_view_base-params-065[`params`], link:#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#L979[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The password as a string&period;

== See Also

link:#boost-urls-url_view_base-has_password[`has&lowbar;password`], link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`], link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-url_view_base-password[`password`], link:#boost-urls-url_view_base-user[`user`], link:#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#L1782[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

The path as a string&period;

== See Also

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_segments[`encoded&lowbar;segments`]&period; link:#boost-urls-url_view_base-path[`path`], link:#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#L2022[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

The query as a string&period;

== See Also

link:#boost-urls-url_view_base-encoded_params[`encoded&lowbar;params`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#boost-urls-url_view_base-params-065[`params`], link:#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#L2369[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]

== Return Value

The resource portion of the url&period;

== See Also

link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`], link:#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#L1874[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

A bidirectional view of encoded segments&period;

== See Also

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_view_base-path[`path`], link:#boost-urls-url_view_base-segments[`segments`], link:#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#L2401[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]

== Return Value

The target portion of the url&period;

== See Also

link:#boost-urls-url_view_base-encoded_origin[`encoded&lowbar;origin`], link:#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#L884[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The user as a string&period;

== See Also

link:#boost-urls-url_view_base-has_password[`has&lowbar;password`], link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`], link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-url_view_base-password[`password`], link:#boost-urls-url_view_base-user[`user`], link:#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#L783[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The userinfo as a string&period;

== See Also

link:#boost-urls-url_view_base-has_password[`has&lowbar;password`], link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`], link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`], link:#boost-urls-url_view_base-password[`password`], link:#boost-urls-url_view_base-user[`user`], link:#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#L1509[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-pct_string_view[pct&lowbar;string&lowbar;view]
encoded&lowbar;zone&lowbar;id() const noexcept;
----

== Description

If the host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc6874[]

== Return Value

The Zone ID as a percent&hyphen;encoded string&period;

Return the fragment

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

The fragment portion of the url&period;

== Parameters

[cols=2]
|===
| 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

link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`], link:#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#L511[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

`true` if the url contains an authority&period;

== See Also

link:#boost-urls-url_view_base-authority[`authority`], link:#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#L2155[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[]

== Return Value

`true` if the url contains a fragment&period;

== See Also

link:#boost-urls-url_view_base-encoded_fragment[`encoded&lowbar;fragment`], link:#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#L672[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`true` if the userinfo contains a password&period;

== See Also

link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`], link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`], link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-url_view_base-password[`password`], link:#boost-urls-url_view_base-user[`user`], link:#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#L1551[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

`true` if a port is present, `false` otherwise&period;

== See Also

link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`], link:#boost-urls-url_view_base-port[`port`], link:#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#L1920[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

`true` if a query is present&period;

== See Also

link:#boost-urls-url_view_base-encoded_params[`encoded&lowbar;params`], link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-params-065[`params`], link:#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#L367[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

`true` if the url contains a scheme&period;

== See Also

link:#boost-urls-url_view_base-scheme[`scheme`], link:#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#L630[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

`true` if the userinfo is present&period;

== See Also

link:#boost-urls-url_view_base-has_password[`has&lowbar;password`], link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`], link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`], link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-url_view_base-password[`password`], link:#boost-urls-url_view_base-user[`user`], link:#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#L1059[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host address as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token customization
|===

Return the host

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host address as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token customization
|===

Return the host IPv4 address

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv4_address[ipv4&lowbar;address]
host&lowbar;ipv4&lowbar;address() const noexcept;
----

== Description

If the host type is link:#boost-urls-host_type[`host&lowbar;type&colon;&colon;ipv4`], this function returns the address as a value of type link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The IPv4 address as a value of type link:#boost-urls-ipv4_address[`ipv4&lowbar;address`]&period;

Return the host IPv6 address

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-ipv6_address[ipv6&lowbar;address]
host&lowbar;ipv6&lowbar;address() const noexcept;
----

== Description

If the host type is link:#boost-urls-host_type[`host&lowbar;type&colon;&colon;ipv6`], this function returns the address as a value of type link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The IPv6 address as a value of type link:#boost-urls-ipv6_address[`ipv6&lowbar;address`]&period;

Return the host IPvFuture address

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1341[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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The IPvFuture address as a string&period;

Return the host name

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::return&lowbar;string]&gt;
StringToken::result&lowbar;type
host&lowbar;name(StringToken&& token = &lcub;&rcub;);
----

== Description

If the host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The host name as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token customization&period;
|===

Return the host type

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-host_type[urls::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 link:#boost-urls-url_view_base-has_authority[`has&lowbar;authority`] is false, the host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== Return Value

The type of host present&period;

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#L1674[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

`true` if the path is absolute, `false` otherwise&period;

== See Also

link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_view_base-encoded_segments[`encoded&lowbar;segments`]&period; link:#boost-urls-url_view_base-path[`path`], link:#boost-urls-url_view_base-segments[`segments`]&period;

Return the query as a container of parameters

== Synopses

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

Return the query as a container of parameters


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]
link:#boost-urls-url_view_base-params-069[params]() const noexcept;
----

[.small]#link:#boost-urls-url_view_base-params-069[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]
link:#boost-urls-url_view_base-params-05[params](link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt) const noexcept;
----

[.small]#link:#boost-urls-url_view_base-params-05[_» more&period;&period;&period;_]#

== Return Value

A bidirectional view of key&sol;value pairs&period;

== See Also

link:#boost-urls-url_view_base-encoded_params[`encoded&lowbar;params`], link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#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#L2066[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

A bidirectional view of key&sol;value pairs&period;

== See Also

link:#boost-urls-url_view_base-encoded_params[`encoded&lowbar;params`], link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#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#L2069[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-params_view[params&lowbar;view]
params(link:#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#L930[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The password as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| The string token to use&period;
|===

== See Also

link:#boost-urls-url_view_base-has_password[`has&lowbar;password`], link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`], link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`], link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-url_view_base-user[`user`], link:#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#L1727[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

The path as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token to use for the result&period;
|===

== See Also

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_view_base-encoded_segments[`encoded&lowbar;segments`]&period; link:#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#L324[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::shared&lowbar;ptr&lt;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 Value

A shared pointer to a read&hyphen;only url&lowbar;view&period;

Return the port

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L1587[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

The port as a string&period;

== See Also

link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`], link:#boost-urls-url_view_base-has_port[`has&lowbar;port`], link:#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#L1623[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[]

== Return Value

The port number as an unsigned integer&period;

== See Also

link:#boost-urls-url_view_base-encoded_host_and_port[`encoded&lowbar;host&lowbar;and&lowbar;port`], link:#boost-urls-url_view_base-has_port[`has&lowbar;port`], link:#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#L1969[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]
* https://en.wikipedia.org/wiki/Query_string[]

== Return Value

The query as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A token to use for the returned string&period;
|===

== See Also

link:#boost-urls-url_view_base-encoded_params[`encoded&lowbar;params`], link:#boost-urls-url_view_base-encoded_query[`encoded&lowbar;query`], link:#boost-urls-url_view_base-has_query[`has&lowbar;query`], link:#boost-urls-url_view_base-params-065[`params`]&period;

Return the scheme

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L404[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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

The scheme as a string&period;

== See Also

link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`], link:#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#L454[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-scheme[urls::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

The scheme as an enumeration value&period;

== See Also

link:#boost-urls-url_view_base-has_scheme[`has&lowbar;scheme`], link:#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#L1823[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

A bidirectional view of segments&period;

== See Also

link:#boost-urls-url_view_base-is_path_absolute[`is&lowbar;path&lowbar;absolute`], link:#boost-urls-url_view_base-encoded_path[`encoded&lowbar;path`], link:#boost-urls-url_view_base-encoded_segments[`encoded&lowbar;segments`]&period; link:#boost-urls-url_view_base-path[`path`], link:#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#L184[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;

== Return Value

The number of characters in the url&period;

Return the user

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== Return Value

The user as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| The string token to use&period;
|===

== See Also

link:#boost-urls-url_view_base-has_password[`has&lowbar;password`], link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`], link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`], link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-url_view_base-password[`password`], link:#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#L731[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[]

== 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;
* The userinfo as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| The string token to use&period;
|===

== See Also

link:#boost-urls-url_view_base-has_password[`has&lowbar;password`], link:#boost-urls-url_view_base-has_userinfo[`has&lowbar;userinfo`], link:#boost-urls-url_view_base-encoded_password[`encoded&lowbar;password`], link:#boost-urls-url_view_base-encoded_user[`encoded&lowbar;user`], link:#boost-urls-url_view_base-encoded_userinfo[`encoded&lowbar;userinfo`], link:#boost-urls-url_view_base-password[`password`], link:#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#L1463[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::return&lowbar;string]&gt;
StringToken::result&lowbar;type
zone&lowbar;id(StringToken&& token = &lcub;&rcub;);
----

== Description

If the host type is link:#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
* https://datatracker.ietf.org/doc/html/rfc6874[]

== Return Value

The Zone ID as a string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *token*
| A string token customization&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#L282[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 Value

A string view of the URL&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#L156[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 Value

The maximum number of characters&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

[cols=2]
|===
| Name
| Description
| *salt*
| An initial value to add to the hash
|===

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 link:#boost-urls-ipv4_address[`ipv4&lowbar;address`]&period;
|`ipv6`
|A host is specified by link:#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
|===

== Non-Member Functions

[cols=2]
|===
| Name
| Description
| link:#boost-urls-default_port[`default&lowbar;port`]
| Return the default port for a known scheme
| link:#boost-urls-string_to_scheme[`string&lowbar;to&lowbar;scheme`]
| Return the known scheme for a non&hyphen;normalized string, if known
| link:#boost-urls-to_string[`to&lowbar;string`]
| Return the normalized string for a known scheme
|===

== Description

== Specification
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

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;
link:#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

[cols=2]
|===
| Name
| Description
| *name*
| The format argument name
| *arg*
| The format argument value
|===

== See Also

link:#boost-urls-format-06[`format`], link:#boost-urls-format_to-01[`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(link:#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

[cols=2]
|===
| Name
| Description
| *s*
| The known scheme constant
|===

`encode` overloads

== Synopses

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;`

Return a percent&hyphen;encoded string


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::return&lowbar;string],
    link:#boost-urls-grammar-CharSet[grammar::CharSet] CS&gt;
StringToken::result&lowbar;type
link:#boost-urls-encode-04[encode](
    core::string&lowbar;view s,
    CS const& allowed,
    link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt = &lcub;&rcub;,
    StringToken&& token = &lcub;&rcub;) noexcept;
----

[.small]#link:#boost-urls-encode-04[_» more&period;&period;&period;_]#

Apply percent&hyphen;encoding to a string


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-CharSet[grammar::CharSet] CS&gt;
std::size&lowbar;t
link:#boost-urls-encode-09[encode](
    char* dest,
    std::size&lowbar;t size,
    core::string&lowbar;view s,
    CS const& allowed,
    link:#boost-urls-encoding_opts[encoding&lowbar;opts] opt = &lcub;&rcub;);
----

[.small]#link:#boost-urls-encode-09[_» more&period;&period;&period;_]#

== Return Value

* The string
* The number of characters written to the destination buffer&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to encode&period;
| *allowed*
| 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;
| *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;
|===

== See Also

link:#boost-urls-encode-04[`encode`], link:#boost-urls-encoded_size[`encoded&lowbar;size`], link:#boost-urls-encoding_opts[`encoding&lowbar;opts`],

link:#boost-urls-encode-04[`encode`], link:#boost-urls-encoded_size[`encoded&lowbar;size`], link:#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#L180[boost&sol;url&sol;encode&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    link:#boost-urls-string_token-StringToken[string&lowbar;token::StringToken] StringToken = link:#boost-urls-string_token-return_string[string&lowbar;token::return&lowbar;string],
    link:#boost-urls-grammar-CharSet[grammar::CharSet] CS&gt;
StringToken::result&lowbar;type
encode(
    core::string&lowbar;view s,
    CS const& allowed,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[]

== Return Value

The string

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to encode&period;
| *allowed*
| 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

link:#boost-urls-encode-0d[`encode`], link:#boost-urls-encoded_size[`encoded&lowbar;size`], link:#boost-urls-encoding_opts[`encoding&lowbar;opts`],

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;link:#boost-urls-grammar-CharSet[grammar::CharSet] CS&gt;
std::size&lowbar;t
encode(
    char* dest,
    std::size&lowbar;t size,
    core::string&lowbar;view s,
    CS const& allowed,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[]

== Return Value

The number of characters written to the destination buffer&period;

== Parameters

[cols=2]
|===
| 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;
| *allowed*
| 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

link:#boost-urls-encode-0d[`encode`], link:#boost-urls-encoded_size[`encoded&lowbar;size`], link:#boost-urls-make_pct_string_view[`make&lowbar;pct&lowbar;string&lowbar;view`]&period;

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;link:#boost-urls-grammar-CharSet[grammar::CharSet] CS&gt;
std::size&lowbar;t
encoded&lowbar;size(
    core::string&lowbar;view s,
    CS const& allowed,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[]

== Return Value

The number of bytes needed, excluding any null terminator&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to measure&period;
| *allowed*
| 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

link:#boost-urls-encode-0d[`encode`], link:#boost-urls-encoding_opts[`encoding&lowbar;opts`], link:#boost-urls-make_pct_string_view[`make&lowbar;pct&lowbar;string&lowbar;view`]&period;

Format arguments into a URL

== Synopses

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;`

Format arguments into a URL


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
link:#boost-urls-url[url]
link:#boost-urls-format-02[format](
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;format&lowbar;arg&gt; args);
----

[.small]#link:#boost-urls-format-02[_» more&period;&period;&period;_]#

Format arguments into a URL


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;format&lowbar;arg&gt;&period;&period;&period; Args&gt;
link:#boost-urls-url[url]
link:#boost-urls-format-05[format](
    core::string&lowbar;view fmt,
    Args&&&period;&period;&period; args);
----

[.small]#link:#boost-urls-format-05[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *fmt*
| The format URL string&period;
| *args*
| Arguments to be formatted&period;
|===

== See Also

link:#boost-urls-format_to-01[`format&lowbar;to`]&period;

link:#boost-urls-format_to-01[`format&lowbar;to`], link:#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"]
----
link:#boost-urls-url[url]
format(
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;format&lowbar;arg&gt; args);
----

== Description

Format arguments according to the format URL string into a link:#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
* https://fmt.dev/latest/syntax.html[]

== Exceptions

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *fmt*
| The format URL string&period;
| *args*
| Arguments to be formatted&period;
|===

== See Also

link:#boost-urls-format_to-01[`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#L142[boost&sol;url&sol;format&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;format&lowbar;arg&gt;&period;&period;&period; Args&gt;
link:#boost-urls-url[url]
format(
    core::string&lowbar;view fmt,
    Args&&&period;&period;&period; args);
----

== Description

Format arguments according to the format URL string into a link:#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
* https://fmt.dev/latest/syntax.html[]

== Exceptions

[cols=2]
|===
| 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

[cols=2]
|===
| Name
| Description
| *fmt*
| The format URL string&period;
| *args*
| Arguments to be formatted&period;
|===

== See Also

link:#boost-urls-format_to-01[`format&lowbar;to`], link:#boost-urls-arg[`arg`]&period;

Format arguments into a URL

== Synopses

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;`

Format arguments into a URL


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
link:#boost-urls-format_to-0b[format&lowbar;to](
    link:#boost-urls-url_base[url&lowbar;base]& u,
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;format&lowbar;arg&gt; args);
----

[.small]#link:#boost-urls-format_to-0b[_» more&period;&period;&period;_]#

Format arguments into a URL


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;format&lowbar;arg&gt;&period;&period;&period; Args&gt;
void
link:#boost-urls-format_to-02[format&lowbar;to](
    link:#boost-urls-url_base[url&lowbar;base]& u,
    core::string&lowbar;view fmt,
    Args&&&period;&period;&period; args);
----

[.small]#link:#boost-urls-format_to-02[_» more&period;&period;&period;_]#

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `fmt` contains an invalid format string and `u` contains an invalid URL after replacements are applied&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| An object that derives from link:#boost-urls-url_base[`url&lowbar;base`]&period;
| *fmt*
| The format URL string&period;
| *args*
| Arguments to be formatted&period;
|===

== See Also

link:#boost-urls-format-06[`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(
    link:#boost-urls-url_base[url&lowbar;base]& u,
    core::string&lowbar;view fmt,
    std::initializer&lowbar;list&lt;format&lowbar;arg&gt; args);
----

== Description

Format arguments according to the format URL string into a link:#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
* https://fmt.dev/latest/syntax.html[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `fmt` contains an invalid format string and `u` contains an invalid URL after replacements are applied&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| An object that derives from link:#boost-urls-url_base[`url&lowbar;base`]&period;
| *fmt*
| The format URL string&period;
| *args*
| Arguments to be formatted&period;
|===

== See Also

link:#boost-urls-format-06[`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;format&lowbar;arg&gt;&period;&period;&period; Args&gt;
void
format&lowbar;to(
    link:#boost-urls-url_base[url&lowbar;base]& u,
    core::string&lowbar;view fmt,
    Args&&&period;&period;&period; args);
----

== Description

Format arguments according to the format URL string into a link:#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
* https://fmt.dev/latest/syntax.html[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `fmt` contains an invalid format string and `u` contains an invalid URL after replacements are applied&period;
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| An object that derives from link:#boost-urls-url_base[`url&lowbar;base`]&period;
| *fmt*
| The format URL string&period;
| *args*
| Arguments to be formatted&period;
|===

== See Also

link:#boost-urls-format-06[`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#L429[boost&sol;url&sol;pct&lowbar;string&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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;

== Return Value

On success, the valid percent&hyphen;encoded string&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to validate&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#L64[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.3[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`
|===

== Return Value

A view to the parsed URL

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`], link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`], link:#boost-urls-parse_uri[`parse&lowbar;uri`], link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`], link:#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#L1541[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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 link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== Return Value

A view to the parsed authority

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#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#L374[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;ipv4&lowbar;address&gt;
parse&lowbar;ipv4&lowbar;address(core::string&lowbar;view s) noexcept;
----

== Return Value

The parsed address, or an error code&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse&period;
|===

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#L420[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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

[cols=2]
|===
| 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#L110[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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
* https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`
|===

== Return Value

A view to the parsed URL

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`], link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`], link:#boost-urls-parse_uri[`parse&lowbar;uri`], link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`], link:#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;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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== Return Value

A valid view on success, otherwise an error code&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#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;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

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#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#L162[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[]
* https://www.rfc-editor.org/errata/eid5428[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`
|===

== Return Value

A view to the parsed URL

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`], link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`], link:#boost-urls-parse_uri[`parse&lowbar;uri`], link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`], link:#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#L211[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`
|===

== Return Value

A `boost&colon;&colon;system&colon;&colon;result` containing a value or an error

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`], link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`], link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`], link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`], link:#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#L272[boost&sol;url&sol;parse&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[]
* https://www.rfc-editor.org/errata/eid5428[]

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `s&period;size() &gt; url&lowbar;view&colon;&colon;max&lowbar;size`
|===

== Return Value

A view to the parsed URL

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The string to parse
|===

== See Also

link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`], link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`], link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`], link:#boost-urls-parse_uri[`parse&lowbar;uri`], link:#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#L84[boost&sol;url&sol;rfc&sol;pct&lowbar;encoded&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;link:#boost-urls-grammar-CharSet[grammar::CharSet] CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[]

== Return Value

A rule object&period;

== Parameters

[cols=2]
|===
| 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

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#boost-urls-pchars[`pchars`], link:#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#L2835[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
system::result&lt;void&gt;
resolve(
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& base,
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& ref,
    link:#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 link:#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 https://www.rfc-editor.org/errata/eid4547[]&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
https://datatracker.ietf.org/doc/html/rfc3986#section-5[]

== Return Value

An empty `boost&colon;&colon;system&colon;&colon;result` upon success, otherwise an error code if `!base&period;has&lowbar;scheme()`&period;

== Parameters

[cols=2]
|===
| 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

link:#boost-urls-url[`url`], link:#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"]
----
link:#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 link:#boost-urls-scheme[`scheme&colon;&colon;unknown`] is returned&period;

== BNF
[,cpp]
----
scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
----
== Specification
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[]

== Return Value

The known scheme

== Parameters

[cols=2]
|===
| 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#L400[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(
    link:#boost-urls-url[url]& v0,
    link:#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

[cols=2]
|===
| Name
| Description
| *v0*
| The first object to swap
| *v1*
| The second object to swap
|===

== See Also

link:#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(link:#boost-urls-scheme[scheme] s) noexcept;
----

== Return Value

A string representing the known scheme

== Parameters

[cols=2]
|===
| Name
| Description
| *s*
| The known scheme constant
|===

Stream insertion operators

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1495[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

Format the address to an output stream


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-0f6[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& addr);
----

[.small]#link:#boost-urls-operator_lshift-0f6[_» more&period;&period;&period;_]#

Format the address to an output stream&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-0a[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& addr);
----

[.small]#link:#boost-urls-operator_lshift-0a[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-034[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-decode_view[decode&lowbar;view] const& s);
----

[.small]#link:#boost-urls-operator_lshift-034[_» more&period;&period;&period;_]#

Format the url to the output stream


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-0c[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u);
----

[.small]#link:#boost-urls-operator_lshift-0c[_» more&period;&period;&period;_]#

Format the encoded authority to the output stream


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-0d[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-authority_view[authority&lowbar;view] const& a);
----

[.small]#link:#boost-urls-operator_lshift-0d[_» more&period;&period;&period;_]#

Format to an output stream


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-09[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-params_encoded_base[params&lowbar;encoded&lowbar;base] const& qp);
----

[.small]#link:#boost-urls-operator_lshift-09[_» more&period;&period;&period;_]#

Format to an output stream


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-0b[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-params_base[params&lowbar;base] const& qp);
----

[.small]#link:#boost-urls-operator_lshift-0b[_» more&period;&period;&period;_]#

Format to an output stream


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-038[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-segments_encoded_base[segments&lowbar;encoded&lowbar;base] const& ps);
----

[.small]#link:#boost-urls-operator_lshift-038[_» more&period;&period;&period;_]#

Format to an output stream


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::ostream&
link:#boost-urls-operator_lshift-0f4[operator&lt;&lt;](
    std::ostream& os,
    link:#boost-urls-segments_base[segments&lowbar;base] const& ps);
----

[.small]#link:#boost-urls-operator_lshift-0f4[_» more&period;&period;&period;_]#

== Return Value

* The output stream, for chaining&period;
* The output stream&period;
* A reference to the output stream, for chaining
* A reference to the output stream&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to&period;
| *addr*
| The address to write&period;
| *s*
| The decoded view to write
| *u*
| The url to write&period;
| *a*
| The URL to write
| *qp*
| The params to write
| *ps*
| The object 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#L397[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,
    link:#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

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to&period;
| *addr*
| The address 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#L361[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,
    link:#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;

Format the address to an output stream&period;

IPv4 addresses written to output streams are written in their dotted decimal format&period;

== Return Value

The output stream&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *os*
| The output stream&period;
| *addr*
| The address to format&period;
|===

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#L1044[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,
    link:#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

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to
| *s*
| The decoded view to write
|===

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#L2783[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,
    link:#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

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to&period;
| *u*
| The url 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#L1495[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,
    link:#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

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to
| *a*
| The URL 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#L556[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,
    link:#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();
----
== Return Value

A reference to the output stream, for chaining

== Parameters

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to
| *qp*
| The params to write
|===

Format to an output stream

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_base.hpp#L534[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,
    link:#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();
----
== Return Value

A reference to the output stream, for chaining

== Parameters

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to
| *qp*
| The parameters to write
|===

Format to an output stream

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_encoded_base.hpp#L344[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,
    link:#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();
----
== Return Value

A reference to the output stream&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to&period;
| *ps*
| The object to format&period;
|===

Format to an output stream

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/segments_base.hpp#L335[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,
    link:#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 Value

A reference to the output stream&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *os*
| The output stream to write to&period;
| *ps*
| The segments 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#L305[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& a1,
    link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& a2) noexcept;
----

== Return Value

`true` if the addresses are equal

== Parameters

[cols=2]
|===
| Name
| Description
| *a1*
| The first address to compare&period;
| *a2*
| The second address to compare&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#L259[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& a1,
    link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& a2) noexcept;
----

== Return Value

`true` if the addresses are equal, otherwise `false`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *a1*
| The first address to compare&period;
| *a2*
| The second address to compare&period;
|===

Compare two decode views for equality

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L658[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,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

Compare two decode views for equality

== 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;&equals;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

Compare two decode views for equality

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L625[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&equals;&equals;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L2466[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`true` if `u0 &equals;&equals; u1`

== Parameters

[cols=2]
|===
| Name
| Description
| *u0*
| The first url to compare
| *u1*
| The second url to compare
|===

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#L1318[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&equals;&equals;(
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#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 Value

`true` if `a0 &equals;&equals; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

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#L320[boost&sol;url&sol;ipv6&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& a1,
    link:#boost-urls-ipv6_address[ipv6&lowbar;address] const& a2) noexcept;
----

== Return Value

`true` if the addresses are not equal

== Parameters

[cols=2]
|===
| Name
| Description
| *a1*
| The first address to compare&period;
| *a2*
| The second address to compare&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#L274[boost&sol;url&sol;ipv4&lowbar;address&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& a1,
    link:#boost-urls-ipv4_address[ipv4&lowbar;address] const& a2) noexcept;
----

== Return Value

`true` if the addresses are not equal, otherwise `false`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *a1*
| The first address to compare&period;
| *a2*
| The second address to compare&period;
|===

Compare two decode views for inequality

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L725[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,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is not equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

Compare two decode views for inequality

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L708[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;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is not equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

Compare two decode views for inequality

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L692[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator!&equals;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is not equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L2510[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`true` if `u0 !&equals; u1`

== Parameters

[cols=2]
|===
| Name
| Description
| *u0*
| The first url to compare
| *u1*
| The second url to compare
|===

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#L1342[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator!&equals;(
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#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 Value

`true` if `a0 !&equals; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

Less&hyphen;than operators

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1366[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

Compare two decode views for less than


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_lt-03[operator&lt;](
    S const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_lt-03[_» more&period;&period;&period;_]#

Compare two decode views for less than


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_lt-047[operator&lt;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_lt-047[_» more&period;&period;&period;_]#

Compare two decode views for less than


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
link:#boost-urls-operator_lt-051[operator&lt;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_lt-051[_» more&period;&period;&period;_]#

Return the result of comparing two URLs


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_lt-04a[operator&lt;](
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u1) noexcept;
----

[.small]#link:#boost-urls-operator_lt-04a[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_lt-0a[operator&lt;](
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#boost-urls-authority_view[authority&lowbar;view] const& a1) noexcept;
----

[.small]#link:#boost-urls-operator_lt-0a[_» more&period;&period;&period;_]#

== Return Value

* `true` if decoded `lhs` is less than to the decoded `rhs`
* `true` if `u0 &lt; u1`
* `true` if `a0 &lt; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
| *u0*
| The first url to compare
| *u1*
| The second url to compare
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

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#L792[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,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is less than to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L775[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;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is less than to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L759[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&lt;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is less than to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L2554[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;(
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`true` if `u0 &lt; u1`

== Parameters

[cols=2]
|===
| Name
| Description
| *u0*
| The first url to compare
| *u1*
| The second url to compare
|===

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#L1366[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;(
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#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 Value

`true` if `a0 &lt; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

Less&hyphen;than&hyphen;or&hyphen;equal operators

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1390[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

Compare two decode views for less than or equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_le-06[operator&lt;&equals;](
    S const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_le-06[_» more&period;&period;&period;_]#

Compare two decode views for less than or equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_le-0e[operator&lt;&equals;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_le-0e[_» more&period;&period;&period;_]#

Compare two decode views for less than or equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
link:#boost-urls-operator_le-00[operator&lt;&equals;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_le-00[_» more&period;&period;&period;_]#

Return the result of comparing two URLs


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_le-0a[operator&lt;&equals;](
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u1) noexcept;
----

[.small]#link:#boost-urls-operator_le-0a[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_le-01[operator&lt;&equals;](
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#boost-urls-authority_view[authority&lowbar;view] const& a1) noexcept;
----

[.small]#link:#boost-urls-operator_le-01[_» more&period;&period;&period;_]#

== Return Value

* `true` if decoded `lhs` is less than or equal to the decoded `rhs`
* `true` if `u0 &lt;&equals; u1`
* `true` if `a0 &lt;&equals; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
| *u0*
| The first url to compare
| *u1*
| The second url to compare
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

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#L859[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,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is less than or equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L842[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;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is less than or equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L826[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&lt;&equals;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is less than or equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L2598[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;&equals;(
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`true` if `u0 &lt;&equals; u1`

== Parameters

[cols=2]
|===
| Name
| Description
| *u0*
| The first url to compare
| *u1*
| The second url to compare
|===

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#L1390[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&lt;&equals;(
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#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 Value

`true` if `a0 &lt;&equals; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

Greater&hyphen;than operators

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1414[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

Compare two decode views for greater than


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_gt-00[operator&gt;](
    S const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_gt-00[_» more&period;&period;&period;_]#

Compare two decode views for greater than


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_gt-0a[operator&gt;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_gt-0a[_» more&period;&period;&period;_]#

Compare two decode views for greater than


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
link:#boost-urls-operator_gt-03[operator&gt;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_gt-03[_» more&period;&period;&period;_]#

Return the result of comparing two URLs


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_gt-09[operator&gt;](
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u1) noexcept;
----

[.small]#link:#boost-urls-operator_gt-09[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_gt-08[operator&gt;](
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#boost-urls-authority_view[authority&lowbar;view] const& a1) noexcept;
----

[.small]#link:#boost-urls-operator_gt-08[_» more&period;&period;&period;_]#

== Return Value

* `true` if decoded `lhs` is greater than to the decoded `rhs`
* `true` if `u0 &gt; u1`
* `true` if `a0 &gt; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
| *u0*
| The first url to compare
| *u1*
| The second url to compare
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

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#L926[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,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is greater than to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L909[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;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is greater than to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L893[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&gt;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is greater than to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L2642[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;(
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`true` if `u0 &gt; u1`

== Parameters

[cols=2]
|===
| Name
| Description
| *u0*
| The first url to compare
| *u1*
| The second url to compare
|===

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#L1414[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;(
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#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 Value

`true` if `a0 &gt; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

Greater&hyphen;than&hyphen;or&hyphen;equal operators

== Synopses

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L1438[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

Compare two decode views for greater than or equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_ge-09c[operator&gt;&equals;](
    S const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_ge-09c[_» more&period;&period;&period;_]#

Compare two decode views for greater than or equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; S&gt;
constexpr
bool
link:#boost-urls-operator_ge-09e[operator&gt;&equals;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_ge-09e[_» more&period;&period;&period;_]#

Compare two decode views for greater than or equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
link:#boost-urls-operator_ge-06[operator&gt;&equals;](
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

[.small]#link:#boost-urls-operator_ge-06[_» more&period;&period;&period;_]#

Return the result of comparing two URLs


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_ge-00[operator&gt;&equals;](
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u1) noexcept;
----

[.small]#link:#boost-urls-operator_ge-00[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
link:#boost-urls-operator_ge-08[operator&gt;&equals;](
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#boost-urls-authority_view[authority&lowbar;view] const& a1) noexcept;
----

[.small]#link:#boost-urls-operator_ge-08[_» more&period;&period;&period;_]#

== Return Value

* `true` if decoded `lhs` is greater than or equal to the decoded `rhs`
* `true` if `u0 &gt;&equals; u1`
* `true` if `a0 &gt;&equals; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
| *u0*
| The first url to compare
| *u1*
| The second url to compare
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

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#L993[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,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is greater than or equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L976[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;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    S const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is greater than or equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L960[boost&sol;url&sol;decode&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
bool
operator&gt;&equals;(
    link:#boost-urls-decode_view[decode&lowbar;view] const& lhs,
    link:#boost-urls-decode_view[decode&lowbar;view] const& rhs) noexcept;
----

== Return Value

`true` if decoded `lhs` is greater than or equal to the decoded `rhs`

== Parameters

[cols=2]
|===
| Name
| Description
| *lhs*
| The left&hyphen;hand&hyphen;side decode view to compare
| *rhs*
| The right&hyphen;hand&hyphen;side decode view to compare
|===

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#L2686[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;&equals;(
    link:#boost-urls-url_view_base[url&lowbar;view&lowbar;base] const& u0,
    link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[]

== Return Value

`true` if `u0 &gt;&equals; u1`

== Parameters

[cols=2]
|===
| Name
| Description
| *u0*
| The first url to compare
| *u1*
| The second url to compare
|===

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#L1438[boost&sol;url&sol;authority&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
operator&gt;&equals;(
    link:#boost-urls-authority_view[authority&lowbar;view] const& a0,
    link:#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 Value

`true` if `a0 &gt;&equals; a1`, otherwise `false`

== Parameters

[cols=2]
|===
| Name
| Description
| *a0*
| The first authority to compare
| *a1*
| The second authority to compare
|===

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; absolute&lowbar;uri&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = url_view;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.3[]

== See Also

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#boost-urls-parse_absolute_uri[`parse&lowbar;absolute&lowbar;uri`], link:#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#L61[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; authority&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = authority_view;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[]

== See Also

link:#boost-urls-authority_view[`authority&lowbar;view`], link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#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 link:#boost-urls-grammar-lut_chars[grammar::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 link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.2[]

== See Also

link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`grammar&colon;&colon;find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#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; ignore&lowbar;case = &lcub;&rcub;;
----

== Description

This value may be optionally passed to functions accepting a parameter of type link:#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#L70[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; ipv4&lowbar;address&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = ipv4_address;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://en.wikipedia.org/wiki/IPv4[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== See Also

link:#boost-urls-ipv4_address[`ipv4&lowbar;address`], link:#boost-urls-parse_ipv4_address[`parse&lowbar;ipv4&lowbar;address`], link:#boost-urls-grammar-parse-09[`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#L78[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; ipv6&lowbar;address&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = ipv6_address;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc4291[]
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[]

== See Also

link:#boost-urls-ipv6_address[`ipv6&lowbar;address`], link:#boost-urls-parse_ipv6_address[`parse&lowbar;ipv6&lowbar;address`], link:#boost-urls-grammar-parse-09[`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 link:#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; 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 link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1[]

== See Also

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#boost-urls-parse_origin_form[`parse&lowbar;origin&lowbar;form`], link:#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 link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[]

== See Also

link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`grammar&colon;&colon;find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#boost-urls-pct_encoded_rule[`pct&lowbar;encoded&lowbar;rule`]&period;

Rule for a query string

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/query_rule.hpp#L70[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; query&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = params_encoded_view;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[]

== See Also

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#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#L61[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; relative&lowbar;ref&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = url_view;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[]

== See Also

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#boost-urls-parse_relative_ref[`parse&lowbar;relative&lowbar;ref`], link:#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 link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.3[]

== See Also

link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`grammar&colon;&colon;find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#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 link:#boost-urls-grammar-lut_chars[grammar::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 link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.2[]

== See Also

link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`grammar&colon;&colon;find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#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 link:#boost-urls-grammar-lut_chars[grammar::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 link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`] and link:#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
* https://datatracker.ietf.org/doc/html/rfc3986#section-2.3[]

== See Also

link:#boost-urls-grammar-find_if[`grammar&colon;&colon;find&lowbar;if`], link:#boost-urls-grammar-find_if_not[`grammar&colon;&colon;find&lowbar;if&lowbar;not`], link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#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#L64[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; uri&lowbar;reference&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = url_view;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3[]

== See Also

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#boost-urls-parse_uri_reference[`parse&lowbar;uri&lowbar;reference`], link:#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#L61[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; uri&lowbar;rule = &lcub;&rcub;;
----

== Description

== Value Type
[,cpp]
----
using value_type = url_view;
----
== Example
Rules are used with the function link:#boost-urls-grammar-parse-09[`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
* https://datatracker.ietf.org/doc/html/rfc3986#section-3[]

== See Also

link:#boost-urls-grammar-parse-09[`grammar&colon;&colon;parse`], link:#boost-urls-parse_uri[`parse&lowbar;uri`], link:#boost-urls-url_view[`url&lowbar;view`]&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
