= Reference :mrdocs: [#index] == Global namespace === Namespaces [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost[`boost`] ¦ |=== [#boost] == boost === Namespaces [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls[`urls`] ¦ |=== [#boost-urls] == xref:boost[pass:[boost]]::urls === Namespaces [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-error_types[`error_types`] ¦ ¦xref:boost-urls-grammar[`grammar`] ¦ ¦xref:boost-urls-implementation_defined[`implementation_defined`] ¦ ¦xref:boost-urls-see_below[`see_below`] ¦ ¦xref:boost-urls-string_token[`string_token`] ¦ |=== === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-authority_view[`authority_view`] ¦ A non-owning reference to a valid authority ¦xref:boost-urls-decode_view[`decode_view`] ¦ A reference to a valid, percent-encoded string ¦xref:boost-urls-encoding_opts[`encoding_opts`] ¦ Percent-encoding options ¦xref:boost-urls-ignore_case_param[`ignore_case_param`] ¦ An optional parameter to determine case-sensitivity ¦xref:boost-urls-ipv4_address[`ipv4_address`] ¦ An IP version 4 style address. ¦xref:boost-urls-ipv6_address[`ipv6_address`] ¦ An IP version 6 style address. ¦xref:boost-urls-no_value_t[`no_value_t`] ¦ The type of no_value ¦xref:boost-urls-optional[`optional`] ¦ The type of optional used by the library ¦xref:boost-urls-param[`param`] ¦ A query parameter ¦xref:boost-urls-param_pct_view[`param_pct_view`] ¦ A query parameter ¦xref:boost-urls-param_view[`param_view`] ¦ A query parameter ¦xref:boost-urls-params_base[`params_base`] ¦ Common functionality for containers ¦xref:boost-urls-params_encoded_base[`params_encoded_base`] ¦ Common functionality for containers ¦xref:boost-urls-params_encoded_ref[`params_encoded_ref`] ¦ A view representing query parameters in a URL ¦xref:boost-urls-params_encoded_view[`params_encoded_view`] ¦ A view representing query parameters in a URL ¦xref:boost-urls-params_ref[`params_ref`] ¦ A view representing query parameters in a URL ¦xref:boost-urls-params_view[`params_view`] ¦ A view representing query parameters in a URL ¦xref:boost-urls-pct_string_view[`pct_string_view`] ¦ A reference to a valid percent-encoded string ¦xref:boost-urls-segments_base[`segments_base`] ¦ Common functionality for containers ¦xref:boost-urls-segments_encoded_base[`segments_encoded_base`] ¦ Common functionality for containers ¦xref:boost-urls-segments_encoded_ref[`segments_encoded_ref`] ¦ A view representing path segments in a URL ¦xref:boost-urls-segments_encoded_view[`segments_encoded_view`] ¦ A view representing path segments in a URL ¦xref:boost-urls-segments_ref[`segments_ref`] ¦ A view representing path segments in a URL ¦xref:boost-urls-segments_view[`segments_view`] ¦ A view representing path segments in a URL ¦xref:boost-urls-static_url[`static_url`] ¦ A modifiable container for a URL. ¦xref:boost-urls-static_url_base[`static_url_base`] ¦ Common implementation for all static URLs ¦xref:boost-urls-string_view[`string_view`] ¦ The type of string_view used by the library ¦xref:boost-urls-url[`url`] ¦ A modifiable container for a URL. ¦xref:boost-urls-url_base[`url_base`] ¦ Common functionality for containers ¦xref:boost-urls-url_view[`url_view`] ¦ A non-owning reference to a valid URL ¦xref:boost-urls-url_view_base[`url_view_base`] ¦ Common functionality for containers ¦xref:boost-urls-variant[`variant`] ¦ The type of variant used by the library |=== === Enums [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-error[`error`] ¦ Error codes returned the library ¦xref:boost-urls-host_type[`host_type`] ¦ Identifies the type of host in a URL. ¦xref:boost-urls-scheme[`scheme`] ¦ Identifies a known URL scheme |=== === Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-arg[`arg`] ¦ Designate a named argument for a replacement field ¦xref:boost-urls-default_port[`default_port`] ¦ Return the default port for a known scheme ¦xref:boost-urls-encode[`encode`] ¦ Apply percent-encoding to a string Return a percent-encoded string ¦xref:boost-urls-encoded_size[`encoded_size`] ¦ Return the buffer size needed for percent-encoding ¦xref:boost-urls-format[`format`] ¦ Format arguments into a URL ¦xref:boost-urls-format_to[`format_to`] ¦ Format arguments into a URL ¦xref:boost-urls-make_pct_string_view[`make_pct_string_view`] ¦ Return a valid percent-encoded string ¦xref:boost-urls-operator_not_eq[`operator!=`] ¦ Compare two decode views for inequality Return the result of comparing two URLs Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. Return true if two addresses are not equal ¦xref:boost-urls-operator_lt[`operator<`] ¦ Compare two decode views for less than Return the result of comparing two URLs Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-operator_lshift[`operator<<`] ¦ Format the address to an output stream Format the address to an output stream. Format the encoded authority to the output stream Format the string with percent-decoding applied to the output stream Format the url to the output stream Format to an output stream ¦xref:boost-urls-operator_le[`operator<=`] ¦ Compare two decode views for less than or equal Return the result of comparing two URLs Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-operator_eq[`operator==`] ¦ Compare two decode views for equality Return the result of comparing two URLs Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. Return true if two addresses are equal ¦xref:boost-urls-operator_gt[`operator>`] ¦ Compare two decode views for greater than Return the result of comparing two URLs Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-operator_ge[`operator>=`] ¦ Compare two decode views for greater than or equal Return the result of comparing two URLs Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-parse_absolute_uri[`parse_absolute_uri`] ¦ Return a reference to a parsed URL string ¦xref:boost-urls-parse_authority[`parse_authority`] ¦ Parse an authority ¦xref:boost-urls-parse_ipv4_address[`parse_ipv4_address`] ¦ Return an IPv4 address from an IP address string in dotted decimal form ¦xref:boost-urls-parse_ipv6_address[`parse_ipv6_address`] ¦ Parse a string containing an IPv6 address. ¦xref:boost-urls-parse_origin_form[`parse_origin_form`] ¦ Return a reference to a parsed URL string ¦xref:boost-urls-parse_path[`parse_path`] ¦ Parse a string and return an encoded segment view ¦xref:boost-urls-parse_query[`parse_query`] ¦ Parse a string and return an encoded params view ¦xref:boost-urls-parse_relative_ref[`parse_relative_ref`] ¦ Return a reference to a parsed URL string ¦xref:boost-urls-parse_uri[`parse_uri`] ¦ Return a reference to a parsed URL string ¦xref:boost-urls-parse_uri_reference[`parse_uri_reference`] ¦ Return a reference to a parsed URL string ¦xref:boost-urls-pct_encoded_rule[`pct_encoded_rule`] ¦ Rule for a string with percent-encoded escapes ¦xref:boost-urls-resolve[`resolve`] ¦ Resolve a URL reference against a base URL ¦xref:boost-urls-string_to_scheme[`string_to_scheme`] ¦ Return the known scheme for a non-normalized string, if known ¦xref:boost-urls-swap[`swap`] ¦ Swap ¦xref:boost-urls-to_string[`to_string`] ¦ Return the normalized string for a known scheme |=== === Variables [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-absolute_uri_rule[`absolute_uri_rule`] ¦ Rule for absolute-URI ¦xref:boost-urls-authority_rule[`authority_rule`] ¦ Rule for authority ¦xref:boost-urls-gen_delim_chars[`gen_delim_chars`] ¦ The gen-delims character set ¦xref:boost-urls-ignore_case[`ignore_case`] ¦ Ignore case when comparing ¦xref:boost-urls-ipv4_address_rule[`ipv4_address_rule`] ¦ Rule for an IP version 4 style address ¦xref:boost-urls-ipv6_address_rule[`ipv6_address_rule`] ¦ Rule for An IP version 6 style address ¦xref:boost-urls-no_value[`no_value`] ¦ Constant indicating no value in a param ¦xref:boost-urls-origin_form_rule[`origin_form_rule`] ¦ Rule for origin-form ¦xref:boost-urls-pchars[`pchars`] ¦ The path character set ¦xref:boost-urls-query_rule[`query_rule`] ¦ Rule for query ¦xref:boost-urls-relative_ref_rule[`relative_ref_rule`] ¦ Rule for relative-ref ¦xref:boost-urls-reserved_chars[`reserved_chars`] ¦ The reserved character set ¦xref:boost-urls-sub_delim_chars[`sub_delim_chars`] ¦ The sub-delims character set ¦xref:boost-urls-unreserved_chars[`unreserved_chars`] ¦ The unreserved character set ¦xref:boost-urls-uri_reference_rule[`uri_reference_rule`] ¦ Rule for URI-reference ¦xref:boost-urls-uri_rule[`uri_rule`] ¦ Rule for URI |=== === Using Directives [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-error_types[`error_types`] ¦ |=== [#boost-urls-grammar] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::grammar === Namespaces [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined[`implementation_defined`] ¦ ¦xref:boost-urls-grammar-see_below[`see_below`] ¦ |=== === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-aligned_storage[`aligned_storage`] ¦ Provides an aligned storage buffer aligned for T ¦xref:boost-urls-grammar-ci_equal[`ci_equal`] ¦ A case-insensitive equals predicate for strings ¦xref:boost-urls-grammar-ci_hash[`ci_hash`] ¦ A case-insensitive hash function object for strings ¦xref:boost-urls-grammar-ci_less[`ci_less`] ¦ A case-insensitive less predicate for strings ¦xref:boost-urls-grammar-is_charset[`is_charset`] ¦ Alias for `std::true_type` if T satisfies _CharSet_ . ¦xref:boost-urls-grammar-is_rule[`is_rule`] ¦ Determine if T meets the requirements of Rule ¦xref:boost-urls-grammar-literal_rule[`literal_rule`] ¦ ¦xref:boost-urls-grammar-lut_chars[`lut_chars`] ¦ A set of characters ¦xref:boost-urls-grammar-range[`range`] ¦ A forward range of parsed elements ¦xref:boost-urls-grammar-recycled[`recycled`] ¦ A thread-safe collection of instances of T ¦xref:boost-urls-grammar-recycled_ptr[`recycled_ptr`] ¦ A pointer to a shared instance of T ¦xref:boost-urls-grammar-string_view_base[`string_view_base`] ¦ Common functionality for string views ¦xref:boost-urls-grammar-unsigned_rule[`unsigned_rule`] ¦ Match an unsigned decimal |=== === Enums [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-condition[`condition`] ¦ Error conditions for errors received from rules ¦xref:boost-urls-grammar-error[`error`] ¦ Error codes returned when using rules |=== === Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-ci_compare[`ci_compare`] ¦ Return the case-insensitive comparison of s0 and s1 ¦xref:boost-urls-grammar-ci_digest[`ci_digest`] ¦ Return the case-insensitive digest of a string ¦xref:boost-urls-grammar-ci_is_equal[`ci_is_equal`] ¦ Return true if s0 equals s1 using case-insensitive comparison ¦xref:boost-urls-grammar-ci_is_less[`ci_is_less`] ¦ Return true if s0 is less than s1 using case-insensitive comparison ¦xref:boost-urls-grammar-delim_rule[`delim_rule`] ¦ Match a character literal Match a single character from a character set ¦xref:boost-urls-grammar-find_if[`find_if`] ¦ Find the first character in the string that is in the set. ¦xref:boost-urls-grammar-find_if_not[`find_if_not`] ¦ Find the first character in the string that is not in CharSet ¦xref:boost-urls-grammar-hash_value[`hash_value`] ¦ Return the hash of this value ¦xref:boost-urls-grammar-hexdig_value[`hexdig_value`] ¦ Return the decimal value of a hex character ¦xref:boost-urls-grammar-not_empty_rule[`not_empty_rule`] ¦ Match another rule, if the result is not empty ¦xref:boost-urls-grammar-operator_not_eq[`operator!=`] ¦ Compare two string views for inequality ¦xref:boost-urls-grammar-operator_plus[`operator+`] ¦ Return the union of two character sets. ¦xref:boost-urls-grammar-operator_minus[`operator-`] ¦ Return a new character set by subtracting ¦xref:boost-urls-grammar-operator_lt[`operator<`] ¦ Compare two string views for less than ¦xref:boost-urls-grammar-operator_lshift[`operator<<`] ¦ Format a string to an output stream ¦xref:boost-urls-grammar-operator_le[`operator<=`] ¦ Compare two string views for less than or equal ¦xref:boost-urls-grammar-operator_eq[`operator==`] ¦ Compare two string views for equality ¦xref:boost-urls-grammar-operator_gt[`operator>`] ¦ Compare two string views for greater than ¦xref:boost-urls-grammar-operator_ge[`operator>=`] ¦ Compare two string views for greater than or equal ¦xref:boost-urls-grammar-optional_rule[`optional_rule`] ¦ Match a rule, or the empty string ¦xref:boost-urls-grammar-parse[`parse`] ¦ Parse a character buffer using a rule ¦xref:boost-urls-grammar-range_rule[`range_rule`] ¦ Match a repeating number of elements ¦xref:boost-urls-grammar-ref[`ref`] ¦ Return a reference to a character set Return a reference to a rule ¦xref:boost-urls-grammar-squelch[`squelch`] ¦ Squelch the value of a rule ¦xref:boost-urls-grammar-to_lower[`to_lower`] ¦ Return c converted to lowercase ¦xref:boost-urls-grammar-to_upper[`to_upper`] ¦ Return c converted to uppercase ¦xref:boost-urls-grammar-token_rule[`token_rule`] ¦ Match a non-empty string of characters from a set ¦xref:boost-urls-grammar-tuple_rule[`tuple_rule`] ¦ Match a series of rules in order ¦xref:boost-urls-grammar-variant_rule[`variant_rule`] ¦ Match one of a set of rules |=== === Variables [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-all_chars[`all_chars`] ¦ The set of all characters ¦xref:boost-urls-grammar-alnum_chars[`alnum_chars`] ¦ The set of letters and digits ¦xref:boost-urls-grammar-alpha_chars[`alpha_chars`] ¦ The set of all letters ¦xref:boost-urls-grammar-dec_octet_rule[`dec_octet_rule`] ¦ Match a decimal octet ¦xref:boost-urls-grammar-digit_chars[`digit_chars`] ¦ The set of decimal digits ¦xref:boost-urls-grammar-hexdig_chars[`hexdig_chars`] ¦ The set of hexadecimal digits ¦xref:boost-urls-grammar-vchars[`vchars`] ¦ The set of visible characters |=== [#boost-urls-grammar-implementation_defined] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::implementation_defined === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-all_chars_t[`all_chars_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-alnum_chars_t[`alnum_chars_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-alpha_chars_t[`alpha_chars_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-ch_delim_rule[`ch_delim_rule`] ¦ ¦xref:boost-urls-grammar-implementation_defined-charset_ref[`charset_ref`] ¦ ¦xref:boost-urls-grammar-implementation_defined-cs_delim_rule[`cs_delim_rule`] ¦ ¦xref:boost-urls-grammar-implementation_defined-dec_octet_rule_t[`dec_octet_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-digit_chars_t[`digit_chars_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-hexdig_chars_t[`hexdig_chars_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-not_empty_rule_t[`not_empty_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-optional_rule_t[`optional_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-02[`range_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-03[`range_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-rule_ref[`rule_ref`] ¦ ¦xref:boost-urls-grammar-implementation_defined-squelch_rule_t[`squelch_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-token_rule_t[`token_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-tuple_rule_t[`tuple_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-variant_rule_t[`variant_rule_t`] ¦ ¦xref:boost-urls-grammar-implementation_defined-vchars_t[`vchars_t`] ¦ |=== [#boost-urls-grammar-implementation_defined-alnum_chars_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::alnum_chars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct alnum_chars_t; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-alnum_chars_t-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-implementation_defined-alnum_chars_t-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-alnum_chars_t[pass:[alnum_chars_t]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool operator()(char c) const noexcept; ---- [#boost-urls-grammar-implementation_defined-alpha_chars_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::alpha_chars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct alpha_chars_t; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-alpha_chars_t-2constructor[`alpha_chars_t`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-implementation_defined-alpha_chars_t-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-implementation_defined-alpha_chars_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-alpha_chars_t[pass:[alpha_chars_t]]::alpha_chars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr alpha_chars_t() noexcept = default; ---- [#boost-urls-grammar-implementation_defined-alpha_chars_t-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-alpha_chars_t[pass:[alpha_chars_t]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool operator()(char c) const noexcept; ---- [#boost-urls-grammar-implementation_defined-charset_ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::charset_ref === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct charset_ref; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-charset_ref-find_if[`find_if`] ¦ ¦xref:boost-urls-grammar-implementation_defined-charset_ref-find_if_not[`find_if_not`] ¦ ¦xref:boost-urls-grammar-implementation_defined-charset_ref-operator_call[`operator()`] ¦ |=== === Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-charset_ref-cs_[`cs_`] ¦ |=== [#boost-urls-grammar-implementation_defined-charset_ref-cs_] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-charset_ref[pass:[charset_ref]]::cs_ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- CharSet const& cs_; ---- [#boost-urls-grammar-implementation_defined-charset_ref-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-charset_ref[pass:[charset_ref]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool operator()(char ch) const noexcept; ---- [#boost-urls-grammar-implementation_defined-charset_ref-find_if] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-charset_ref[pass:[charset_ref]]::find_if === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- char const* find_if( char const* first, char const* last) const noexcept; ---- [#boost-urls-grammar-implementation_defined-charset_ref-find_if_not] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-charset_ref[pass:[charset_ref]]::find_if_not === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- char const* find_if_not( char const* first, char const* last) const noexcept; ---- [#boost-urls-grammar-implementation_defined-dec_octet_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::dec_octet_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct dec_octet_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-dec_octet_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-dec_octet_rule_t-parse[`parse`] ¦ |=== [#boost-urls-grammar-implementation_defined-dec_octet_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-dec_octet_rule_t[pass:[dec_octet_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = unsigned char; ---- [#boost-urls-grammar-implementation_defined-dec_octet_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-dec_octet_rule_t[pass:[dec_octet_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-grammar-implementation_defined-ch_delim_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::ch_delim_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct ch_delim_rule; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-ch_delim_rule-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-ch_delim_rule-2constructor[`ch_delim_rule`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-implementation_defined-ch_delim_rule-parse[`parse`] ¦ |=== [#boost-urls-grammar-implementation_defined-ch_delim_rule-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-ch_delim_rule[pass:[ch_delim_rule]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = core::string_view; ---- [#boost-urls-grammar-implementation_defined-ch_delim_rule-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-ch_delim_rule[pass:[ch_delim_rule]]::ch_delim_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ch_delim_rule(char ch) noexcept; ---- [#boost-urls-grammar-implementation_defined-ch_delim_rule-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-ch_delim_rule[pass:[ch_delim_rule]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-grammar-implementation_defined-cs_delim_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::cs_delim_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct cs_delim_rule; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-cs_delim_rule-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-cs_delim_rule-2constructor[`cs_delim_rule`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-implementation_defined-cs_delim_rule-parse[`parse`] ¦ |=== [#boost-urls-grammar-implementation_defined-cs_delim_rule-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-cs_delim_rule[pass:[cs_delim_rule]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = core::string_view; ---- [#boost-urls-grammar-implementation_defined-cs_delim_rule-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-cs_delim_rule[pass:[cs_delim_rule]]::cs_delim_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr cs_delim_rule(CharSet const& cs) noexcept; ---- [#boost-urls-grammar-implementation_defined-cs_delim_rule-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-cs_delim_rule[pass:[cs_delim_rule]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-grammar-implementation_defined-digit_chars_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::digit_chars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct digit_chars_t; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-digit_chars_t-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-implementation_defined-digit_chars_t-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-digit_chars_t[pass:[digit_chars_t]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool operator()(char c) const noexcept; ---- [#boost-urls-grammar-implementation_defined-hexdig_chars_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::hexdig_chars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct hexdig_chars_t; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-hexdig_chars_t-operator_call[`operator()`] ¦ Return true if c is in the character set. |=== [#boost-urls-grammar-implementation_defined-hexdig_chars_t-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-hexdig_chars_t[pass:[hexdig_chars_t]]::operator() Return true if c is in the character set. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool operator()(char c) const noexcept; ---- [#boost-urls-grammar-implementation_defined-not_empty_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::not_empty_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct not_empty_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-not_empty_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-not_empty_rule_t-2constructor[`not_empty_rule_t`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-implementation_defined-not_empty_rule_t-parse[`parse`] ¦ |=== [#boost-urls-grammar-implementation_defined-not_empty_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-not_empty_rule_t[pass:[not_empty_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = R::value_type; ---- [#boost-urls-grammar-implementation_defined-not_empty_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-not_empty_rule_t[pass:[not_empty_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-not_empty_rule_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-not_empty_rule_t[pass:[not_empty_rule_t]]::not_empty_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr not_empty_rule_t(R const& r) noexcept; ---- [#boost-urls-grammar-implementation_defined-rule_ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::rule_ref === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct rule_ref; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-rule_ref-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-rule_ref-parse[`parse`] ¦ |=== === Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-rule_ref-r_[`r_`] ¦ |=== [#boost-urls-grammar-implementation_defined-rule_ref-r_] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-rule_ref[pass:[rule_ref]]::r_ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- Rule const& r_; ---- [#boost-urls-grammar-implementation_defined-rule_ref-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-rule_ref[pass:[rule_ref]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = Rule::value_type; ---- [#boost-urls-grammar-implementation_defined-rule_ref-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-rule_ref[pass:[rule_ref]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-optional_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::optional_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct optional_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-optional_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-optional_rule_t-2constructor[`optional_rule_t`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-implementation_defined-optional_rule_t-parse[`parse`] ¦ |=== [#boost-urls-grammar-implementation_defined-optional_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-optional_rule_t[pass:[optional_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost[boost]::optional; ---- [#boost-urls-grammar-implementation_defined-optional_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-optional_rule_t[pass:[optional_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-optional_rule_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-optional_rule_t[pass:[optional_rule_t]]::optional_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr optional_rule_t(Rule const& r) noexcept; ---- [#boost-urls-grammar-implementation_defined-range_rule_t-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::range_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class R0, class R1 = void> struct range_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-02-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-02-parse[`parse`] ¦ ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-02-2constructor[`range_rule_t`] [.small]#[constructor]# ¦ |=== [#boost-urls-grammar-implementation_defined-range_rule_t-02-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-range_rule_t-02[pass:[range_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-grammar-range[range]; ---- [#boost-urls-grammar-implementation_defined-range_rule_t-02-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-range_rule_t-02[pass:[range_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-range_rule_t-02-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-range_rule_t-02[pass:[range_rule_t]]::range_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr range_rule_t( R0 const& first, R1 const& next, std::size_t N, std::size_t M) noexcept; ---- [#boost-urls-grammar-implementation_defined-range_rule_t-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::range_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct xref:boost-urls-grammar-implementation_defined-range_rule_t-02[pass:[range_rule_t]]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-03-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-03-parse[`parse`] ¦ ¦xref:boost-urls-grammar-implementation_defined-range_rule_t-03-2constructor[`range_rule_t`] [.small]#[constructor]# ¦ |=== [#boost-urls-grammar-implementation_defined-range_rule_t-03-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-range_rule_t-03[pass:[range_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-grammar-range[range]; ---- [#boost-urls-grammar-implementation_defined-range_rule_t-03-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-range_rule_t-03[pass:[range_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-range_rule_t-03-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-range_rule_t-03[pass:[range_rule_t]]::range_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr range_rule_t( R const& next, std::size_t N, std::size_t M) noexcept; ---- [#boost-urls-grammar-implementation_defined-token_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::token_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct token_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-token_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-token_rule_t-parse[`parse`] ¦ ¦xref:boost-urls-grammar-implementation_defined-token_rule_t-2constructor[`token_rule_t`] [.small]#[constructor]# ¦ |=== [#boost-urls-grammar-implementation_defined-token_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-token_rule_t[pass:[token_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = core::string_view; ---- [#boost-urls-grammar-implementation_defined-token_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-token_rule_t[pass:[token_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-grammar-implementation_defined-token_rule_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-token_rule_t[pass:[token_rule_t]]::token_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr token_rule_t(CharSet const& cs) noexcept; ---- [#boost-urls-grammar-implementation_defined-tuple_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::tuple_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class R0, class... Rn> class tuple_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-tuple_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-tuple_rule_t-parse[`parse`] ¦ ¦xref:boost-urls-grammar-implementation_defined-tuple_rule_t-2constructor[`tuple_rule_t`] [.small]#[constructor]# ¦ |=== [#boost-urls-grammar-implementation_defined-tuple_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-tuple_rule_t[pass:[tuple_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = mp11::mp_eval_if_c; ---- [#boost-urls-grammar-implementation_defined-tuple_rule_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-tuple_rule_t[pass:[tuple_rule_t]]::tuple_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr tuple_rule_t( R0 const& r0, Rn const&... rn) noexcept; ---- [#boost-urls-grammar-implementation_defined-tuple_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-tuple_rule_t[pass:[tuple_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-squelch_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::squelch_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct squelch_rule_t : empty_value; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-squelch_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-squelch_rule_t-parse[`parse`] ¦ ¦xref:boost-urls-grammar-implementation_defined-squelch_rule_t-2constructor[`squelch_rule_t`] [.small]#[constructor]# ¦ |=== [#boost-urls-grammar-implementation_defined-squelch_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-squelch_rule_t[pass:[squelch_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = void; ---- [#boost-urls-grammar-implementation_defined-squelch_rule_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-squelch_rule_t[pass:[squelch_rule_t]]::squelch_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr squelch_rule_t(Rule const& r) noexcept; ---- [#boost-urls-grammar-implementation_defined-squelch_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-squelch_rule_t[pass:[squelch_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-variant_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::variant_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class R0, class... Rn> class variant_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-variant_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-variant_rule_t-parse[`parse`] ¦ ¦xref:boost-urls-grammar-implementation_defined-variant_rule_t-2constructor[`variant_rule_t`] [.small]#[constructor]# ¦ |=== [#boost-urls-grammar-implementation_defined-variant_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-variant_rule_t[pass:[variant_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = variant2::variant; ---- [#boost-urls-grammar-implementation_defined-variant_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-variant_rule_t[pass:[variant_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const; ---- [#boost-urls-grammar-implementation_defined-variant_rule_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-variant_rule_t[pass:[variant_rule_t]]::variant_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr variant_rule_t( R0 const& r0, Rn const&... rn) noexcept; ---- [#boost-urls-grammar-implementation_defined-vchars_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::vchars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct vchars_t; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-vchars_t-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-implementation_defined-vchars_t-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-vchars_t[pass:[vchars_t]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool operator()(char c) const noexcept; ---- [#boost-urls-grammar-implementation_defined-all_chars_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::all_chars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct all_chars_t; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-implementation_defined-all_chars_t-2constructor[`all_chars_t`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-implementation_defined-all_chars_t-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-implementation_defined-all_chars_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-all_chars_t[pass:[all_chars_t]]::all_chars_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr all_chars_t() noexcept = default; ---- [#boost-urls-grammar-implementation_defined-all_chars_t-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-grammar-implementation_defined-all_chars_t[pass:[all_chars_t]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool operator()(char) const noexcept; ---- [#boost-urls-grammar-alnum_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::alnum_chars The set of letters and digits === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] alnum_chars = {}; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[find_if] and xref:boost-urls-grammar-find_if_not[find_if_not] . [,cpp] ---- system::result< core::string_view > = parse( "Johnny42", token_rule( alnumchars ) ); ---- [,cpp] ---- ALNUM = ALPHA / DIGIT ALPHA = %x41-5A / %x61-7A ; A-Z / a-z DIGIT = %x30-39 ; 0-9 ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B.1. Core Rules (rfc5234)] === See Also xref:boost-urls-grammar-find_if[find_if] , xref:boost-urls-grammar-find_if_not[find_if_not] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-grammar-alpha_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::alpha_chars The set of all letters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] alpha_chars = alpha_chars{}; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[find_if] and xref:boost-urls-grammar-find_if_not[find_if_not] . [,cpp] ---- system::result< core::string_view > rv = parse( "JohnDoe", token_rule( alpha_chars ) ); ---- [,cpp] ---- ALPHA = %x41-5A / %x61-7A ; A-Z / a-z ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B.1. Core Rules (rfc5234)] === See Also xref:boost-urls-grammar-find_if[find_if] , xref:boost-urls-grammar-find_if_not[find_if_not] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-grammar-see_below] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::see_below === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-aligned_storage_impl[`aligned_storage_impl`] ¦ ¦xref:boost-urls-grammar-see_below-ci_equal[`ci_equal`] ¦ ¦xref:boost-urls-grammar-see_below-ci_hash[`ci_hash`] ¦ ¦xref:boost-urls-grammar-see_below-ci_less[`ci_less`] ¦ ¦xref:boost-urls-grammar-see_below-is_charset-0b[`is_charset`] ¦ ¦xref:boost-urls-grammar-see_below-is_charset-0d[`is_charset() = std::declval().operator()( std::declval()))>>`] ¦ ¦xref:boost-urls-grammar-see_below-is_rule-0c[`is_rule`] ¦ ¦xref:boost-urls-grammar-see_below-is_rule-05[`is_rule&>() = std::declval().parse( std::declval(), std::declval()))>>`] ¦ |=== === Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-nearest_pow2[`nearest_pow2`] ¦ ¦xref:boost-urls-grammar-see_below-recycled_add[`recycled_add`] ¦ ¦xref:boost-urls-grammar-see_below-recycled_add_impl[`recycled_add_impl`] ¦ ¦xref:boost-urls-grammar-see_below-recycled_remove[`recycled_remove`] ¦ ¦xref:boost-urls-grammar-see_below-recycled_remove_impl[`recycled_remove_impl`] ¦ |=== [#boost-urls-grammar-see_below-is_charset-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::is_charset === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class T, class = void> struct is_charset : std::false_type; ---- [#boost-urls-grammar-see_below-is_charset-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::is_charset === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct xref:boost-urls-grammar-see_below-is_charset-0b[pass:[is_charset]]() = std::declval().operator()( std::declval()))>> : std::true_type; ---- [#boost-urls-grammar-see_below-ci_hash] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::ci_hash === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct ci_hash; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-ci_hash-is_transparent[`is_transparent`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-ci_hash-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-see_below-ci_hash-is_transparent] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-ci_hash[pass:[ci_hash]]::is_transparent === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using is_transparent = void; ---- [#boost-urls-grammar-see_below-ci_hash-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-ci_hash[pass:[ci_hash]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t operator()(core::string_view s) const noexcept; ---- [#boost-urls-grammar-see_below-ci_equal] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::ci_equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct ci_equal; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-ci_equal-is_transparent[`is_transparent`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-ci_equal-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-see_below-ci_equal-is_transparent] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-ci_equal[pass:[ci_equal]]::is_transparent === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using is_transparent = void; ---- [#boost-urls-grammar-see_below-ci_equal-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-ci_equal[pass:[ci_equal]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class String0, class String1> bool operator()( String0 s0, String1 s1) const noexcept; ---- [#boost-urls-grammar-see_below-ci_less] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::ci_less === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct ci_less; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-ci_less-is_transparent[`is_transparent`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-ci_less-operator_call[`operator()`] ¦ |=== [#boost-urls-grammar-see_below-ci_less-is_transparent] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-ci_less[pass:[ci_less]]::is_transparent === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using is_transparent = void; ---- [#boost-urls-grammar-see_below-ci_less-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-ci_less[pass:[ci_less]]::operator() === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t operator()( core::string_view s0, core::string_view s1) const noexcept; ---- [#boost-urls-grammar-see_below-is_rule-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::is_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class T, class = void> struct is_rule : std::false_type; ---- [#boost-urls-grammar-see_below-is_rule-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::is_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct xref:boost-urls-grammar-see_below-is_rule-0c[pass:[is_rule]]&>() = std::declval().parse( std::declval(), std::declval()))>> : std::is_nothrow_copy_constructible; ---- [#boost-urls-grammar-see_below-aligned_storage_impl] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::aligned_storage_impl === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< std::size_t Size, std::size_t Align> struct aligned_storage_impl; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-see_below-aligned_storage_impl-addr[`addr`] ¦ |=== [#boost-urls-grammar-see_below-aligned_storage_impl-addr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-aligned_storage_impl[pass:[aligned_storage_impl]]::addr === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- void* xref:boost-urls-grammar-see_below-aligned_storage_impl-addr-0b[pass:[addr]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- void const* xref:boost-urls-grammar-see_below-aligned_storage_impl-addr-06[pass:[addr]]() const noexcept; ---- [#boost-urls-grammar-see_below-nearest_pow2] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::nearest_pow2 === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr std::size_t nearest_pow2( std::size_t x, std::size_t f = 0) noexcept; ---- [#boost-urls-grammar-see_below-recycled_add_impl] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::recycled_add_impl === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void recycled_add_impl(std::size_t) noexcept; ---- [#boost-urls-grammar-see_below-recycled_remove_impl] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::recycled_remove_impl === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void recycled_remove_impl(std::size_t) noexcept; ---- [#boost-urls-grammar-see_below-recycled_add] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::recycled_add === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void recycled_add(std::size_t) noexcept; ---- [#boost-urls-grammar-see_below-recycled_remove] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::recycled_remove === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void recycled_remove(std::size_t) noexcept; ---- [#boost-urls-grammar-is_charset] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::is_charset Alias for `std::true_type` if T satisfies _CharSet_ . === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using is_charset = pass:q[_see-below_]; ---- === Description This metafunction determines if the type `T` meets these requirements of _CharSet_ : * An instance of `T` is invocable with this equivalent function signature: [,cpp] ---- bool T::operator()( char ) const noexcept; ---- === Use with `enable_if` on the return value: [,cpp] ---- template< class CharSet > typename std::enable_if< is_charset::value >::type func( CharSet const& cs ); ---- [#boost-urls-grammar-find_if] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::find_if Find the first character in the string that is in the set. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template char const* find_if( char const const* first, char const const* last, CharSet const& cs) noexcept; ---- === Description === Throws nothing. === Return Value A pointer to the found character, otherwise the value `last`. === Parameters |=== | Name | Description | *first* | A pointer to the first character in the string to search. | *last* | A pointer to one past the last character in the string to search. | *cs* | The character set to use. |=== === See Also xref:boost-urls-grammar-find_if_not[find_if_not] . [#boost-urls-grammar-find_if_not] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::find_if_not Find the first character in the string that is not in CharSet === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template char const* find_if_not( char const const* first, char const const* last, CharSet const& cs) noexcept; ---- === Description === Throws nothing. === Return Value A pointer to the found character, otherwise the value `last`. === Parameters |=== | Name | Description | *first* | A pointer to the first character in the string to search. | *last* | A pointer to one past the last character in the string to search. | *cs* | The character set to use. |=== === See Also xref:boost-urls-grammar-find_if_not[find_if_not] . [#boost-urls-grammar-ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ref Return a reference to a character set === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] xref:boost-urls-grammar-ref-0f[pass:[ref]](CharSet const& cs) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] xref:boost-urls-grammar-ref-07[pass:[ref]](Rule const& r) noexcept; ---- === Description This function returns a character set which references the specified object. This is used to reduce the number of bytes of storage (`sizeof`) required by a combinator when it stores a copy of the object. Ownership of the object is not transferred; the caller is responsible for ensuring the lifetime of the object is extended until it is no longer referenced. For best results, `ref` should only be used with compile-time constants. === Parameters |=== | Name | Description | *r* | The rule to use |=== [#boost-urls-grammar-to_lower] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::to_lower Return c converted to lowercase === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr char to_lower(char c) noexcept; ---- === Description This function returns the character, converting it to lowercase if it is uppercase. The function is defined only for low-ASCII characters. [,cpp] ---- assert( to_lower( 'A' ) == 'a' ); ---- === Throws nothing. === Return Value The converted character === Parameters |=== | Name | Description | *c* | The character to convert |=== === See Also xref:boost-urls-grammar-to_upper[to_upper] . [#boost-urls-grammar-to_upper] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::to_upper Return c converted to uppercase === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr char to_upper(char c) noexcept; ---- === Description This function returns the character, converting it to uppercase if it is lowercase. The function is defined only for low-ASCII characters. [,cpp] ---- assert( to_upper( 'a' ) == 'A' ); ---- === Throws nothing. === Return Value The converted character === Parameters |=== | Name | Description | *c* | The character to convert |=== === See Also xref:boost-urls-grammar-to_lower[to_lower] . [#boost-urls-grammar-ci_compare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_compare Return the case-insensitive comparison of s0 and s1 === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- int ci_compare( core::string_view s0, core::string_view s1) noexcept; ---- === Description This returns the lexicographical comparison of two strings, ignoring case. The function is defined only for strings containing low-ASCII characters. [,cpp] ---- assert( ci_compare( "boost", "Boost" ) == 0 ); ---- === Throws nothing. === Return Value 0 if the strings are equal, -1 if `s0` is less than `s1`, or 1 if `s0` is greater than s1. === Parameters |=== | Name | Description | *s0* | The first string | *s1* | The second string |=== === See Also xref:boost-urls-grammar-ci_is_equal-0a[ci_is_equal] , xref:boost-urls-grammar-ci_is_less[ci_is_less] . [#boost-urls-grammar-ci_digest] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_digest Return the case-insensitive digest of a string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t ci_digest(core::string_view s) noexcept; ---- === Description The hash function is non-cryptographic and not hardened against algorithmic complexity attacks. Returned digests are suitable for usage in unordered containers. The function is defined only for strings containing low-ASCII characters. === Return Value The digest === Parameters |=== | Name | Description | *s* | The string |=== [#boost-urls-grammar-ci_is_equal] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_is_equal Return true if s0 equals s1 using case-insensitive comparison === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class String0, class String1> bool xref:boost-urls-grammar-ci_is_equal-0a[pass:[ci_is_equal]]( String0 const& s0, String1 const& s1); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-grammar-ci_is_equal-0b[pass:[ci_is_equal]]( core::string_view s0, core::string_view s1) noexcept; ---- === Description The function is defined only for strings containing low-ASCII characters. [,cpp] ---- assert( ci_is_equal( "Boost", "boost" ) ); ---- === See Also xref:boost-urls-grammar-ci_compare[ci_compare] , xref:boost-urls-grammar-ci_is_less[ci_is_less] . [#boost-urls-grammar-ci_is_less] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_is_less Return true if s0 is less than s1 using case-insensitive comparison === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool ci_is_less( core::string_view s0, core::string_view s1) noexcept; ---- === Description The comparison algorithm implements a case-insensitive total order on the set of all strings; however, it is not a lexicographical comparison. The function is defined only for strings containing low-ASCII characters. [,cpp] ---- assert( ! ci_is_less( "Boost", "boost" ) ); ---- === See Also xref:boost-urls-grammar-ci_compare[ci_compare] , xref:boost-urls-grammar-ci_is_equal-0a[ci_is_equal] . [#boost-urls-grammar-ci_hash] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_hash A case-insensitive hash function object for strings === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using ci_hash = pass:q[_see-below_]; ---- === Description The hash function is non-cryptographic and not hardened against algorithmic complexity attacks. This is a suitable hash function for unordered containers. The function is defined only for strings containing low-ASCII characters. [,cpp] ---- boost::unordered_map< std::string, std::string, ci_hash, ci_equal > m1; std::unordered_map < std::string, std::string, ci_hash, ci_equal > m2; // (since C++20) ---- === See Also xref:boost-urls-grammar-ci_equal[ci_equal] , xref:boost-urls-grammar-ci_less[ci_less] . [#boost-urls-grammar-ci_equal] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_equal A case-insensitive equals predicate for strings === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using ci_equal = pass:q[_see-below_]; ---- === Description The function object returns `true` when two strings are equal, ignoring case. This is a suitable equality predicate for unordered containers. The function is defined only for strings containing low-ASCII characters. [,cpp] ---- boost::unordered_map< std::string, std::string, ci_hash, ci_equal > m1; std::unordered_map < std::string, std::string, ci_hash, ci_equal > m2; // (since C++20) ---- === See Also xref:boost-urls-grammar-ci_hash[ci_hash] , xref:boost-urls-grammar-ci_less[ci_less] . [#boost-urls-grammar-ci_less] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_less A case-insensitive less predicate for strings === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using ci_less = pass:q[_see-below_]; ---- === Description The comparison algorithm implements a case-insensitive total order on the set of all ASCII strings; however, it is not a lexicographical comparison. This is a suitable predicate for ordered containers. The function is defined only for strings containing low-ASCII characters. [,cpp] ---- boost::container::map< std::string, std::string, ci_less > m1; std::map< std::string, std::string, ci_less > m2; // (since C++14) ---- === See Also xref:boost-urls-grammar-ci_equal[ci_equal] , xref:boost-urls-grammar-ci_hash[ci_hash] . [#boost-urls-grammar-dec_octet_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::dec_octet_rule Match a decimal octet === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] dec_octet_rule = {}; ---- === Description A decimal octet is precise way of saying a number from 0 to 255. These are commonly used in IPv4 addresses. [,cpp] ---- using value_type = unsigned char; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- system::result< unsigned char > rv = parse( "255", dec_octet_rule ); ---- [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] === See Also xref:boost-urls-grammar-parse-02[parse] . [#boost-urls-grammar-error] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::error Error codes returned when using rules === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- enum error : int; ---- === Members [,cols=2] |=== |Name |Description |xref:boost-urls-grammar-error-need_more[`pass:v[need_more]`] | More input is needed to match the rule |xref:boost-urls-grammar-error-mismatch[`pass:v[mismatch]`] | The rule did not match the input. |xref:boost-urls-grammar-error-end_of_range[`pass:v[end_of_range]`] | A rule reached the end of a range |xref:boost-urls-grammar-error-leftover[`pass:v[leftover]`] | Leftover input remaining after match. |xref:boost-urls-grammar-error-invalid[`pass:v[invalid]`] | A rule encountered unrecoverable invalid input. |xref:boost-urls-grammar-error-out_of_range[`pass:v[out_of_range]`] | An integer overflowed during parsing. |xref:boost-urls-grammar-error-syntax[`pass:v[syntax]`] | An unspecified syntax error was found. |=== === See Also xref:boost-urls-grammar-condition[condition] , xref:boost-urls-grammar-parse-02[parse] . [#boost-urls-grammar-error-need_more] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-error[pass:[error]]::need_more More input is needed to match the rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- need_more = 1 ---- === Description A rule reached the end of the input, resulting in a partial match. The error is recoverable; the caller may obtain more input if possible and attempt to parse the character buffer again. Custom rules should only return this error if it is completely unambiguous that the rule cannot be matched without more input. [#boost-urls-grammar-error-mismatch] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-error[pass:[error]]::mismatch The rule did not match the input. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- mismatch ---- === Description This error is returned when a rule fails to match the input. The error is recoverable; the caller may rewind the input pointer and attempt to parse again using a different rule. [#boost-urls-grammar-error-end_of_range] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-error[pass:[error]]::end_of_range A rule reached the end of a range === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- end_of_range ---- === Description This indicates that the input was consumed when parsing a xref:boost-urls-grammar-range[range] . The xref:boost-urls-grammar-range_rule-02[range_rule] avoids rewinding the input buffer when this error is returned. Thus the consumed characters are be considered part of the range without contributing additional elements. [#boost-urls-grammar-error-leftover] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-error[pass:[error]]::leftover Leftover input remaining after match. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- leftover ---- [#boost-urls-grammar-error-invalid] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-error[pass:[error]]::invalid A rule encountered unrecoverable invalid input. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- invalid ---- === Description This error is returned when input is matching but one of the requirements is violated. For example if a percent escape is found, but one or both characters that follow are not valid hexadecimal digits. This is usually an unrecoverable error. [#boost-urls-grammar-error-out_of_range] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-error[pass:[error]]::out_of_range An integer overflowed during parsing. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- out_of_range ---- [#boost-urls-grammar-error-syntax] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-error[pass:[error]]::syntax An unspecified syntax error was found. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- syntax ---- [#boost-urls-grammar-condition] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::condition Error conditions for errors received from rules === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- enum condition : int; ---- === Members [,cols=2] |=== |Name |Description |xref:boost-urls-grammar-condition-fatal[`pass:v[fatal]`] | A fatal error in syntax was encountered. |=== === See Also xref:boost-urls-grammar-error[error] , xref:boost-urls-grammar-parse-02[parse] . [#boost-urls-grammar-condition-fatal] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-condition[pass:[condition]]::fatal A fatal error in syntax was encountered. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- fatal = 1 ---- === Description This indicates that parsing cannot continue. [#boost-urls-grammar-is_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::is_rule Determine if T meets the requirements of Rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using is_rule = pass:q[_see-below_]; ---- === Description This is an alias for `std::true_type` if `T` meets the requirements, otherwise it is an alias for `std::false_type`. [,cpp] ---- struct U { struct value_type; auto parse( char const*& it, char const* end) const -> system::result }; static_assert( is_rule::value, "Requirements not met" ); ---- === See Also xref:boost-urls-grammar-parse-02[parse] . [#boost-urls-grammar-delim_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::delim_rule Match a character literal === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] xref:boost-urls-grammar-delim_rule-02[pass:[delim_rule]](char ch) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] xref:boost-urls-grammar-delim_rule-0a[pass:[delim_rule]](CharSet const& cs) noexcept; ---- === Description This matches the specified character. The value is a reference to the character in the underlying buffer, expressed as a `core::string_view`. The function xref:boost-urls-grammar-squelch[squelch] may be used to turn this into `void` instead. If there is no more input, the error code xref:boost-urls-grammar-error-need_more[error::need_more] is returned. [,cpp] ---- using value_type = core::string_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- system::result< core::string_view > rv = parse( ".", delim_rule('.') ); ---- [,cpp] ---- char = %00-FF ---- === Parameters |=== | Name | Description | *ch* | The character to match | *cs* | The character set to use. |=== === See Also xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-squelch[squelch] . [#boost-urls-grammar-digit_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::digit_chars The set of decimal digits === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] digit_chars = {}; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[find_if] and xref:boost-urls-grammar-find_if_not[find_if_not] . [,cpp] ---- system::result< core::string_view > rv = parse( "2022", token_rule( digit_chars ) ); ---- [,cpp] ---- DIGIT = %x30-39 ; 0-9 ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B.1. Core Rules (rfc5234)] === See Also xref:boost-urls-grammar-find_if[find_if] , xref:boost-urls-grammar-find_if_not[find_if_not] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-grammar-hexdig_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::hexdig_chars The set of hexadecimal digits === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] hexdig_chars = {}; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[find_if] and xref:boost-urls-grammar-find_if_not[find_if_not] . [,cpp] ---- system::result< core::string_view > rv = parse( "8086FC19", token_rule( hexdig_chars ) ); ---- [,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. Existing uses suggest case-insensitivity is a de-facto standard. * link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B.1. Core Rules (rfc5234)] * link:https://datatracker.ietf.org/doc/html/rfc7230#section-1.2[1.2. Syntax Notation (rfc7230)] * link:https://datatracker.ietf.org/doc/html/rfc5952#section-2.3[2.3. Uppercase or Lowercase (rfc5952)] * link:https://datatracker.ietf.org/doc/html/rfc5952#section-4.3[4.3. Lowercase (rfc5952)] === See Also xref:boost-urls-grammar-find_if[find_if] , xref:boost-urls-grammar-find_if_not[find_if_not] , xref:boost-urls-grammar-hexdig_value[hexdig_value] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-grammar-hexdig_value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::hexdig_value Return the decimal value of a hex character === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- signed char hexdig_value(char ch) noexcept; ---- === Description This function returns the decimal value of a hexadecimal character, or -1 if the argument is not a valid hexadecimal digit. [,cpp] ---- HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" / "a" / "b" / "c" / "d" / "e" / "f" ---- === Return Value The decimal value or -1 === Parameters |=== | Name | Description | *ch* | The character to check |=== [#boost-urls-grammar-literal_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::literal_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class literal_rule; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-literal_rule-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-literal_rule-2constructor[`literal_rule`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-literal_rule-parse[`parse`] ¦ |=== [#boost-urls-grammar-literal_rule-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-literal_rule[pass:[literal_rule]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = core::string_view; ---- [#boost-urls-grammar-literal_rule-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-literal_rule[pass:[literal_rule]]::literal_rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr explicit literal_rule(char const* s) noexcept; ---- [#boost-urls-grammar-literal_rule-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-literal_rule[pass:[literal_rule]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-grammar-lut_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::lut_chars A set of characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class lut_chars; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-lut_chars-2constructor[`lut_chars`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-grammar-lut_chars-operator_call[`operator()`] ¦ Return true if ch is in the character set. ¦xref:boost-urls-grammar-lut_chars-operator_bitnot[`operator~`] ¦ Return a new character set which is the complement of another character set. |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-lut_chars-08friend-02[`operator+`] ¦ Return the union of two character sets. ¦xref:boost-urls-grammar-lut_chars-08friend-07[`operator-`] ¦ Return a new character set by subtracting |=== === Description The characters defined by instances of this set are provided upon construction. The `constexpr` implementation allows these to become compile-time constants. === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[find_if] and xref:boost-urls-grammar-find_if_not[find_if_not] . [,cpp] ---- constexpr lut_chars vowel_chars = "AEIOU" "aeiou"; system::result< core::string_view > rv = parse( "Aiea", token_rule( vowel_chars ) ); ---- === See Also xref:boost-urls-grammar-find_if[find_if] , xref:boost-urls-grammar-find_if_not[find_if_not] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-grammar-lut_chars-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::lut_chars Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-lut_chars-2constructor-079[pass:[lut_chars]](char ch) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-lut_chars-2constructor-074[pass:[lut_chars]](char const* s) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class Pred, class = void> constexpr xref:boost-urls-grammar-lut_chars-2constructor-02[pass:[lut_chars]](Pred const& pred) noexcept; ---- === Description This function constructs a character set which has as a single member, the character `ch`. [,cpp] ---- constexpr lut_chars asterisk( '*' ); ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *ch* | A character. | *s* | A null-terminated string. |=== [#boost-urls-grammar-lut_chars-operator_call] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::operator() Return true if ch is in the character set. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-lut_chars-operator_call-0fe[pass:[operator()]](unsigned char ch) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-lut_chars-operator_call-0f6[pass:[operator()]](char ch) const noexcept; ---- === Description This function returns true if the character `ch` is in the set, otherwise it returns false. === Constant. === Throws nothing. === Parameters |=== | Name | Description | *ch* | The character to test. |=== [#boost-urls-grammar-lut_chars-08friend-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator+ Return the union of two character sets. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend constexpr xref:boost-urls-grammar-lut_chars[lut_chars] operator+( xref:boost-urls-grammar-lut_chars[lut_chars] const& cs0, xref:boost-urls-grammar-lut_chars[lut_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`. === 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"; ---- === Constant. [#boost-urls-grammar-lut_chars-08friend-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator- Return a new character set by subtracting === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend constexpr xref:boost-urls-grammar-lut_chars[lut_chars] operator-( xref:boost-urls-grammar-lut_chars[lut_chars] const& cs0, xref:boost-urls-grammar-lut_chars[lut_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`. === This statement declares a character set containing all the lowercase letters which are not vowels: [,cpp] ---- constexpr lut_chars consonants = lut_chars("abcdefghijklmnopqrstuvwxyz") - "aeiou"; ---- === Constant. [#boost-urls-grammar-lut_chars-operator_bitnot] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::operator~ Return a new character set which is the complement of another character set. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-lut_chars[lut_chars] operator~() const noexcept; ---- === Description This function returns a new character set which contains all of the characters that are not in `*this`. === This statement declares a character set containing everything but vowels: [,cpp] ---- constexpr lut_chars not_vowels = ~lut_chars( "AEIOU" "aeiou" ); ---- === Constant. === Throws nothing. === Return Value The new character set. [#boost-urls-grammar-operator_plus] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator+ Return the union of two character sets. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-lut_chars[lut_chars] operator+( xref:boost-urls-grammar-lut_chars[lut_chars] const& cs0, xref:boost-urls-grammar-lut_chars[lut_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`. === 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"; ---- === Constant. === Return Value The new character set. === Parameters |=== | Name | Description | *cs0* | A character to join | *cs1* | A character to join |=== [#boost-urls-grammar-operator_minus] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator- Return a new character set by subtracting === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-lut_chars[lut_chars] operator-( xref:boost-urls-grammar-lut_chars[lut_chars] const& cs0, xref:boost-urls-grammar-lut_chars[lut_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`. === This statement declares a character set containing all the lowercase letters which are not vowels: [,cpp] ---- constexpr lut_chars consonants = lut_chars("abcdefghijklmnopqrstuvwxyz") - "aeiou"; ---- === Constant. === Return Value The new character set. === Parameters |=== | Name | Description | *cs0* | A character set to join. | *cs1* | A character set to join. |=== [#boost-urls-grammar-not_empty_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::not_empty_rule Match another rule, if the result is not empty === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] not_empty_rule(Rule const& r); ---- === Description This adapts another rule such that when an empty string is successfully parsed, the result is an error. [,cpp] ---- using value_type = typename Rule::value_type; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- system::result< decode_view > rv = parse( "Program%20Files", not_empty_rule( pct_encoded_rule( unreserved_chars ) ) ); ---- === Parameters |=== | Name | Description | *r* | The rule to match |=== === See Also xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-pct_encoded_rule[pct_encoded_rule] , xref:boost-urls-unreserved_chars[unreserved_chars] . [#boost-urls-grammar-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::parse Parse a character buffer using a rule === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- template system::result xref:boost-urls-grammar-parse-06[pass:[parse]]( char const*& it, char const* end, Rule const& r); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template system::result xref:boost-urls-grammar-parse-02[pass:[parse]]( core::string_view s, Rule const& r); ---- === Return Value The parsed value upon success, otherwise an error. === Parameters |=== | Name | Description | *it* | A pointer to the start. The caller's variable is changed to reflect the amount of input consumed. | *end* | A pointer to the end. | *r* | The rule to use | *s* | The input string |=== [#boost-urls-grammar-optional_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::optional_rule Match a rule, or the empty string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] optional_rule(Rule const& r); ---- === Description Optional BNF elements are denoted with square brackets. If the specified rule returns any error it is treated as if the rule did not match. [,cpp] ---- using value_type = optional< typename Rule::value_type >; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< optional< core::string_view > > rv = parse( "", optional_rule( token_rule( alpha_chars ) ) ); ---- [,cpp] ---- optional = [ rule ] ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.8[3.8. Optional Sequence (rfc5234)] === Parameters |=== | Name | Description | *r* | The rule to match |=== === See Also xref:boost-urls-grammar-alpha_chars[alpha_chars] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-optional[optional] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-grammar-range] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::range A forward range of parsed elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template class range; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-range-const_iterator[`const_iterator`] ¦ A constant, forward iterator to elements of the range ¦xref:boost-urls-grammar-range-const_reference[`const_reference`] ¦ The type of each element of the range ¦xref:boost-urls-grammar-range-difference_type[`difference_type`] ¦ The type used to represent signed integers ¦xref:boost-urls-grammar-range-iterator[`iterator`] ¦ A constant, forward iterator to elements of the range ¦xref:boost-urls-grammar-range-pointer[`pointer`] ¦ Provided for compatibility, unused ¦xref:boost-urls-grammar-range-reference[`reference`] ¦ The type of each element of the range ¦xref:boost-urls-grammar-range-size_type[`size_type`] ¦ The type used to represent unsigned integers ¦xref:boost-urls-grammar-range-value_type[`value_type`] ¦ The type of each element of the range |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-range-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-grammar-range-empty[`empty`] ¦ Return true if the range is empty ¦xref:boost-urls-grammar-range-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-grammar-range-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-grammar-range-2constructor[`range`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-grammar-range-size[`size`] ¦ Return the number of elements in the range ¦xref:boost-urls-grammar-range-string[`string`] ¦ Return the matching part of the string ¦xref:boost-urls-grammar-range-2destructor[`~range`] [.small]#[destructor]# ¦ Destructor |=== === Description Objects of this type are forward ranges returned when parsing using the xref:boost-urls-grammar-range_rule-02[range_rule] . Iteration is performed by re-parsing the underlying character buffer. Ownership of the buffer is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced by the range. [NOTE] The implementation may use temporary, recycled storage for type-erasure. Objects of type `range` are intended to be used ephemerally. That is, for short durations such as within a function scope. 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. === See Also xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-range_rule-02[range_rule] . [#boost-urls-grammar-range-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::value_type The type of each element of the range === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = T; ---- [#boost-urls-grammar-range-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::reference The type of each element of the range === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = T const&; ---- [#boost-urls-grammar-range-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::const_reference The type of each element of the range === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_reference = T const&; ---- [#boost-urls-grammar-range-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::pointer Provided for compatibility, unused === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using pointer = void const*; ---- [#boost-urls-grammar-range-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::size_type The type used to represent unsigned integers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using size_type = std::size_t; ---- [#boost-urls-grammar-range-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::difference_type The type used to represent signed integers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-grammar-range-iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::iterator A constant, forward iterator to elements of the range === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class iterator; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-range-iterator-difference_type[`difference_type`] ¦ ¦xref:boost-urls-grammar-range-iterator-iterator_category[`iterator_category`] ¦ ¦xref:boost-urls-grammar-range-iterator-pointer[`pointer`] ¦ ¦xref:boost-urls-grammar-range-iterator-reference[`reference`] ¦ ¦xref:boost-urls-grammar-range-iterator-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-range-iterator-2constructor[`iterator`] [.small]#[constructor]# ¦ ¦xref:boost-urls-grammar-range-iterator-operator_not_eq[`operator!=`] ¦ ¦xref:boost-urls-grammar-range-iterator-operator_star[`operator*`] ¦ ¦xref:boost-urls-grammar-range-iterator-operator_inc[`operator++`] ¦ ¦xref:boost-urls-grammar-range-iterator-operator_assign[`operator=`] ¦ ¦xref:boost-urls-grammar-range-iterator-operator_eq[`operator==`] ¦ |=== [#boost-urls-grammar-range-iterator-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = T; ---- [#boost-urls-grammar-range-iterator-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = T const&; ---- [#boost-urls-grammar-range-iterator-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::pointer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using pointer = void const*; ---- [#boost-urls-grammar-range-iterator-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::difference_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-grammar-range-iterator-iterator_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::iterator_category === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using iterator_category = std::forward_iterator_tag; ---- [#boost-urls-grammar-range-iterator-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::iterator === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator-2constructor-05[pass:[iterator]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator-2constructor-03[pass:[iterator]](xref:boost-urls-grammar-range-iterator[iterator] const&) = default; ---- [#boost-urls-grammar-range-iterator-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator[iterator]& operator=(xref:boost-urls-grammar-range-iterator[iterator] const&) = default; ---- [#boost-urls-grammar-range-iterator-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::operator* === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator-reference[reference] operator*() const noexcept; ---- [#boost-urls-grammar-range-iterator-operator_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::operator== === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==(xref:boost-urls-grammar-range-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-grammar-range-iterator-operator_not_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::operator!= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=(xref:boost-urls-grammar-range-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-grammar-range-iterator-operator_inc] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::operator++ === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator[iterator]& xref:boost-urls-grammar-range-iterator-operator_inc-06[pass:[operator++]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator[iterator] xref:boost-urls-grammar-range-iterator-operator_inc-05[pass:[operator++]](int) noexcept; ---- [#boost-urls-grammar-range-const_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::const_iterator A constant, forward iterator to elements of the range === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_iterator = xref:boost-urls-grammar-range-iterator[iterator]; ---- [#boost-urls-grammar-range-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::~range Destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ~range(); ---- [#boost-urls-grammar-range-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::range Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-2constructor-01e[pass:[range]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-2constructor-08[pass:[range]](xref:boost-urls-grammar-range[range]&& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-2constructor-01b[pass:[range]](xref:boost-urls-grammar-range[range] const& other) noexcept; ---- === Description Default-constructed ranges have zero elements. === Throws nothing. [#boost-urls-grammar-range-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range[range]& xref:boost-urls-grammar-range-operator_assign-08[pass:[operator=]](xref:boost-urls-grammar-range[range]&& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range[range]& xref:boost-urls-grammar-range-operator_assign-0e[pass:[operator=]](xref:boost-urls-grammar-range[range] const& other) noexcept; ---- === Description After the move, this references the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. The moved-from object becomes as if default-constructed. === Throws nothing. [#boost-urls-grammar-range-begin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::begin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator[iterator] begin() const noexcept; ---- [#boost-urls-grammar-range-end] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::end Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator[iterator] end() const noexcept; ---- [#boost-urls-grammar-range-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::empty Return true if the range is empty === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- [#boost-urls-grammar-range-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::size Return the number of elements in the range === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t size() const noexcept; ---- [#boost-urls-grammar-range-string] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::string Return the matching part of the string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view string() const noexcept; ---- [#boost-urls-grammar-range_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::range_rule Match a repeating number of elements === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] xref:boost-urls-grammar-range_rule-00[pass:[range_rule]]( Rule const& next, std::size_t N = 0, std::size_t M = std::size_t(-1)) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class Rule1, class Rule2> constexpr pass:q[_implementation-defined_] xref:boost-urls-grammar-range_rule-02[pass:[range_rule]]( Rule1 const& first, Rule2 const& next, std::size_t N = 0, std::size_t M = std::size_t(-1)) noexcept; ---- === Description Elements are matched using the passed rule. Normally when the rule returns an error, the range ends and the input is rewound to one past the last character that matched successfully. However, if the rule returns the special value xref:boost-urls-grammar-error-end_of_range[error::end_of_range] , the input is not rewound. This allows for rules which consume input without producing elements in the range. For example, to relax the grammar for a comma-delimited list by allowing extra commas in between elements. [,cpp] ---- using value_type = range< typename Rule::value_type >; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- // range = 1*( ";" token ) system::result< range > rv = parse( ";alpha;xray;charlie", range_rule( tuple_rule( squelch( delim_rule( ';' ) ), token_rule( alpha_chars ) ), 1 ) ); ---- [,cpp] ---- range = *next ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[3.6. Variable Repetition (rfc5234)] === Parameters |=== | Name | Description | *next* | The rule to use for matching each element. The range extends until this rule returns an error. | *N* | The minimum number of elements for the range to be valid. If omitted, this defaults to zero. | *M* | The maximum number of elements for the range to be valid. If omitted, this defaults to unlimited. | *first* | The rule to use for matching the first element. If this rule returns an error, the range is empty. |=== === See Also xref:boost-urls-grammar-alpha_chars[alpha_chars] , xref:boost-urls-grammar-delim_rule-0a[delim_rule] , xref:boost-urls-grammar-error-end_of_range[error::end_of_range] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-range[range] , xref:boost-urls-grammar-tuple_rule[tuple_rule] , xref:boost-urls-grammar-squelch[squelch] . [#boost-urls-grammar-aligned_storage] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::aligned_storage Provides an aligned storage buffer aligned for T === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using aligned_storage = pass:q[_see-below_]; ---- === Description [,cpp] ---- template 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; }; ---- [#boost-urls-grammar-recycled] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::recycled A thread-safe collection of instances of T === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template class recycled; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-recycled-2constructor[`recycled`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-grammar-recycled-2destructor[`~recycled`] [.small]#[destructor]# ¦ Destructor |=== === Description Instances of this type may be used to control where recycled instances of T come from when used with xref:boost-urls-grammar-recycled_ptr[recycled_ptr] . [,cpp] ---- static recycled< std::string > bin; recycled_ptr< std::string > ps( bin ); // Put the string into a known state ps->clear(); ---- === See Also xref:boost-urls-grammar-recycled_ptr[recycled_ptr] . [#boost-urls-grammar-recycled-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled[pass:[recycled]]::~recycled Destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ~recycled(); ---- === Description All recycled instances of T are destroyed. Undefined behavior results if there are any xref:boost-urls-grammar-recycled_ptr[recycled_ptr] which reference this recycle bin. [#boost-urls-grammar-recycled-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled[pass:[recycled]]::recycled Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr recycled() = default; ---- [#boost-urls-grammar-recycled_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::recycled_ptr A pointer to a shared instance of T === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template class recycled_ptr; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-recycled_ptr-acquire[`acquire`] ¦ Return the referenced object ¦xref:boost-urls-grammar-recycled_ptr-bin[`bin`] ¦ Return the referenced recycle bin ¦xref:boost-urls-grammar-recycled_ptr-empty[`empty`] ¦ Return true if this does not reference an object ¦xref:boost-urls-grammar-recycled_ptr-get[`get`] ¦ Return the referenced object ¦xref:boost-urls-grammar-recycled_ptr-2conversion[`operator bool`] ¦ Return true if this references an object ¦xref:boost-urls-grammar-recycled_ptr-operator_star[`operator*`] ¦ Return the referenced object ¦xref:boost-urls-grammar-recycled_ptr-operator_ptr[`operator->`] ¦ Return the referenced object ¦xref:boost-urls-grammar-recycled_ptr-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-grammar-recycled_ptr-2constructor[`recycled_ptr`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-grammar-recycled_ptr-release[`release`] ¦ Release the referenced object ¦xref:boost-urls-grammar-recycled_ptr-2destructor[`~recycled_ptr`] [.small]#[destructor]# ¦ Destructor |=== === Description This is a smart pointer container which can acquire shared ownership of an instance of `T` upon or after construction. The instance is guaranteed to be in a valid, but unknown state. Every recycled pointer references a valid recycle bin. [,cpp] ---- static recycled< std::string > bin; recycled_ptr< std::string > ps( bin ); // Put the string into a known state ps->clear(); ---- [#boost-urls-grammar-recycled_ptr-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::~recycled_ptr Destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ~recycled_ptr(); ---- === Description If this is not empty, shared ownership of the pointee is released. If this was the last reference, the object is returned to the original recycle bin. [,cpp] ---- this->release(); ---- [#boost-urls-grammar-recycled_ptr-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::recycled_ptr Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-grammar-recycled_ptr-2constructor-08[pass:[recycled_ptr]](xref:boost-urls-grammar-recycled[recycled]& bin); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr-2constructor-0ac[pass:[recycled_ptr]]( xref:boost-urls-grammar-recycled[recycled]& bin, std::nullptr_t) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr-2constructor-056[pass:[recycled_ptr]](); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr-2constructor-05e[pass:[recycled_ptr]](std::nullptr_t) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr-2constructor-0ab[pass:[recycled_ptr]](xref:boost-urls-grammar-recycled_ptr[recycled_ptr] const& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr-2constructor-0f[pass:[recycled_ptr]](xref:boost-urls-grammar-recycled_ptr[recycled_ptr]&& other) noexcept; ---- === Description Upon construction, this acquires exclusive access to an object of type `T` which is either recycled from the specified bin, or newly allocated. The object is in an unknown but valid state. [,cpp] ---- static recycled< std::string > bin; recycled_ptr< std::string > ps( bin ); // Put the string into a known state ps->clear(); ---- [,cpp] ---- &this->bin() == &bin && ! this->empty() ---- === Parameters |=== | Name | Description | *bin* | The recycle bin to use | *other* | The pointer to copy |=== === See Also xref:boost-urls-grammar-recycled[recycled] . [#boost-urls-grammar-recycled_ptr-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr[recycled_ptr]& xref:boost-urls-grammar-recycled_ptr-operator_assign-0b[pass:[operator=]](xref:boost-urls-grammar-recycled_ptr[recycled_ptr]&& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr[recycled_ptr]& xref:boost-urls-grammar-recycled_ptr-operator_assign-09[pass:[operator=]](xref:boost-urls-grammar-recycled_ptr[recycled_ptr] const& other) noexcept; ---- === Description If `other` references an object, ownership is transferred including a reference to the recycle bin. After the move, the moved-from object is empty. [,cpp] ---- this->release() ---- [,cpp] ---- &this->bin() == &other->bin() ---- === Throws nothing. === Parameters |=== | Name | Description | *other* | The pointer to move from |=== [#boost-urls-grammar-recycled_ptr-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::empty Return true if this does not reference an object === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description === Throws nothing. [#boost-urls-grammar-recycled_ptr-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::operator bool Return true if this references an object === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit operator bool() const noexcept; ---- === Description [,cpp] ---- return ! this->empty(); ---- === Throws nothing. [#boost-urls-grammar-recycled_ptr-bin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::bin Return the referenced recycle bin === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled[recycled]& bin() const noexcept; ---- === Description === Throws nothing. [#boost-urls-grammar-recycled_ptr-get] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::get Return the referenced object === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- T* get() const noexcept; ---- === Description If this is empty, `nullptr` is returned. === Throws nothing. [#boost-urls-grammar-recycled_ptr-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::operator-> Return the referenced object === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- T* operator->() const noexcept; ---- === Description If this is empty, `nullptr` is returned. === Throws nothing. [#boost-urls-grammar-recycled_ptr-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::operator* Return the referenced object === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- T& operator*() const noexcept; ---- === Description [,cpp] ---- not this->empty() ---- [#boost-urls-grammar-recycled_ptr-acquire] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::acquire Return the referenced object === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- T& acquire(); ---- === Description If this references an object, it is returned. Otherwise, exclusive ownership of a new object of type `T` is acquired and returned. [,cpp] ---- not this->empty() ---- [#boost-urls-grammar-recycled_ptr-release] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::release Release the referenced object === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void release() noexcept; ---- === Description If this references an object, it is released to the referenced recycle bin. The pointer continues to reference the same recycle bin. [,cpp] ---- this->empty() ---- === Throws nothing. [#boost-urls-grammar-string_token] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::string_token === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- namespace string_token = xref:boost[boost]::xref:boost-urls[urls]::xref:boost-urls-string_token[string_token]; ---- [#boost-urls-grammar-string_view_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::string_view_base Common functionality for string views === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class string_view_base; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-const_iterator[`const_iterator`] ¦ The const iterator type ¦xref:boost-urls-grammar-string_view_base-const_pointer[`const_pointer`] ¦ The const pointer type ¦xref:boost-urls-grammar-string_view_base-const_reference[`const_reference`] ¦ The const reference type ¦xref:boost-urls-grammar-string_view_base-const_reverse_iterator[`const_reverse_iterator`] ¦ The const reverse iterator type ¦xref:boost-urls-grammar-string_view_base-difference_type[`difference_type`] ¦ The difference type ¦xref:boost-urls-grammar-string_view_base-iterator[`iterator`] ¦ The iterator type ¦xref:boost-urls-grammar-string_view_base-pointer[`pointer`] ¦ The pointer type ¦xref:boost-urls-grammar-string_view_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-grammar-string_view_base-reverse_iterator[`reverse_iterator`] ¦ The reverse iterator type ¦xref:boost-urls-grammar-string_view_base-size_type[`size_type`] ¦ The size type ¦xref:boost-urls-grammar-string_view_base-traits_type[`traits_type`] ¦ The character traits ¦xref:boost-urls-grammar-string_view_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-at[`at`] ¦ Access a character ¦xref:boost-urls-grammar-string_view_base-back[`back`] ¦ Return the last character ¦xref:boost-urls-grammar-string_view_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-cbegin[`cbegin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-cend[`cend`] ¦ Return an iterator to the end ¦xref:boost-urls-grammar-string_view_base-compare[`compare`] ¦ Return the result of comparing to another string ¦xref:boost-urls-grammar-string_view_base-contains[`contains`] ¦ Return true if matching characters are found ¦xref:boost-urls-grammar-string_view_base-copy[`copy`] ¦ Copy the characters to another buffer ¦xref:boost-urls-grammar-string_view_base-crbegin[`crbegin`] ¦ Return a reverse iterator to the end ¦xref:boost-urls-grammar-string_view_base-crend[`crend`] ¦ Return a reverse iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-data[`data`] ¦ Return a pointer to the character buffer ¦xref:boost-urls-grammar-string_view_base-empty[`empty`] ¦ Return true if the string is empty ¦xref:boost-urls-grammar-string_view_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-grammar-string_view_base-ends_with[`ends_with`] ¦ Return true if a matching suffix exists ¦xref:boost-urls-grammar-string_view_base-find[`find`] ¦ Return the position of matching characters ¦xref:boost-urls-grammar-string_view_base-find_first_not_of[`find_first_not_of`] ¦ Return the position of the first non-match ¦xref:boost-urls-grammar-string_view_base-find_first_of[`find_first_of`] ¦ Return the position of the first match ¦xref:boost-urls-grammar-string_view_base-find_last_not_of[`find_last_not_of`] ¦ Return the position of the last non-match ¦xref:boost-urls-grammar-string_view_base-find_last_of[`find_last_of`] ¦ Return the position of the last match ¦xref:boost-urls-grammar-string_view_base-front[`front`] ¦ Return the first character ¦xref:boost-urls-grammar-string_view_base-length[`length`] ¦ Return the size ¦xref:boost-urls-grammar-string_view_base-max_size[`max_size`] ¦ Return the maximum allowed size ¦xref:boost-urls-grammar-string_view_base-2conversion-06[`operator std::string`] ¦ Conversion ¦xref:boost-urls-grammar-string_view_base-2conversion-0e[`operator core::string_view`] ¦ Conversion ¦xref:boost-urls-grammar-string_view_base-operator_subs[`operator[]`] ¦ Access a character ¦xref:boost-urls-grammar-string_view_base-rbegin[`rbegin`] ¦ Return a reverse iterator to the end ¦xref:boost-urls-grammar-string_view_base-rend[`rend`] ¦ Return a reverse iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-rfind[`rfind`] ¦ Return the position of matching characters ¦xref:boost-urls-grammar-string_view_base-size[`size`] ¦ Return the size ¦xref:boost-urls-grammar-string_view_base-starts_with[`starts_with`] ¦ Return true if a matching prefix exists ¦xref:boost-urls-grammar-string_view_base-substr[`substr`] ¦ Return a view to part of the string |=== === Static Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-npos[`npos`] ¦ A constant used to represent "no position" |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-08friend-09d[`hash_value`] ¦ Return the hash of this value ¦xref:boost-urls-grammar-string_view_base-08friend-017[`operator!=`] ¦ Compare two string views for inequality ¦xref:boost-urls-grammar-string_view_base-08friend-010[`operator<`] ¦ Compare two string views for less than ¦xref:boost-urls-grammar-string_view_base-08friend-0a[`operator<<`] ¦ Format a string to an output stream ¦xref:boost-urls-grammar-string_view_base-08friend-0c[`operator<=`] ¦ Compare two string views for less than or equal ¦xref:boost-urls-grammar-string_view_base-08friend-095[`operator==`] ¦ Compare two string views for equality ¦xref:boost-urls-grammar-string_view_base-08friend-0d[`operator>`] ¦ Compare two string views for greater than ¦xref:boost-urls-grammar-string_view_base-08friend-02[`operator>=`] ¦ Compare two string views for greater than or equal |=== === Description This base class is used to provide common member functions for reference types that behave like string views. This cannot be instantiated directly; Instead, derive from the type and provide constructors which offer any desired preconditions and invariants. [#boost-urls-grammar-string_view_base-traits_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::traits_type The character traits === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef std::char_traits traits_type; ---- [#boost-urls-grammar-string_view_base-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::value_type The value type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef char value_type; ---- [#boost-urls-grammar-string_view_base-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::pointer The pointer type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef char* pointer; ---- [#boost-urls-grammar-string_view_base-const_pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::const_pointer The const pointer type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef char const* const_pointer; ---- [#boost-urls-grammar-string_view_base-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef char& reference; ---- [#boost-urls-grammar-string_view_base-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::const_reference The const reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef char const& const_reference; ---- [#boost-urls-grammar-string_view_base-const_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::const_iterator The const iterator type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef char const* const_iterator; ---- [#boost-urls-grammar-string_view_base-iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::iterator The iterator type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef xref:boost-urls-grammar-string_view_base-const_iterator[const_iterator] iterator; ---- [#boost-urls-grammar-string_view_base-const_reverse_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::const_reverse_iterator The const reverse iterator type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef std::reverse_iterator const_reverse_iterator; ---- [#boost-urls-grammar-string_view_base-reverse_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::reverse_iterator The reverse iterator type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef xref:boost-urls-grammar-string_view_base-const_reverse_iterator[const_reverse_iterator] reverse_iterator; ---- [#boost-urls-grammar-string_view_base-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::size_type The size type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef std::size_t size_type; ---- [#boost-urls-grammar-string_view_base-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::difference_type The difference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- typedef std::ptrdiff_t difference_type; ---- [#boost-urls-grammar-string_view_base-npos] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::npos A constant used to represent "no position" === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t const npos = core::string_view::npos; ---- [#boost-urls-grammar-string_view_base-2conversion-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::operator basic_string_view Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator core::string_view() const noexcept; ---- [#boost-urls-grammar-string_view_base-2conversion-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::operator basic_string, allocator> Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit operator std::string() const noexcept; ---- === Description Conversion to std::string is explicit because assigning to string using an implicit constructor does not preserve capacity. [#boost-urls-grammar-string_view_base-begin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::begin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_iterator[const_iterator] begin() const noexcept; ---- === Description See `core::string_view::begin` [#boost-urls-grammar-string_view_base-end] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::end Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_iterator[const_iterator] end() const noexcept; ---- === Description See `core::string_view::end` [#boost-urls-grammar-string_view_base-cbegin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::cbegin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_iterator[const_iterator] cbegin() const noexcept; ---- === Description See `core::string_view::cbegin` [#boost-urls-grammar-string_view_base-cend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::cend Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_iterator[const_iterator] cend() const noexcept; ---- === Description See `core::string_view::cend` [#boost-urls-grammar-string_view_base-rbegin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::rbegin Return a reverse iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reverse_iterator[const_reverse_iterator] rbegin() const noexcept; ---- === Description See `core::string_view::rbegin` [#boost-urls-grammar-string_view_base-rend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::rend Return a reverse iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reverse_iterator[const_reverse_iterator] rend() const noexcept; ---- === Description See `core::string_view::rend` [#boost-urls-grammar-string_view_base-crbegin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::crbegin Return a reverse iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reverse_iterator[const_reverse_iterator] crbegin() const noexcept; ---- === Description See `core::string_view::crbegin` [#boost-urls-grammar-string_view_base-crend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::crend Return a reverse iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reverse_iterator[const_reverse_iterator] crend() const noexcept; ---- === Description See `core::string_view::crend` [#boost-urls-grammar-string_view_base-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::size Return the size === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] size() const noexcept; ---- === Description See `core::string_view::size` [#boost-urls-grammar-string_view_base-length] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::length Return the size === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] length() const noexcept; ---- === Description See `core::string_view::length` [#boost-urls-grammar-string_view_base-max_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::max_size Return the maximum allowed size === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] max_size() const noexcept; ---- === Description See `core::string_view::max_size` [#boost-urls-grammar-string_view_base-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::empty Return true if the string is empty === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool empty() const noexcept; ---- === Description See `core::string_view::size` [#boost-urls-grammar-string_view_base-operator_subs] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::operator[] Access a character === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reference[const_reference] operator[](xref:boost-urls-grammar-string_view_base-size_type[size_type] pos) const noexcept; ---- === Description See `core::string_view::operator[]` [#boost-urls-grammar-string_view_base-at] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::at Access a character === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reference[const_reference] at(xref:boost-urls-grammar-string_view_base-size_type[size_type] pos) const; ---- === Description See `core::string_view::at` [#boost-urls-grammar-string_view_base-front] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::front Return the first character === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reference[const_reference] front() const noexcept; ---- === Description See `core::string_view::front` [#boost-urls-grammar-string_view_base-back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::back Return the last character === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_reference[const_reference] back() const noexcept; ---- === Description See `core::string_view::back` [#boost-urls-grammar-string_view_base-data] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::data Return a pointer to the character buffer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-const_pointer[const_pointer] data() const noexcept; ---- === Description See `core::string_view::data` [#boost-urls-grammar-string_view_base-copy] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::copy Copy the characters to another buffer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] copy( char* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] n, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const; ---- === Description See `core::string_view::copy` [#boost-urls-grammar-string_view_base-substr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::substr Return a view to part of the string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr core::string_view substr( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0, xref:boost-urls-grammar-string_view_base-size_type[size_type] n = core::string_view::npos) const; ---- === Description See `core::string_view::substr` [#boost-urls-grammar-string_view_base-compare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::compare Return the result of comparing to another string === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int xref:boost-urls-grammar-string_view_base-compare-02[pass:[compare]](core::string_view str) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int xref:boost-urls-grammar-string_view_base-compare-0a[pass:[compare]]( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, core::string_view str) const; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int xref:boost-urls-grammar-string_view_base-compare-0e[pass:[compare]]( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos2, xref:boost-urls-grammar-string_view_base-size_type[size_type] n2) const; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int xref:boost-urls-grammar-string_view_base-compare-07[pass:[compare]](char const* s) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int xref:boost-urls-grammar-string_view_base-compare-0b[pass:[compare]]( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, char const* s) const; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int xref:boost-urls-grammar-string_view_base-compare-0c[pass:[compare]]( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] n2) const; ---- === Description See `core::string_view::compare` [#boost-urls-grammar-string_view_base-starts_with] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::starts_with Return true if a matching prefix exists === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-starts_with-06[pass:[starts_with]](core::string_view x) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-starts_with-0b[pass:[starts_with]](char x) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-starts_with-0d[pass:[starts_with]](char const* x) const noexcept; ---- === Description See `core::string_view::starts_with` [#boost-urls-grammar-string_view_base-ends_with] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::ends_with Return true if a matching suffix exists === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-ends_with-0a[pass:[ends_with]](core::string_view x) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-ends_with-06[pass:[ends_with]](char x) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-ends_with-0c[pass:[ends_with]](char const* x) const noexcept; ---- === Description See `core::string_view::ends_with` [#boost-urls-grammar-string_view_base-find] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find Return the position of matching characters === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find-0d[pass:[find]]( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find-00[pass:[find]]( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find-07[pass:[find]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find-0c[pass:[find]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find` [#boost-urls-grammar-string_view_base-rfind] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::rfind Return the position of matching characters === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-rfind-0ed[pass:[rfind]]( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-rfind-0eb[pass:[rfind]]( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-rfind-0b[pass:[rfind]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-rfind-0d[pass:[rfind]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::rfind` [#boost-urls-grammar-string_view_base-find_first_of] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_of Return the position of the first match === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_of-0ab[pass:[find_first_of]]( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_of-04[pass:[find_first_of]]( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_of-0af[pass:[find_first_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_of-08[pass:[find_first_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_of` [#boost-urls-grammar-string_view_base-find_last_of] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_of Return the position of the last match === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_of-00[pass:[find_last_of]]( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_of-0c[pass:[find_last_of]]( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_of-02[pass:[find_last_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_of-08[pass:[find_last_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_of` [#boost-urls-grammar-string_view_base-find_first_not_of] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_not_of Return the position of the first non-match === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_not_of-0e[pass:[find_first_not_of]]( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_not_of-02[pass:[find_first_not_of]]( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_not_of-0a[pass:[find_first_not_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_first_not_of-0c[pass:[find_first_not_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_not_of` [#boost-urls-grammar-string_view_base-find_last_not_of] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_not_of Return the position of the last non-match === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_not_of-03[pass:[find_last_not_of]]( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_not_of-0d[pass:[find_last_not_of]]( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_not_of-01[pass:[find_last_not_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] xref:boost-urls-grammar-string_view_base-find_last_not_of-06[pass:[find_last_not_of]]( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_not_of` [#boost-urls-grammar-string_view_base-contains] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::contains Return true if matching characters are found === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-contains-08[pass:[contains]](core::string_view sv) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-contains-04[pass:[contains]](char c) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool xref:boost-urls-grammar-string_view_base-contains-03[pass:[contains]](char const* s) const noexcept; ---- === Description See `core::string_view::contains` [#boost-urls-grammar-string_view_base-08friend-095] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator== Compare two string views for equality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator==( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-string_view_base-08friend-017] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator!= Compare two string views for inequality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator!=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-string_view_base-08friend-010] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator< Compare two string views for less than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator<( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-string_view_base-08friend-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator<= Compare two string views for less than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator<=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-string_view_base-08friend-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator> Compare two string views for greater than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator>( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-string_view_base-08friend-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator>= Compare two string views for greater than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator>=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-string_view_base-08friend-09d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::hash_value Return the hash of this value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend std::size_t hash_value(xref:boost-urls-grammar-string_view_base[string_view_base] const& s) noexcept; ---- [#boost-urls-grammar-string_view_base-08friend-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator<< Format a string to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend std::ostream& operator<<( std::ostream& os, xref:boost-urls-grammar-string_view_base[string_view_base] const& s); ---- [#boost-urls-grammar-operator_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator== Compare two string views for equality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator==( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-operator_not_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator!= Compare two string views for inequality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator!=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-operator_lt] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator< Compare two string views for less than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator<( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-operator_le] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator<= Compare two string views for less than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator<=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-operator_gt] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator> Compare two string views for greater than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator>( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-operator_ge] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator>= Compare two string views for greater than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator>=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both arguments are convertible to `core::string_view` and at least one of the arguments is derived from `string_view_base`. [#boost-urls-grammar-hash_value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::hash_value Return the hash of this value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t hash_value(xref:boost-urls-grammar-string_view_base[string_view_base] const& s) noexcept; ---- [#boost-urls-grammar-operator_lshift] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::operator<< Format a string to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-grammar-string_view_base[string_view_base] const& s); ---- [#boost-urls-grammar-token_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::token_rule Match a non-empty string of characters from a set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] token_rule(CharSet const& cs) noexcept; ---- === Description If there is no more input, the error code xref:boost-urls-grammar-error-need_more[error::need_more] is returned. [,cpp] ---- using value_type = core::string_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- system::result< core::string_view > rv = parse( "abcdef", token_rule( alpha_chars ) ); ---- [,cpp] ---- token = 1*( ch ) ---- === Parameters |=== | Name | Description | *cs* | The character set to use |=== === See Also xref:boost-urls-grammar-alpha_chars[alpha_chars] , xref:boost-urls-grammar-parse-02[parse] . [#boost-urls-grammar-tuple_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::tuple_rule Match a series of rules in order === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class R0, class... Rn> constexpr pass:q[_implementation-defined_] tuple_rule( R0 const& r0, Rn const&... rn) noexcept; ---- === Description This matches a series of rules in the order specified. Upon success the input is adjusted to point to the first unconsumed character. There is no implicit specification of linear white space between each rule. [,cpp] ---- using value_type = __see_below__; ---- The sequence rule usually returns a `std::tuple` containing the the `value_type` of each corresponding rule in the sequence, except that `void` values are removed. However, if there is exactly one non-void value type `T`, then the sequence rule returns `system::result<T>` instead of `system::result<tuple<...>>`. === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,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 ) ); ---- [,cpp] ---- sequence = rule1 rule2 rule3... ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.1[3.1. Concatenation (rfc5234)] === Parameters |=== | Name | Description | *rn* | A list of one or more rules to match |=== === See Also xref:boost-urls-grammar-dec_octet_rule[dec_octet_rule] , xref:boost-urls-grammar-delim_rule-0a[delim_rule] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-squelch[squelch] . [#boost-urls-grammar-squelch] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::squelch Squelch the value of a rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] squelch(Rule const& r) noexcept; ---- === Description This function returns a new rule which matches the specified rule, and converts its value type to `void`. This is useful for matching delimiters in a grammar, where the value for the delimiter is not needed. [,cpp] ---- using value_type = void; ---- === With `squelch`: [,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 ) ) ); ---- === Without `squelch`: [,cpp] ---- system::result< std::tuple< decode_view, core::string_view, core::string_view > > rv = parse( "www.example.com:443", tuple_rule( pct_encoded_rule(unreserved_chars + '-' + '.'), delim_rule( ':' ), token_rule( digit_chars ) ) ); ---- === Parameters |=== | Name | Description | *r* | The rule to squelch |=== === See Also xref:boost-urls-grammar-delim_rule-0a[delim_rule] , xref:boost-urls-grammar-digit_chars[digit_chars] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-tuple_rule[tuple_rule] , xref:boost-urls-grammar-token_rule[token_rule] , xref:boost-urls-decode_view[decode_view] , xref:boost-urls-pct_encoded_rule[pct_encoded_rule] , xref:boost-urls-unreserved_chars[unreserved_chars] . [#boost-urls-grammar-unsigned_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::unsigned_rule Match an unsigned decimal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct unsigned_rule; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-unsigned_rule-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-unsigned_rule-parse[`parse`] ¦ |=== === Description Extra leading zeroes are disallowed. [,cpp] ---- using value_type = Unsigned; ---- === Rules are used with the function xref:boost-urls-grammar-unsigned_rule-parse[parse] . [,cpp] ---- system::result< unsigned short > rv = parse( "32767", unsigned_rule< unsigned short >{} ); ---- [,cpp] ---- unsigned = "0" / ( ["1"..."9"] *DIGIT ) ---- === See Also xref:boost-urls-grammar-parse-02[grammar::parse] . [#boost-urls-grammar-unsigned_rule-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-unsigned_rule[pass:[unsigned_rule]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = Unsigned; ---- [#boost-urls-grammar-unsigned_rule-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-unsigned_rule[pass:[unsigned_rule]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-grammar-variant_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::variant_rule Match one of a set of rules === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class R0, class... Rn> constexpr pass:q[_implementation-defined_] variant_rule( R0 const& r0, Rn const&... rn) noexcept; ---- === Description Each specified rule is tried in sequence. When the first match occurs, the result is stored and returned in the variant. If no match occurs, an error is returned. [,cpp] ---- using value_type = variant< typename Rules::value_type... >; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,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('*') ) ); ---- [,cpp] ---- variant = rule1 / rule2 / rule3... ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.2[3.2. Alternatives (rfc5234)] * link:https://datatracker.ietf.org/doc/html/rfc7230#section-5.3[5.3. Request Target (rfc7230)] === See Also xref:boost-urls-absolute_uri_rule[absolute_uri_rule] , xref:boost-urls-authority_rule[authority_rule] , xref:boost-urls-grammar-delim_rule-0a[delim_rule] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-origin_form_rule[origin_form_rule] , xref:boost-urls-url_view[url_view] . [#boost-urls-grammar-vchars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::vchars The set of visible characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] vchars = {}; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[find_if] and xref:boost-urls-grammar-find_if_not[find_if_not] . [,cpp] ---- system::result< core::string_view > rv = parse( "JohnDoe", token_rule( vchars ) ); ---- [,cpp] ---- VCHAR = 0x21-0x7E ; visible (printing) characters ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1[B.1. Core Rules (rfc5234)] === See Also xref:boost-urls-grammar-find_if[find_if] , xref:boost-urls-grammar-find_if_not[find_if_not] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-grammar-all_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::all_chars The set of all characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] all_chars = all_chars{}; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[find_if] and xref:boost-urls-grammar-find_if_not[find_if_not] . [,cpp] ---- system::result< core::string_view > rv = parse( "JohnDoe", token_rule( all_chars ) ); ---- [,cpp] ---- ALL = %x00-FF ---- === See Also xref:boost-urls-grammar-find_if[find_if] , xref:boost-urls-grammar-find_if_not[find_if_not] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-token_rule[token_rule] . [#boost-urls-error_types] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::error_types === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-error_types-error_category[`error_category`] ¦ The type of error category used by the library ¦xref:boost-urls-error_types-error_code[`error_code`] ¦ The type of error code used by the library ¦xref:boost-urls-error_types-error_condition[`error_condition`] ¦ The type of error condition used by the library ¦xref:boost-urls-error_types-result[`result`] ¦ The type of result returned by library functions ¦xref:boost-urls-error_types-system_error[`system_error`] ¦ The type of system error thrown by the library |=== [#boost-urls-error_types-error_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::error_category The type of error category used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using error_category = xref:boost[boost]::system::error_category; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `system::error_category` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error_types-error_code] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::error_code The type of error code used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using error_code = xref:boost[boost]::system::error_code; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `system::error_code` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error_types-error_condition] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::error_condition The type of error condition used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using error_condition = xref:boost[boost]::system::error_condition; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `system::error_condition` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error_types-system_error] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::system_error The type of system error thrown by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using system_error = xref:boost[boost]::system::system_error; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `system::system_error` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error_types-generic_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::generic_category A function to return the generic error category used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using xref:boost[boost]::system::generic_category; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `core::string_view` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error_types-system_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::system_category A function to return the system error category used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using xref:boost[boost]::system::system_category; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `core::string_view` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error_types-errc] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::errc The set of constants used for cross-platform error codes === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- namespace errc = xref:boost[boost]::system::errc; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `core::string_view` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error_types-result] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error_types[pass:[error_types]]::result The type of result returned by library functions === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using result = xref:boost[boost]::system::result; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `system::result` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. This is an alias template used as the return type for functions that can either return a container, or fail with an error code. This is a brief synopsis of the type: [,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 ---- === Given the function xref:boost-urls-parse_uri[parse_uri] with this signature: [,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: [,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: [,cpp] ---- system::result< url_view > rv = parse_uri( "http://example.com/path/to/file.txt" ); if(! rv ) std::cout << rv.error(); else std::cout << *rv; ---- * link:https://boost.org/libs/system/doc/html/system.html#ref_resultt_e[`boost::system::result`] === See Also [#boost-urls-optional] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::optional The type of optional used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using optional = xref:boost[boost]::optional; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `boost::optional` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-error] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::error Error codes returned the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- enum error : int; ---- === Members [,cols=2] |=== |Name |Description |xref:boost-urls-error-success[`pass:v[success]`] | The operation completed successfully. |xref:boost-urls-error-illegal_null[`pass:v[illegal_null]`] | Null encountered in pct-encoded. |xref:boost-urls-error-illegal_reserved_char[`pass:v[illegal_reserved_char]`] | Illegal reserved character in encoded string. |xref:boost-urls-error-non_canonical[`pass:v[non_canonical]`] | A grammar element was not in canonical form. |xref:boost-urls-error-bad_pct_hexdig[`pass:v[bad_pct_hexdig]`] | Bad hexadecimal digit. |xref:boost-urls-error-incomplete_encoding[`pass:v[incomplete_encoding]`] | The percent-encoded sequence is incomplete. |xref:boost-urls-error-missing_pct_hexdig[`pass:v[missing_pct_hexdig]`] | Missing hexadecimal digit. |xref:boost-urls-error-no_space[`pass:v[no_space]`] | No space in output buffer |xref:boost-urls-error-not_a_base[`pass:v[not_a_base]`] | The URL is not a base URL |=== [#boost-urls-error-success] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::success The operation completed successfully. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- success = 0 ---- [#boost-urls-error-illegal_null] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::illegal_null Null encountered in pct-encoded. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- illegal_null ---- [#boost-urls-error-illegal_reserved_char] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::illegal_reserved_char Illegal reserved character in encoded string. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- illegal_reserved_char ---- [#boost-urls-error-non_canonical] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::non_canonical A grammar element was not in canonical form. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- non_canonical ---- [#boost-urls-error-bad_pct_hexdig] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::bad_pct_hexdig Bad hexadecimal digit. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bad_pct_hexdig ---- === Description This error condition is fatal. [#boost-urls-error-incomplete_encoding] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::incomplete_encoding The percent-encoded sequence is incomplete. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- incomplete_encoding ---- === Description This error condition is fatal. [#boost-urls-error-missing_pct_hexdig] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::missing_pct_hexdig Missing hexadecimal digit. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- missing_pct_hexdig ---- === Description This error condition is fatal. [#boost-urls-error-no_space] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::no_space No space in output buffer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- no_space ---- === Description This error is returned when a provided output buffer was too small to hold the complete result of an algorithm. [#boost-urls-error-not_a_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-error[pass:[error]]::not_a_base The URL is not a base URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- not_a_base ---- [#boost-urls-string_token] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::string_token === Namespaces [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined[`implementation_defined`] ¦ ¦xref:boost-urls-string_token-see_below[`see_below`] ¦ |=== === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-arg[`arg`] ¦ Base class for string tokens, and algorithm parameters ¦xref:boost-urls-string_token-is_token[`is_token`] ¦ Metafunction returning true if T is a StringToken ¦xref:boost-urls-string_token-return_string[`return_string`] ¦ A token for returning a plain string |=== === Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-append_to[`append_to`] ¦ Create a token for appending to a plain string ¦xref:boost-urls-string_token-assign_to[`assign_to`] ¦ A token for assigning to a plain string ¦xref:boost-urls-string_token-preserve_size[`preserve_size`] ¦ A token for producing a durable core::string_view from a temporary string |=== [#boost-urls-string_token-arg] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::arg Base class for string tokens, and algorithm parameters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct arg; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-arg-2constructor[`arg`] [.small]#[constructor]# ¦ Default constructor Default move constructor Deleted copy constructor ¦xref:boost-urls-string_token-arg-operator_assign[`operator=`] ¦ Deleted copy assignment Deleted move assignment ¦xref:boost-urls-string_token-arg-prepare[`prepare`] ¦ Return a modifiable character buffer ¦xref:boost-urls-string_token-arg-2destructor[`~arg`] [.small]#[destructor]# ¦ Virtual destructor |=== === Description This abstract interface provides a means for an algorithm to generically obtain a modifiable, contiguous character buffer of prescribed size. As the author of an algorithm simply declare an rvalue reference as a parameter type. Instances of this type are intended only to be used once and then destroyed. === The declared function accepts any temporary instance of `arg` to be used for writing: [,cpp] ---- void algorithm( string_token::arg&& dest ); ---- To implement the interface for your type or use-case, derive from the class and implement the prepare function. [#boost-urls-string_token-arg-prepare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::prepare Return a modifiable character buffer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual char* prepare(std::size_t n) = 0; ---- === Description This function attempts to obtain a character buffer with space for at least `n` characters. Upon success, a pointer to the beginning of the buffer is returned. Ownership is not transferred; the caller should not attempt to free the storage. The buffer shall remain valid until `this` is destroyed. [NOTE] This function may only be called once. After invoking the function, the only valid operation is destruction. [#boost-urls-string_token-arg-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::~arg Virtual destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr virtual ~arg() = default; ---- [#boost-urls-string_token-arg-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::arg Default constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-string_token-arg-2constructor-01[pass:[arg]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-string_token-arg-2constructor-0c[pass:[arg]](xref:boost-urls-string_token-arg[arg]&&) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-string_token-arg-2constructor-05[pass:[arg]](xref:boost-urls-string_token-arg[arg] const&) = delete; ---- [#boost-urls-string_token-arg-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::operator= Deleted move assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-string_token-arg[arg]& xref:boost-urls-string_token-arg-operator_assign-0f[pass:[operator=]](xref:boost-urls-string_token-arg[arg]&&) = delete; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-string_token-arg[arg]& xref:boost-urls-string_token-arg-operator_assign-01[pass:[operator=]](xref:boost-urls-string_token-arg[arg] const&) = delete; ---- [#boost-urls-string_token-see_below] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::see_below === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-see_below-is_token-05[`is_token`] ¦ Metafunction returning true if T is a StringToken ¦xref:boost-urls-string_token-see_below-is_token-0e[`is_token().prepare( std::declval())), decltype(std::declval().result())>>`] ¦ Metafunction returning true if T is a StringToken |=== [#boost-urls-string_token-see_below-is_token-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-see_below[pass:[see_below]]::is_token Metafunction returning true if T is a StringToken === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class T, class = void> struct is_token : std::false_type; ---- [#boost-urls-string_token-see_below-is_token-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-see_below[pass:[see_below]]::is_token Metafunction returning true if T is a StringToken === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct xref:boost-urls-string_token-see_below-is_token-05[pass:[is_token]]().prepare( std::declval())), decltype(std::declval().result())>> : std::integral_constant().result()), typename T::result_type>::value && std::is_same().prepare(0)), char *>::value && std::is_base_of::value && std::is_convertible::value>; ---- [#boost-urls-string_token-is_token] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::is_token Metafunction returning true if T is a StringToken === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using is_token = pass:q[_see-below_]; ---- [#boost-urls-string_token-implementation_defined] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::implementation_defined === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined-append_to_t[`append_to_t`] ¦ ¦xref:boost-urls-string_token-implementation_defined-assign_to_t[`assign_to_t`] ¦ ¦xref:boost-urls-string_token-implementation_defined-preserve_size_t[`preserve_size_t`] ¦ ¦xref:boost-urls-string_token-implementation_defined-return_string[`return_string`] ¦ |=== [#boost-urls-string_token-implementation_defined-return_string] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::return_string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct return_string : xref:boost-urls-string_token-arg[arg]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined-return_string-result_type[`result_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-arg-operator_assign[`operator=`] ¦ Deleted copy assignment Deleted move assignment ¦xref:boost-urls-string_token-arg-prepare[`prepare`] ¦ Return a modifiable character buffer ¦xref:boost-urls-string_token-implementation_defined-return_string-result[`result`] ¦ |=== [#boost-urls-string_token-implementation_defined-return_string-result_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-return_string[pass:[return_string]]::result_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using result_type = std::string; ---- [#boost-urls-string_token-implementation_defined-return_string-prepare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-return_string[pass:[return_string]]::prepare === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual char* prepare(std::size_t n) override; ---- [#boost-urls-string_token-implementation_defined-return_string-result] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-return_string[pass:[return_string]]::result === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- pass:q[_implementation-defined_] result() noexcept; ---- [#boost-urls-string_token-implementation_defined-append_to_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::append_to_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct append_to_t : xref:boost-urls-string_token-arg[arg]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined-append_to_t-result_type[`result_type`] ¦ ¦xref:boost-urls-string_token-implementation_defined-append_to_t-string_type[`string_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined-append_to_t-2constructor[`append_to_t`] [.small]#[constructor]# ¦ ¦xref:boost-urls-string_token-arg-operator_assign[`operator=`] ¦ Deleted copy assignment Deleted move assignment ¦xref:boost-urls-string_token-arg-prepare[`prepare`] ¦ Return a modifiable character buffer ¦xref:boost-urls-string_token-implementation_defined-append_to_t-result[`result`] ¦ |=== [#boost-urls-string_token-implementation_defined-append_to_t-string_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-append_to_t[pass:[append_to_t]]::string_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using string_type = std::basic_string, Alloc>; ---- [#boost-urls-string_token-implementation_defined-append_to_t-result_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-append_to_t[pass:[append_to_t]]::result_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using result_type = pass:q[_implementation-defined_]&; ---- [#boost-urls-string_token-implementation_defined-append_to_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-append_to_t[pass:[append_to_t]]::append_to_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit append_to_t(pass:q[_implementation-defined_]& s) noexcept; ---- [#boost-urls-string_token-implementation_defined-append_to_t-prepare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-append_to_t[pass:[append_to_t]]::prepare === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual char* prepare(std::size_t n) override; ---- [#boost-urls-string_token-implementation_defined-append_to_t-result] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-append_to_t[pass:[append_to_t]]::result === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- pass:q[_implementation-defined_] result() noexcept; ---- [#boost-urls-string_token-implementation_defined-assign_to_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::assign_to_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct assign_to_t : xref:boost-urls-string_token-arg[arg]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined-assign_to_t-result_type[`result_type`] ¦ ¦xref:boost-urls-string_token-implementation_defined-assign_to_t-string_type[`string_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined-assign_to_t-2constructor[`assign_to_t`] [.small]#[constructor]# ¦ ¦xref:boost-urls-string_token-arg-operator_assign[`operator=`] ¦ Deleted copy assignment Deleted move assignment ¦xref:boost-urls-string_token-arg-prepare[`prepare`] ¦ Return a modifiable character buffer ¦xref:boost-urls-string_token-implementation_defined-assign_to_t-result[`result`] ¦ |=== [#boost-urls-string_token-implementation_defined-assign_to_t-string_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-assign_to_t[pass:[assign_to_t]]::string_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using string_type = std::basic_string, Alloc>; ---- [#boost-urls-string_token-implementation_defined-assign_to_t-result_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-assign_to_t[pass:[assign_to_t]]::result_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using result_type = pass:q[_implementation-defined_]&; ---- [#boost-urls-string_token-implementation_defined-assign_to_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-assign_to_t[pass:[assign_to_t]]::assign_to_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit assign_to_t(pass:q[_implementation-defined_]& s) noexcept; ---- [#boost-urls-string_token-implementation_defined-assign_to_t-prepare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-assign_to_t[pass:[assign_to_t]]::prepare === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual char* prepare(std::size_t n) override; ---- [#boost-urls-string_token-implementation_defined-assign_to_t-result] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-assign_to_t[pass:[assign_to_t]]::result === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- pass:q[_implementation-defined_] result() noexcept; ---- [#boost-urls-string_token-implementation_defined-preserve_size_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::preserve_size_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct preserve_size_t : xref:boost-urls-string_token-arg[arg]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-implementation_defined-preserve_size_t-result_type[`result_type`] ¦ ¦xref:boost-urls-string_token-implementation_defined-preserve_size_t-string_type[`string_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-string_token-arg-operator_assign[`operator=`] ¦ Deleted copy assignment Deleted move assignment ¦xref:boost-urls-string_token-arg-prepare[`prepare`] ¦ Return a modifiable character buffer ¦xref:boost-urls-string_token-implementation_defined-preserve_size_t-2constructor[`preserve_size_t`] [.small]#[constructor]# ¦ ¦xref:boost-urls-string_token-implementation_defined-preserve_size_t-result[`result`] ¦ |=== [#boost-urls-string_token-implementation_defined-preserve_size_t-result_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-preserve_size_t[pass:[preserve_size_t]]::result_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using result_type = core::string_view; ---- [#boost-urls-string_token-implementation_defined-preserve_size_t-string_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-preserve_size_t[pass:[preserve_size_t]]::string_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using string_type = std::basic_string, Alloc>; ---- [#boost-urls-string_token-implementation_defined-preserve_size_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-preserve_size_t[pass:[preserve_size_t]]::preserve_size_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit preserve_size_t(pass:q[_implementation-defined_]& s) noexcept; ---- [#boost-urls-string_token-implementation_defined-preserve_size_t-prepare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-preserve_size_t[pass:[preserve_size_t]]::prepare === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual char* prepare(std::size_t n) override; ---- [#boost-urls-string_token-implementation_defined-preserve_size_t-result] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-string_token-implementation_defined-preserve_size_t[pass:[preserve_size_t]]::result === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- pass:q[_implementation-defined_] result() noexcept; ---- [#boost-urls-string_token-return_string] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::return_string A token for returning a plain string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using return_string = pass:q[_implementation-defined_]; ---- [#boost-urls-string_token-append_to] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::append_to Create a token for appending to a plain string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template> pass:q[_implementation-defined_] append_to(std::basic_string, Alloc>& s); ---- [#boost-urls-string_token-assign_to] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::assign_to A token for assigning to a plain string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template> pass:q[_implementation-defined_] assign_to(std::basic_string, Alloc>& s); ---- [#boost-urls-string_token-preserve_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::preserve_size A token for producing a durable core::string_view from a temporary string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template> pass:q[_implementation-defined_] preserve_size(std::basic_string, Alloc>& s); ---- [#boost-urls-variant] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::variant The type of variant used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using variant = xref:boost[boost]::variant2::variant; ---- === Description [WARNING] This alias is no longer supported and should not be used in new code. Please use `boost::variant2::variant` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-host_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::host_type Identifies the type of host in a URL. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- enum host_type : int; ---- === Members [,cols=2] |=== |Name |Description |xref:boost-urls-host_type-none[`pass:v[none]`] | No host is specified. |xref:boost-urls-host_type-name[`pass:v[name]`] | A host is specified by reg-name. |xref:boost-urls-host_type-ipv4[`pass:v[ipv4]`] | A host is specified by xref:boost-urls-ipv4_address[ipv4_address] . |xref:boost-urls-host_type-ipv6[`pass:v[ipv6]`] | A host is specified by xref:boost-urls-ipv6_address[ipv6_address] . |xref:boost-urls-host_type-ipvfuture[`pass:v[ipvfuture]`] | A host is specified by IPvFuture. |=== === Description Values of this type are returned by URL views and containers to indicate the type of host present in a URL. [#boost-urls-host_type-none] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-host_type[pass:[host_type]]::none No host is specified. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- none ---- [#boost-urls-host_type-name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-host_type[pass:[host_type]]::name A host is specified by reg-name. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- name ---- [#boost-urls-host_type-ipv4] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-host_type[pass:[host_type]]::ipv4 A host is specified by xref:boost-urls-ipv4_address[ipv4_address] . === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ipv4 ---- [#boost-urls-host_type-ipv6] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-host_type[pass:[host_type]]::ipv6 A host is specified by xref:boost-urls-ipv6_address[ipv6_address] . === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ipv6 ---- [#boost-urls-host_type-ipvfuture] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-host_type[pass:[host_type]]::ipvfuture A host is specified by IPvFuture. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ipvfuture ---- [#boost-urls-ipv4_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::ipv4_address An IP version 4 style address. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class ipv4_address; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv4_address-bytes_type[`bytes_type`] ¦ The type used to represent an address as an array of bytes ¦xref:boost-urls-ipv4_address-uint_type[`uint_type`] ¦ The type used to represent an address as an unsigned integer |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv4_address-2constructor[`ipv4_address`] [.small]#[constructor]# ¦ Construct from a string. Construct from an array of bytes. Construct from an unsigned integer. Constructor. ¦xref:boost-urls-ipv4_address-is_loopback[`is_loopback`] ¦ Return true if the address is a loopback address ¦xref:boost-urls-ipv4_address-is_multicast[`is_multicast`] ¦ Return true if the address is a multicast address ¦xref:boost-urls-ipv4_address-is_unspecified[`is_unspecified`] ¦ Return true if the address is unspecified ¦xref:boost-urls-ipv4_address-operator_assign[`operator=`] ¦ Copy Assignment. ¦xref:boost-urls-ipv4_address-to_buffer[`to_buffer`] ¦ Write a dotted decimal string representing the address to a buffer ¦xref:boost-urls-ipv4_address-to_bytes[`to_bytes`] ¦ Return the address as bytes, in network byte order. ¦xref:boost-urls-ipv4_address-to_string[`to_string`] ¦ Return the address as a string in dotted decimal format ¦xref:boost-urls-ipv4_address-to_uint[`to_uint`] ¦ Return the address as an unsigned integer. |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv4_address-any[`any`] ¦ Return an address object that represents any address ¦xref:boost-urls-ipv4_address-broadcast[`broadcast`] ¦ Return an address object that represents the broadcast address ¦xref:boost-urls-ipv4_address-loopback[`loopback`] ¦ Return an address object that represents the loopback address |=== === Static Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv4_address-max_str_len[`max_str_len`] ¦ The number of characters in the longest possible IPv4 string. |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv4_address-08friend-08[`operator!=`] ¦ Return true if two addresses are not equal ¦xref:boost-urls-ipv4_address-08friend-07[`operator<<`] ¦ Format the address to an output stream. ¦xref:boost-urls-ipv4_address-08friend-01[`operator==`] ¦ Return true if two addresses are equal |=== === Description Objects of this type are used to construct, parse, and manipulate IP version 6 addresses. [,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 ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] === See Also xref:boost-urls-parse_ipv4_address[parse_ipv4_address] , xref:boost-urls-ipv6_address[ipv6_address] . [#boost-urls-ipv4_address-max_str_len] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::max_str_len The number of characters in the longest possible IPv4 string. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t const max_str_len = 15; ---- === Description The longest ipv4 address string is "255.255.255.255". [#boost-urls-ipv4_address-uint_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::uint_type The type used to represent an address as an unsigned integer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using uint_type = std::uint_least32_t; ---- [#boost-urls-ipv4_address-bytes_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::bytes_type The type used to represent an address as an array of bytes === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using bytes_type = std::array; ---- [#boost-urls-ipv4_address-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::ipv4_address Constructor. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ipv4_address-2constructor-0c[pass:[ipv4_address]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ipv4_address-2constructor-0d[pass:[ipv4_address]](xref:boost-urls-ipv4_address[ipv4_address] const&) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-ipv4_address-2constructor-06[pass:[ipv4_address]](xref:boost-urls-ipv4_address-uint_type[uint_type] u) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-ipv4_address-2constructor-0b[pass:[ipv4_address]](xref:boost-urls-ipv4_address-bytes_type[bytes_type] const& bytes) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-ipv4_address-2constructor-08[pass:[ipv4_address]](core::string_view s); ---- === Exceptions |=== | Name | Thrown on | `The` | input failed to parse correctly. |=== === Parameters |=== | Name | Description | *u* | The integer to construct from. | *bytes* | The value to construct from. | *s* | The string to parse. |=== [#boost-urls-ipv4_address-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::operator= Copy Assignment. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ipv4_address[ipv4_address]& operator=(xref:boost-urls-ipv4_address[ipv4_address] const&) = default; ---- [#boost-urls-ipv4_address-to_bytes] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::to_bytes Return the address as bytes, in network byte order. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv4_address-bytes_type[bytes_type] to_bytes() const noexcept; ---- [#boost-urls-ipv4_address-to_uint] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::to_uint Return the address as an unsigned integer. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv4_address-uint_type[uint_type] to_uint() const noexcept; ---- [#boost-urls-ipv4_address-to_string] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::to_string Return the address as a string in dotted decimal format === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type to_string(StringToken&& token) const; ---- === Description When called with no arguments, the return type is `std::string`. Otherwise, the return type and style of output is determined by which string token is passed. [,cpp] ---- assert( ipv4_address(0x01020304).to_string() == "1.2.3.4" ); ---- === Constant. === Strong guarantee. Calls to allocate may throw. String tokens may throw exceptions. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.2[ 2.2. Text Representation of Addresses (rfc4291)] === Return Value The return type of the string token. If the token parameter is omitted, then a new `std::string` is returned. Otherwise, the function return type is the result type of the token. === Parameters |=== | Name | Description | *token* | An optional string token. |=== [#boost-urls-ipv4_address-to_buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::to_buffer Write a dotted decimal string representing the address to a buffer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view to_buffer( char* dest, std::size_t dest_size) const; ---- === Description The resulting buffer is not null-terminated. === Exceptions |=== | Name | Thrown on | ``dest_size` | < ipv4_address::max_str_len` |=== === Return Value The formatted string === Parameters |=== | Name | Description | *dest* | The buffer in which to write, which must have at least `dest_size` space. | *dest_size* | The size of the output buffer. |=== [#boost-urls-ipv4_address-is_loopback] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::is_loopback Return true if the address is a loopback address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_loopback() const noexcept; ---- [#boost-urls-ipv4_address-is_unspecified] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::is_unspecified Return true if the address is unspecified === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_unspecified() const noexcept; ---- [#boost-urls-ipv4_address-is_multicast] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::is_multicast Return true if the address is a multicast address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_multicast() const noexcept; ---- [#boost-urls-ipv4_address-08friend-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return true if two addresses are equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator==( xref:boost-urls-ipv4_address[ipv4_address] const& a1, xref:boost-urls-ipv4_address[ipv4_address] const& a2) noexcept; ---- [#boost-urls-ipv4_address-08friend-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return true if two addresses are not equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator!=( xref:boost-urls-ipv4_address[ipv4_address] const& a1, xref:boost-urls-ipv4_address[ipv4_address] const& a2) noexcept; ---- [#boost-urls-ipv4_address-any] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::any Return an address object that represents any address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- static xref:boost-urls-ipv4_address[ipv4_address] any() noexcept; ---- [#boost-urls-ipv4_address-loopback] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::loopback Return an address object that represents the loopback address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- static xref:boost-urls-ipv4_address[ipv4_address] loopback() noexcept; ---- [#boost-urls-ipv4_address-broadcast] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::broadcast Return an address object that represents the broadcast address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- static xref:boost-urls-ipv4_address[ipv4_address] broadcast() noexcept; ---- [#boost-urls-ipv4_address-08friend-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the address to an output stream. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend std::ostream& operator<<( std::ostream& os, xref:boost-urls-ipv4_address[ipv4_address] const& addr); ---- === Description IPv4 addresses written to output streams are written in their dotted decimal format. [#boost-urls-operator_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return true if two addresses are equal === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_eq-0f2[pass:[operator==]]( xref:boost-urls-ipv4_address[ipv4_address] const& a1, xref:boost-urls-ipv4_address[ipv4_address] const& a2) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_eq-0fd[pass:[operator==]]( xref:boost-urls-ipv6_address[ipv6_address] const& a1, xref:boost-urls-ipv6_address[ipv6_address] const& a2) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_eq-09[pass:[operator==]]( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool xref:boost-urls-operator_eq-0e[pass:[operator==]]( S0 const& s0, S1 const& s1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_eq-0d[pass:[operator==]]( xref:boost-urls-params_encoded_base-iterator[iterator] const& it0, xref:boost-urls-params_encoded_base-iterator[iterator] const& it1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_eq-01[pass:[operator==]]( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- [#boost-urls-operator_not_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return true if two addresses are not equal === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_not_eq-02[pass:[operator!=]]( xref:boost-urls-ipv4_address[ipv4_address] const& a1, xref:boost-urls-ipv4_address[ipv4_address] const& a2) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_not_eq-07[pass:[operator!=]]( xref:boost-urls-ipv6_address[ipv6_address] const& a1, xref:boost-urls-ipv6_address[ipv6_address] const& a2) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_not_eq-037[pass:[operator!=]]( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool xref:boost-urls-operator_not_eq-03b[pass:[operator!=]]( S0 const& s0, S1 const& s1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_not_eq-0f[pass:[operator!=]]( xref:boost-urls-params_encoded_base-iterator[iterator] const& it0, xref:boost-urls-params_encoded_base-iterator[iterator] const& it1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_not_eq-04[pass:[operator!=]]( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- [#boost-urls-operator_lshift] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the address to an output stream. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-0a[pass:[operator<<]]( std::ostream& os, xref:boost-urls-ipv4_address[ipv4_address] const& addr); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-0f6[pass:[operator<<]]( std::ostream& os, xref:boost-urls-ipv6_address[ipv6_address] const& addr); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-0d[pass:[operator<<]]( std::ostream& os, xref:boost-urls-authority_view[authority_view] const& a); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-034[pass:[operator<<]]( std::ostream& os, xref:boost-urls-decode_view[decode_view] const& s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-09[pass:[operator<<]]( std::ostream& os, xref:boost-urls-params_encoded_base[params_encoded_base] const& qp); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-0b[pass:[operator<<]]( std::ostream& os, xref:boost-urls-params_base[params_base] const& qp); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-038[pass:[operator<<]]( std::ostream& os, xref:boost-urls-segments_encoded_base[segments_encoded_base] const& ps); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-0f4[pass:[operator<<]]( std::ostream& os, xref:boost-urls-segments_base[segments_base] const& ps); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& xref:boost-urls-operator_lshift-0c[pass:[operator<<]]( std::ostream& os, xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description IPv4 addresses written to output streams are written in their dotted decimal format. Format the address to an output stream. IPv4 addresses written to output streams are written in their dotted decimal format. === Parameters |=== | Name | Description | *os* | The output stream. | *addr* | The address to format. | *a* | The URL to write | *s* | The decoded view to write | *u* | The url to write. |=== [#boost-urls-parse_ipv4_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_ipv4_address Return an IPv4 address from an IP address string in dotted decimal form === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_ipv4_address(core::string_view s) noexcept; ---- [#boost-urls-ipv6_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::ipv6_address An IP version 6 style address. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class ipv6_address; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv6_address-bytes_type[`bytes_type`] ¦ The type used to represent an address as an array of bytes. |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv6_address-2constructor[`ipv6_address`] [.small]#[constructor]# ¦ Construct from a string. Construct from an IPv4 address. Construct from an array of bytes. Constructor. ¦xref:boost-urls-ipv6_address-is_loopback[`is_loopback`] ¦ Return true if the address is a loopback address ¦xref:boost-urls-ipv6_address-is_unspecified[`is_unspecified`] ¦ Return true if the address is unspecified ¦xref:boost-urls-ipv6_address-is_v4_mapped[`is_v4_mapped`] ¦ Return true if the address is a mapped IPv4 address ¦xref:boost-urls-ipv6_address-operator_assign[`operator=`] ¦ Copy Assignment ¦xref:boost-urls-ipv6_address-to_buffer[`to_buffer`] ¦ Write a dotted decimal string representing the address to a buffer ¦xref:boost-urls-ipv6_address-to_bytes[`to_bytes`] ¦ Return the address as bytes, in network byte order ¦xref:boost-urls-ipv6_address-to_string[`to_string`] ¦ Return the address as a string. |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv6_address-loopback[`loopback`] ¦ Return an address object that represents the loopback address |=== === Static Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv6_address-max_str_len[`max_str_len`] ¦ The number of characters in the longest possible IPv6 string. |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ipv6_address-08friend-01[`operator!=`] ¦ Return true if two addresses are not equal ¦xref:boost-urls-ipv6_address-08friend-09[`operator<<`] ¦ Format the address to an output stream ¦xref:boost-urls-ipv6_address-08friend-0d[`operator==`] ¦ Return true if two addresses are equal |=== === Description Objects of this type are used to construct, parse, and manipulate IP version 6 addresses. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] === See Also xref:boost-urls-ipv4_address[ipv4_address] , xref:boost-urls-parse_ipv6_address[parse_ipv6_address] . [#boost-urls-ipv6_address-max_str_len] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::max_str_len The number of characters in the longest possible IPv6 string. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t const max_str_len = 49; ---- === Description The longest IPv6 address is: [,cpp] ---- ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ---- === See Also xref:boost-urls-ipv6_address-to_buffer[to_buffer] . [#boost-urls-ipv6_address-bytes_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::bytes_type The type used to represent an address as an array of bytes. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using bytes_type = std::array; ---- === Description Octets are stored in network byte order. [#boost-urls-ipv6_address-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::ipv6_address Constructor. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ipv6_address-2constructor-04[pass:[ipv6_address]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ipv6_address-2constructor-06[pass:[ipv6_address]](xref:boost-urls-ipv6_address[ipv6_address] const&) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv6_address-2constructor-0f[pass:[ipv6_address]](xref:boost-urls-ipv6_address-bytes_type[bytes_type] const& bytes) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv6_address-2constructor-08[pass:[ipv6_address]](xref:boost-urls-ipv4_address[ipv4_address] const& addr) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv6_address-2constructor-00[pass:[ipv6_address]](core::string_view s); ---- === Description Default constructed objects represent the unspecified address. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[2.5.2. The Unspecified Address] === Exceptions |=== | Name | Thrown on | `The` | input failed to parse correctly. |=== === Parameters |=== | Name | Description | *bytes* | The value to construct from. | *addr* | The address to construct from. | *s* | The string to parse. |=== === See Also xref:boost-urls-ipv6_address-is_unspecified[is_unspecified] [#boost-urls-ipv6_address-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::operator= Copy Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ipv6_address[ipv6_address]& operator=(xref:boost-urls-ipv6_address[ipv6_address] const&) = default; ---- [#boost-urls-ipv6_address-to_bytes] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::to_bytes Return the address as bytes, in network byte order === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv6_address-bytes_type[bytes_type] to_bytes() const noexcept; ---- [#boost-urls-ipv6_address-to_string] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::to_string Return the address as a string. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type to_string(StringToken&& token) const; ---- === Description The returned string does not contain surrounding square brackets. When called with no arguments, the return type is `std::string`. Otherwise, the return type and style of output is determined by which string token is passed. [,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" ); ---- === Constant. === Strong guarantee. Calls to allocate may throw. String tokens may throw exceptions. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.2[ 2.2. Text Representation of Addresses (rfc4291)] === Return Value The return type of the string token. If the token parameter is omitted, then a new `std::string` is returned. Otherwise, the function return type is the result type of the token. === Parameters |=== | Name | Description | *token* | An optional string token. |=== [#boost-urls-ipv6_address-to_buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::to_buffer Write a dotted decimal string representing the address to a buffer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view to_buffer( char* dest, std::size_t dest_size) const; ---- === Description The resulting buffer is not null-terminated. === Exceptions |=== | Name | Thrown on | ``dest_size` | < ipv6_address::max_str_len` |=== === Return Value The formatted string === Parameters |=== | Name | Description | *dest* | The buffer in which to write, which must have at least `dest_size` space. | *dest_size* | The size of the output buffer. |=== [#boost-urls-ipv6_address-is_unspecified] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::is_unspecified Return true if the address is unspecified === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_unspecified() const noexcept; ---- === Description The address 0:0:0:0:0:0:0:0 is called the unspecified address. It indicates the absence of an address. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[ 2.5.2. The Unspecified Address (rfc4291)] [#boost-urls-ipv6_address-is_loopback] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::is_loopback Return true if the address is a loopback address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_loopback() const noexcept; ---- === Description The unicast address 0:0:0:0:0:0:0:1 is called the loopback address. It may be used by a node to send an IPv6 packet to itself. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3[ 2.5.3. The Loopback Address (rfc4291)] [#boost-urls-ipv6_address-is_v4_mapped] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::is_v4_mapped Return true if the address is a mapped IPv4 address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_v4_mapped() const noexcept; ---- === Description This address type is used to represent the addresses of IPv4 nodes as IPv6 addresses. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2[ 2.5.5.2. IPv4-Mapped IPv6 Address (rfc4291)] [#boost-urls-ipv6_address-08friend-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return true if two addresses are equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator==( xref:boost-urls-ipv6_address[ipv6_address] const& a1, xref:boost-urls-ipv6_address[ipv6_address] const& a2) noexcept; ---- [#boost-urls-ipv6_address-08friend-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return true if two addresses are not equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator!=( xref:boost-urls-ipv6_address[ipv6_address] const& a1, xref:boost-urls-ipv6_address[ipv6_address] const& a2) noexcept; ---- [#boost-urls-ipv6_address-loopback] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::loopback Return an address object that represents the loopback address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- static xref:boost-urls-ipv6_address[ipv6_address] loopback() noexcept; ---- === Description The unicast address 0:0:0:0:0:0:0:1 is called the loopback address. It may be used by a node to send an IPv6 packet to itself. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3[ 2.5.3. The Loopback Address (rfc4291)] [#boost-urls-ipv6_address-08friend-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the address to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend std::ostream& operator<<( std::ostream& os, xref:boost-urls-ipv6_address[ipv6_address] const& addr); ---- === Description This hidden friend function writes the address to an output stream using standard notation. [#boost-urls-parse_ipv6_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_ipv6_address Parse a string containing an IPv6 address. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_ipv6_address(core::string_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. === Throws nothing. === Return Value A result containing the address. === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-encoding_opts] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::encoding_opts Percent-encoding options === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct encoding_opts; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-encoding_opts-2constructor[`encoding_opts`] [.small]#[constructor]# ¦ |=== === Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-encoding_opts-disallow_null[`disallow_null`] ¦ True if nulls are not allowed ¦xref:boost-urls-encoding_opts-lower_case[`lower_case`] ¦ True if hexadecimal digits are emitted as lower case ¦xref:boost-urls-encoding_opts-space_as_plus[`space_as_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. === See Also xref:boost-urls-encode-04[encode] , xref:boost-urls-encoded_size[encoded_size] , xref:boost-urls-pct_string_view[pct_string_view] . [#boost-urls-encoding_opts-space_as_plus] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-encoding_opts[pass:[encoding_opts]]::space_as_plus True if spaces encode to and from plus signs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool space_as_plus = false; ---- === Description This option controls whether or not the PLUS character ("+") is used to represent the SP character (" ") when encoding or decoding. Although not prescribed by the RFC, plus signs are commonly treated as spaces upon decoding when used in the query of URLs using well known schemes such as HTTP. * link:https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1[ application/x-www-form-urlencoded (w3.org)] [#boost-urls-encoding_opts-lower_case] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-encoding_opts[pass:[encoding_opts]]::lower_case True if hexadecimal digits are emitted as lower case === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool lower_case = false; ---- === Description By default, percent-encoding algorithms emit hexadecimal digits A through F as uppercase letters. When this option is `true`, lowercase letters are used. [#boost-urls-encoding_opts-disallow_null] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-encoding_opts[pass:[encoding_opts]]::disallow_null True if nulls are not allowed === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool disallow_null = false; ---- === Description Normally all possible character values (from 0 to 255) are allowed, with reserved characters being replaced with escapes upon encoding. When this option is true, attempting to decode a null will result in an error. [#boost-urls-encoding_opts-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-encoding_opts[pass:[encoding_opts]]::encoding_opts === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- encoding_opts( bool space_as_plus_ = false, bool lower_case_ = false, bool disallow_null_ = false) noexcept; ---- [#boost-urls-decode_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::decode_view A reference to a valid, percent-encoded string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class decode_view; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-decode_view-const_iterator[`const_iterator`] ¦ An iterator of constant, decoded characters. ¦xref:boost-urls-decode_view-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-decode_view-difference_type[`difference_type`] ¦ The signed integer type ¦xref:boost-urls-decode_view-iterator[`iterator`] ¦ An iterator of constant, decoded characters. ¦xref:boost-urls-decode_view-reference[`reference`] ¦ The reference type ¦xref:boost-urls-decode_view-size_type[`size_type`] ¦ The unsigned integer type ¦xref:boost-urls-decode_view-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-decode_view-back[`back`] ¦ Return the last character ¦xref:boost-urls-decode_view-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-decode_view-compare[`compare`] ¦ Return the result of comparing to another string ¦xref:boost-urls-decode_view-2constructor[`decode_view`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-decode_view-empty[`empty`] ¦ Return true if the string is empty ¦xref:boost-urls-decode_view-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-decode_view-ends_with[`ends_with`] ¦ Checks if the string ends with the given prefix ¦xref:boost-urls-decode_view-find[`find`] ¦ Finds the first occurrence of character in this view ¦xref:boost-urls-decode_view-front[`front`] ¦ Return the first character ¦xref:boost-urls-decode_view-options[`options`] ¦ Return the decoding options ¦xref:boost-urls-decode_view-remove_prefix[`remove_prefix`] ¦ Remove the first characters ¦xref:boost-urls-decode_view-remove_suffix[`remove_suffix`] ¦ Remove the last characters ¦xref:boost-urls-decode_view-rfind[`rfind`] ¦ Finds the first occurrence of character in this view ¦xref:boost-urls-decode_view-size[`size`] ¦ Return the number of decoded characters ¦xref:boost-urls-decode_view-starts_with[`starts_with`] ¦ Checks if the string begins with the given prefix |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-decode_view-08friend-04[`operator!=`] ¦ Compare two decode views for inequality ¦xref:boost-urls-decode_view-08friend-0e[`operator<`] ¦ Compare two decode views for less than ¦xref:boost-urls-decode_view-08friend-08[`operator<<`] ¦ Format the string with percent-decoding applied to the output stream ¦xref:boost-urls-decode_view-08friend-0c[`operator<=`] ¦ Compare two decode views for less than or equal ¦xref:boost-urls-decode_view-08friend-0a[`operator==`] ¦ Compare two decode views for equality ¦xref:boost-urls-decode_view-08friend-07[`operator>`] ¦ Compare two decode views for greater than ¦xref:boost-urls-decode_view-08friend-01[`operator>=`] ¦ Compare two decode views for greater than or equal |=== === Description These views reference strings in parts of URLs or other components that are percent-encoded. The special characters (those not in the allowed character set) are stored as three character escapes that consist of a percent sign ('%%') followed by a two-digit hexadecimal number of the corresponding unescaped character code, which may be part of a UTF-8 code point depending on the context. The view refers to the original character buffer and only decodes escaped sequences when needed. In particular these operations perform percent-decoding automatically without the need to allocate memory: * 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-encoding, otherwise construction fails. 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. === The following operators are supported between xref:boost-urls-decode_view-2constructor-07[decode_view] and any object that is convertible to `core::string_view` [,cpp] ---- bool operator==( decode_view, decode_view ) noexcept; bool operator!=( decode_view, decode_view ) noexcept; bool operator<=( decode_view, decode_view ) noexcept; bool operator< ( decode_view, decode_view ) noexcept; bool operator> ( decode_view, decode_view ) noexcept; bool operator>=( decode_view, decode_view ) noexcept; ---- [#boost-urls-decode_view-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::value_type The value type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = char; ---- [#boost-urls-decode_view-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = char; ---- [#boost-urls-decode_view-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::const_reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_reference = char; ---- [#boost-urls-decode_view-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::size_type The unsigned integer type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using size_type = std::size_t; ---- [#boost-urls-decode_view-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::difference_type The signed integer type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-decode_view-iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::iterator An iterator of constant, decoded characters. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class iterator; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-decode_view-iterator-const_reference[`const_reference`] ¦ ¦xref:boost-urls-decode_view-iterator-difference_type[`difference_type`] ¦ ¦xref:boost-urls-decode_view-iterator-iterator_category[`iterator_category`] ¦ ¦xref:boost-urls-decode_view-iterator-pointer[`pointer`] ¦ ¦xref:boost-urls-decode_view-iterator-reference[`reference`] ¦ ¦xref:boost-urls-decode_view-iterator-size_type[`size_type`] ¦ ¦xref:boost-urls-decode_view-iterator-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-decode_view-iterator-base[`base`] ¦ ¦xref:boost-urls-decode_view-iterator-2constructor[`iterator`] [.small]#[constructor]# ¦ ¦xref:boost-urls-decode_view-iterator-operator_not_eq[`operator!=`] ¦ ¦xref:boost-urls-decode_view-iterator-operator_star[`operator*`] ¦ ¦xref:boost-urls-decode_view-iterator-operator_inc[`operator++`] ¦ ¦xref:boost-urls-decode_view-iterator-operator_dec[`operator--`] ¦ ¦xref:boost-urls-decode_view-iterator-operator_assign[`operator=`] ¦ ¦xref:boost-urls-decode_view-iterator-operator_eq[`operator==`] ¦ |=== === Description This iterator is used to access the encoded string as a bidirectional range of characters with percent-decoding applied. Escape sequences are not decoded until the iterator is dereferenced. [#boost-urls-decode_view-iterator-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = char; ---- [#boost-urls-decode_view-iterator-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = char; ---- [#boost-urls-decode_view-iterator-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::pointer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using pointer = void const*; ---- [#boost-urls-decode_view-iterator-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::const_reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_reference = char; ---- [#boost-urls-decode_view-iterator-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::size_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using size_type = std::size_t; ---- [#boost-urls-decode_view-iterator-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::difference_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-decode_view-iterator-iterator_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::iterator_category === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using iterator_category = std::bidirectional_iterator_tag; ---- [#boost-urls-decode_view-iterator-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::iterator === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-decode_view-iterator-2constructor-05[pass:[iterator]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-decode_view-iterator-2constructor-07[pass:[iterator]](xref:boost-urls-decode_view-iterator[iterator] const&) = default; ---- [#boost-urls-decode_view-iterator-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-decode_view-iterator[iterator]& operator=(xref:boost-urls-decode_view-iterator[iterator] const&) = default; ---- [#boost-urls-decode_view-iterator-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator* === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator-reference[reference] operator*() const noexcept; ---- [#boost-urls-decode_view-iterator-operator_inc] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator++ === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator]& xref:boost-urls-decode_view-iterator-operator_inc-0a[pass:[operator++]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator] xref:boost-urls-decode_view-iterator-operator_inc-07[pass:[operator++]](int) noexcept; ---- [#boost-urls-decode_view-iterator-operator_dec] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator-- === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator]& xref:boost-urls-decode_view-iterator-operator_dec-04[pass:[operator--]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator] xref:boost-urls-decode_view-iterator-operator_dec-0a[pass:[operator--]](int) noexcept; ---- [#boost-urls-decode_view-iterator-base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::base === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- char const* base(); ---- [#boost-urls-decode_view-iterator-operator_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator== === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==(xref:boost-urls-decode_view-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-decode_view-iterator-operator_not_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator!= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=(xref:boost-urls-decode_view-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-decode_view-const_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::const_iterator An iterator of constant, decoded characters. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_iterator = xref:boost-urls-decode_view-iterator[iterator]; ---- === Description This iterator is used to access the encoded string as a bidirectional range of characters with percent-decoding applied. Escape sequences are not decoded until the iterator is dereferenced. [#boost-urls-decode_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::decode_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-decode_view-2constructor-07[pass:[decode_view]]() noexcept = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-decode_view-2constructor-03[pass:[decode_view]]( xref:boost-urls-pct_string_view[pct_string_view] s, xref:boost-urls-encoding_opts[encoding_opts] opt = = {}) noexcept; ---- === Description Default-constructed views represent empty strings. [,cpp] ---- decode_view ds; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent encoding. |=== === Parameters |=== | Name | Description | *s* | A percent-encoded string that has already been validated. | *opt* | The options for decoding. If this parameter is omitted, the default options are used. |=== [#boost-urls-decode_view-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::empty Return true if the string is empty === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "" ).empty() ); ---- === Constant. === Throws nothing. [#boost-urls-decode_view-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::size Return the number of decoded characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-size_type[size_type] size() const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).size() == 13 ); ---- [,cpp] ---- return std::distance( this->begin(), this->end() ); ---- === Constant. === Throws nothing. [#boost-urls-decode_view-begin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::begin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator] begin() const noexcept; ---- === Description [,cpp] ---- auto it = this->begin(); ---- === Constant. === Throws nothing. [#boost-urls-decode_view-end] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::end Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator] end() const noexcept; ---- === Description [,cpp] ---- auto it = this->end(); ---- === Constant. === Throws nothing. [#boost-urls-decode_view-front] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::front Return the first character === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-reference[reference] front() const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).front() == 'P' ); ---- [,cpp] ---- not this->empty() ---- === Constant. === Throws nothing. [#boost-urls-decode_view-back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::back Return the last character === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-reference[reference] back() const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).back() == 's' ); ---- [,cpp] ---- not this->empty() ---- === Constant. === Throws nothing. [#boost-urls-decode_view-starts_with] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::starts_with Checks if the string begins with the given prefix === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-decode_view-starts_with-01[pass:[starts_with]](core::string_view s) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-decode_view-starts_with-0b[pass:[starts_with]](char ch) const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).starts_with("Program") ); ---- === Linear. === Throws nothing. [#boost-urls-decode_view-ends_with] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::ends_with Checks if the string ends with the given prefix === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-decode_view-ends_with-04[pass:[ends_with]](core::string_view s) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-decode_view-ends_with-0d[pass:[ends_with]](char ch) const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).ends_with("Files") ); ---- === Linear. === Throws nothing. [#boost-urls-decode_view-find] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::find Finds the first occurrence of character in this view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-const_iterator[const_iterator] find(char ch) const noexcept; ---- === Description === Linear. === Throws nothing. [#boost-urls-decode_view-rfind] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::rfind Finds the first occurrence of character in this view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-const_iterator[const_iterator] rfind(char ch) const noexcept; ---- === Description === Linear. === Throws nothing. [#boost-urls-decode_view-remove_prefix] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::remove_prefix Remove the first characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void remove_prefix(xref:boost-urls-decode_view-size_type[size_type] n); ---- === Description [,cpp] ---- decode_view d( "Program%20Files" ); d.remove_prefix( 8 ); assert( d == "Files" ); ---- [,cpp] ---- not this->empty() ---- === Linear. [#boost-urls-decode_view-remove_suffix] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::remove_suffix Remove the last characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void remove_suffix(xref:boost-urls-decode_view-size_type[size_type] n); ---- === Description [,cpp] ---- decode_view d( "Program%20Files" ); d.remove_prefix( 6 ); assert( d == "Program" ); ---- [,cpp] ---- not this->empty() ---- === Linear. [#boost-urls-decode_view-options] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::options Return the decoding options === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-encoding_opts[encoding_opts] options() const noexcept; ---- [#boost-urls-decode_view-compare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::compare Return the result of comparing to another string === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- int xref:boost-urls-decode_view-compare-02[pass:[compare]](core::string_view other) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- int xref:boost-urls-decode_view-compare-01[pass:[compare]](xref:boost-urls-decode_view[decode_view] other) const noexcept; ---- === Description The length of the sequences to compare is the smaller of `size()` and `other.size()`. The function compares the two strings as if by calling `char_traits<char>::compare(to_string().data(), v.data(), rlen)`. This means the comparison is performed with percent-decoding applied to the current string. === Return Value Negative value if this string is less than the other character sequence, zero if the both character sequences are equal, positive value if this string is greater than the other character sequence === Parameters |=== | Name | Description | *other* | string to compare |=== [#boost-urls-decode_view-08friend-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Compare two decode views for equality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator==( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-decode_view-08friend-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Compare two decode views for inequality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator!=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-decode_view-08friend-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator< Compare two decode views for less than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator<( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-decode_view-08friend-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<= Compare two decode views for less than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator<=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-decode_view-08friend-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator> Compare two decode views for greater than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator>( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-decode_view-08friend-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator>= Compare two decode views for greater than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> friend constexpr bool operator>=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-decode_view-08friend-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the string with percent-decoding applied to the output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend std::ostream& operator<<( std::ostream& os, xref:boost-urls-decode_view[decode_view] const& s); ---- === Description This hidden friend function serializes the decoded view to the output stream. [#boost-urls-pct_string_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::pct_string_view A reference to a valid percent-encoded string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class pct_string_view : public xref:boost-urls-grammar[grammar]::xref:boost-urls-grammar-string_view_base[string_view_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-const_iterator[`const_iterator`] ¦ The const iterator type ¦xref:boost-urls-grammar-string_view_base-const_pointer[`const_pointer`] ¦ The const pointer type ¦xref:boost-urls-grammar-string_view_base-const_reference[`const_reference`] ¦ The const reference type ¦xref:boost-urls-grammar-string_view_base-const_reverse_iterator[`const_reverse_iterator`] ¦ The const reverse iterator type ¦xref:boost-urls-grammar-string_view_base-difference_type[`difference_type`] ¦ The difference type ¦xref:boost-urls-grammar-string_view_base-iterator[`iterator`] ¦ The iterator type ¦xref:boost-urls-grammar-string_view_base-pointer[`pointer`] ¦ The pointer type ¦xref:boost-urls-grammar-string_view_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-grammar-string_view_base-reverse_iterator[`reverse_iterator`] ¦ The reverse iterator type ¦xref:boost-urls-grammar-string_view_base-size_type[`size_type`] ¦ The size type ¦xref:boost-urls-grammar-string_view_base-traits_type[`traits_type`] ¦ The character traits ¦xref:boost-urls-grammar-string_view_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-at[`at`] ¦ Access a character ¦xref:boost-urls-grammar-string_view_base-back[`back`] ¦ Return the last character ¦xref:boost-urls-grammar-string_view_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-cbegin[`cbegin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-cend[`cend`] ¦ Return an iterator to the end ¦xref:boost-urls-grammar-string_view_base-compare[`compare`] ¦ Return the result of comparing to another string ¦xref:boost-urls-grammar-string_view_base-contains[`contains`] ¦ Return true if matching characters are found ¦xref:boost-urls-grammar-string_view_base-copy[`copy`] ¦ Copy the characters to another buffer ¦xref:boost-urls-grammar-string_view_base-crbegin[`crbegin`] ¦ Return a reverse iterator to the end ¦xref:boost-urls-grammar-string_view_base-crend[`crend`] ¦ Return a reverse iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-data[`data`] ¦ Return a pointer to the character buffer ¦xref:boost-urls-pct_string_view-decode[`decode`] ¦ Return the string with percent-decoding ¦xref:boost-urls-pct_string_view-decoded_size[`decoded_size`] ¦ Return the decoded size ¦xref:boost-urls-grammar-string_view_base-empty[`empty`] ¦ Return true if the string is empty ¦xref:boost-urls-grammar-string_view_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-grammar-string_view_base-ends_with[`ends_with`] ¦ Return true if a matching suffix exists ¦xref:boost-urls-grammar-string_view_base-find[`find`] ¦ Return the position of matching characters ¦xref:boost-urls-grammar-string_view_base-find_first_not_of[`find_first_not_of`] ¦ Return the position of the first non-match ¦xref:boost-urls-grammar-string_view_base-find_first_of[`find_first_of`] ¦ Return the position of the first match ¦xref:boost-urls-grammar-string_view_base-find_last_not_of[`find_last_not_of`] ¦ Return the position of the last non-match ¦xref:boost-urls-grammar-string_view_base-find_last_of[`find_last_of`] ¦ Return the position of the last match ¦xref:boost-urls-grammar-string_view_base-front[`front`] ¦ Return the first character ¦xref:boost-urls-grammar-string_view_base-length[`length`] ¦ Return the size ¦xref:boost-urls-grammar-string_view_base-max_size[`max_size`] ¦ Return the maximum allowed size ¦xref:boost-urls-grammar-string_view_base-2conversion-06[`operator std::string`] ¦ Conversion ¦xref:boost-urls-grammar-string_view_base-2conversion-0e[`operator core::string_view`] ¦ Conversion ¦xref:boost-urls-pct_string_view-operator_star[`operator*`] ¦ Return the string as a range of decoded characters ¦xref:boost-urls-pct_string_view-operator_ptr[`operator->`] ¦ Arrow support ¦xref:boost-urls-pct_string_view-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-grammar-string_view_base-operator_subs[`operator[]`] ¦ Access a character ¦xref:boost-urls-pct_string_view-2constructor[`pct_string_view`] [.small]#[constructor]# ¦ Constructor Constructor (deleted) ¦xref:boost-urls-grammar-string_view_base-rbegin[`rbegin`] ¦ Return a reverse iterator to the end ¦xref:boost-urls-grammar-string_view_base-rend[`rend`] ¦ Return a reverse iterator to the beginning ¦xref:boost-urls-grammar-string_view_base-rfind[`rfind`] ¦ Return the position of matching characters ¦xref:boost-urls-grammar-string_view_base-size[`size`] ¦ Return the size ¦xref:boost-urls-grammar-string_view_base-starts_with[`starts_with`] ¦ Return true if a matching prefix exists ¦xref:boost-urls-grammar-string_view_base-substr[`substr`] ¦ Return a view to part of the string ¦xref:boost-urls-pct_string_view-swap[`swap`] ¦ Swap |=== === Static Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-npos[`npos`] ¦ A constant used to represent "no position" |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-grammar-string_view_base-08friend-09d[`hash_value`] ¦ Return the hash of this value ¦xref:boost-urls-pct_string_view-08friend[`make_pct_string_view`] ¦ Return a valid percent-encoded string ¦xref:boost-urls-grammar-string_view_base-08friend-017[`operator!=`] ¦ Compare two string views for inequality ¦xref:boost-urls-grammar-string_view_base-08friend-010[`operator<`] ¦ Compare two string views for less than ¦xref:boost-urls-grammar-string_view_base-08friend-0a[`operator<<`] ¦ Format a string to an output stream ¦xref:boost-urls-grammar-string_view_base-08friend-0c[`operator<=`] ¦ Compare two string views for less than or equal ¦xref:boost-urls-grammar-string_view_base-08friend-095[`operator==`] ¦ Compare two string views for equality ¦xref:boost-urls-grammar-string_view_base-08friend-0d[`operator>`] ¦ Compare two string views for greater than ¦xref:boost-urls-grammar-string_view_base-08friend-02[`operator>=`] ¦ Compare two string views for greater than or equal |=== === Description Objects of this type behave like a `core::string_view` and have the same interface, but offer an additional invariant: they can only be constructed from strings containing valid percent-escapes. Attempting construction from a string containing invalid or malformed percent escapes results in an exception. === The following operators are supported between xref:boost-urls-pct_string_view-2constructor-00[pct_string_view] and any object that is convertible to `core::string_view` [,cpp] ---- bool operator==( pct_string_view, pct_string_view ) noexcept; bool operator!=( pct_string_view, pct_string_view ) noexcept; bool operator<=( pct_string_view, pct_string_view ) noexcept; bool operator< ( pct_string_view, pct_string_view ) noexcept; bool operator> ( pct_string_view, pct_string_view ) noexcept; bool operator>=( pct_string_view, pct_string_view ) noexcept; ---- [#boost-urls-pct_string_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::pct_string_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-pct_string_view-2constructor-00[pass:[pct_string_view]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-pct_string_view-2constructor-07[pass:[pct_string_view]](xref:boost-urls-pct_string_view[pct_string_view] const& other) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class String, class = void> xref:boost-urls-pct_string_view-2constructor-0c[pass:[pct_string_view]](String const& s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view-2constructor-0f[pass:[pct_string_view]](std::nullptr_t) = delete; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view-2constructor-06[pass:[pct_string_view]]( char const* s, std::size_t len); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view-2constructor-0d[pass:[pct_string_view]](core::string_view s); ---- === Description Default constructed string are empty. === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent encoding. |=== === Parameters |=== | Name | Description | *s,* | len The string to construct from. | *s* | The string to construct from. |=== [#boost-urls-pct_string_view-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-pct_string_view[pct_string_view]& operator=(xref:boost-urls-pct_string_view[pct_string_view] const& other) = default; ---- === Description The copy references the same underlying character buffer. Ownership is not transferred. [,cpp] ---- this->data() == other.data() ---- === Constant. === Throws nothing. [#boost-urls-pct_string_view-08friend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::make_pct_string_view Return a valid percent-encoded string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend system::result make_pct_string_view(core::string_view s) noexcept; ---- === Description If `s` is a valid percent-encoded string, the function returns the buffer as a valid view which may be used to perform decoding or measurements. Otherwise the result contains an error code. Upon success, the returned view references the original character buffer; Ownership is not transferred. === Linear in `s.size()`. === Throws nothing. [#boost-urls-pct_string_view-decoded_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::decoded_size Return the decoded size === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t decoded_size() const noexcept; ---- === Description This function returns the number of characters in the resulting string if percent escapes were converted into ordinary characters. === Constant. === Throws nothing. [#boost-urls-pct_string_view-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::operator* Return the string as a range of decoded characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view[decode_view] operator*() const noexcept; ---- === Description === Constant. === Throws nothing. === See Also xref:boost-urls-decode_view[decode_view] . [#boost-urls-pct_string_view-decode] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::decode Return the string with percent-decoding === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type decode( xref:boost-urls-encoding_opts[encoding_opts] opt = = {}, StringToken&& token) const; ---- === Description This function converts percent escapes in the string into ordinary characters and returns the result. When called with no arguments, the return type is `std::string`. Otherwise, the return type and style of output is determined by which string token is passed. [,cpp] ---- assert( pct_string_view( "Program%20Files" ).decode() == "Program Files" ); ---- === Linear in `this->size()`. === Calls to allocate may throw. String tokens may throw exceptions. === Parameters |=== | Name | Description | *opt* | The options for encoding. If this parameter is omitted, the default options are used. | *token* | An optional string token. If this parameter is omitted, then a new `std::string` is returned. Otherwise, the function return type is the result type of the token. |=== === See Also xref:boost-urls-encoding_opts[encoding_opts] , xref:boost-urls-string_token-return_string[string_token::return_string] . [#boost-urls-pct_string_view-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::operator-> Arrow support === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] const* operator->() const noexcept; ---- [#boost-urls-pct_string_view-swap] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::swap Swap === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void swap(xref:boost-urls-pct_string_view[pct_string_view]& s) noexcept; ---- [#boost-urls-make_pct_string_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::make_pct_string_view Return a valid percent-encoded string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result make_pct_string_view(core::string_view s) noexcept; ---- === Description If `s` is a valid percent-encoded string, the function returns the buffer as a valid view which may be used to perform decoding or measurements. Otherwise the result contains an error code. Upon success, the returned view references the original character buffer; Ownership is not transferred. === Linear in `s.size()`. === Throws nothing. Return a valid percent-encoded string If `s` is a valid percent-encoded string, the function returns the buffer as a valid view which may be used to perform decoding or measurements. Otherwise the result contains an error code. Upon success, the returned view references the original character buffer; Ownership is not transferred. === Linear in `s.size()`. === Throws nothing. === Parameters |=== | Name | Description | *s* | The string to validate. | *s* | The string to validate. |=== [#boost-urls-scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::scheme Identifies a known URL scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- enum scheme : unsigned short; ---- === Members [,cols=2] |=== |Name |Description |xref:boost-urls-scheme-none[`pass:v[none]`] | Indicates that no scheme is present |xref:boost-urls-scheme-unknown[`pass:v[unknown]`] | Indicates the scheme is not a well-known scheme |xref:boost-urls-scheme-ftp[`pass:v[ftp]`] | File Transfer Protocol (FTP) |xref:boost-urls-scheme-file[`pass:v[file]`] | File URI Scheme |xref:boost-urls-scheme-http[`pass:v[http]`] | The Hypertext Transfer Protocol URI Scheme |xref:boost-urls-scheme-https[`pass:v[https]`] | The Secure Hypertext Transfer Protocol URI Scheme |xref:boost-urls-scheme-ws[`pass:v[ws]`] | The WebSocket URI Scheme |xref:boost-urls-scheme-wss[`pass:v[wss]`] | The Secure WebSocket URI Scheme |=== === Description * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3.1. Scheme (rfc3986)] [#boost-urls-scheme-none] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::none Indicates that no scheme is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- none = 0 ---- [#boost-urls-scheme-unknown] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::unknown Indicates the scheme is not a well-known scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- unknown ---- [#boost-urls-scheme-ftp] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::ftp File Transfer Protocol (FTP) === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ftp ---- === Description FTP is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. * link:https://datatracker.ietf.org/doc/html/draft-yevstifeyev-ftp-uri-scheme[ The 'ftp' URI Scheme] [#boost-urls-scheme-file] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::file File URI Scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- file ---- === Description The File URI Scheme is typically used to retrieve files from within one's own computer. * link:https://datatracker.ietf.org/doc/html/rfc8089[ The "file" URI Scheme (rfc8089)] [#boost-urls-scheme-http] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::http The Hypertext Transfer Protocol URI Scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- http ---- === Description URLs of this type indicate a resource which is interacted with using the HTTP protocol. * link:https://datatracker.ietf.org/doc/html/rfc7230[ Hypertext Transfer Protocol (HTTP/1.1) (rfc7230)] [#boost-urls-scheme-https] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::https The Secure Hypertext Transfer Protocol URI Scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- https ---- === Description URLs of this type indicate a resource which is interacted with using the Secure HTTP protocol. * link:https://datatracker.ietf.org/doc/html/rfc7230[ Hypertext Transfer Protocol (HTTP/1.1) (rfc7230)] [#boost-urls-scheme-ws] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::ws The WebSocket URI Scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ws ---- === Description URLs of this type indicate a resource which is interacted with using the WebSocket protocol. * link:https://datatracker.ietf.org/doc/html/rfc6455[ The WebSocket Protocol (rfc6455)] [#boost-urls-scheme-wss] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-scheme[pass:[scheme]]::wss The Secure WebSocket URI Scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- wss ---- === Description URLs of this type indicate a resource which is interacted with using the Secure WebSocket protocol. * link:https://datatracker.ietf.org/doc/html/rfc6455[ The WebSocket Protocol (rfc6455)] [#boost-urls-string_to_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::string_to_scheme Return the known scheme for a non-normalized string, if known === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-scheme[scheme] string_to_scheme(core::string_view s) noexcept; ---- === Description If the string does not identify a known scheme, the value xref:boost-urls-scheme-unknown[scheme::unknown] is returned. [,cpp] ---- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3.1. Scheme (rfc3986)] === Return Value The known scheme === Parameters |=== | Name | Description | *s* | The string holding the scheme |=== [#boost-urls-to_string] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::to_string Return the normalized string for a known scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view to_string(xref:boost-urls-scheme[scheme] s) noexcept; ---- === Return Value A string representing the known scheme === Parameters |=== | Name | Description | *s* | The known scheme constant |=== [#boost-urls-default_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::default_port Return the default port for a known scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::uint16_t default_port(xref:boost-urls-scheme[scheme] s) noexcept; ---- === Description This function returns the default port for the known schemes. If the value does not represent a known scheme or the scheme does not represent a protocol, the function returns zero. The following ports are returned by the function: * xref:boost-urls-scheme-ftp[scheme::ftp] = 21 * xref:boost-urls-scheme-http[scheme::http] , xref:boost-urls-scheme-ws[scheme::ws] = 80 * xref:boost-urls-scheme-https[scheme::https] , xref:boost-urls-scheme-wss[scheme::wss] = 443 === Return Value An integer with the default port number === Parameters |=== | Name | Description | *s* | The known scheme constant |=== [#boost-urls-url_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::url_view A non-owning reference to a valid URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class url_view : public xref:boost-urls-url_view_base[url_view_base]; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-authority[`authority`] ¦ Return the authority ¦xref:boost-urls-url_view_base-buffer[`buffer`] ¦ Return the url string ¦xref:boost-urls-url_view_base-compare[`compare`] ¦ Return the result of comparing this with another url ¦xref:boost-urls-url_view_base-data[`data`] ¦ Return a pointer to the url's character buffer ¦xref:boost-urls-url_view_base-empty[`empty`] ¦ Return true if the url is empty ¦xref:boost-urls-url_view_base-encoded_authority[`encoded_authority`] ¦ Return the authority. ¦xref:boost-urls-url_view_base-encoded_fragment[`encoded_fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-encoded_host[`encoded_host`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_address[`encoded_host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_and_port[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost-urls-url_view_base-encoded_host_name[`encoded_host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-encoded_origin[`encoded_origin`] ¦ Return the origin ¦xref:boost-urls-url_view_base-encoded_params[`encoded_params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-encoded_password[`encoded_password`] ¦ Return the password ¦xref:boost-urls-url_view_base-encoded_path[`encoded_path`] ¦ Return the path ¦xref:boost-urls-url_view_base-encoded_query[`encoded_query`] ¦ Return the query ¦xref:boost-urls-url_view_base-encoded_resource[`encoded_resource`] ¦ Return the resource ¦xref:boost-urls-url_view_base-encoded_segments[`encoded_segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-encoded_target[`encoded_target`] ¦ Return the target ¦xref:boost-urls-url_view_base-encoded_user[`encoded_user`] ¦ Return the user ¦xref:boost-urls-url_view_base-encoded_userinfo[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-encoded_zone_id[`encoded_zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url_view_base-fragment[`fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-has_authority[`has_authority`] ¦ Return true if an authority is present ¦xref:boost-urls-url_view_base-has_fragment[`has_fragment`] ¦ Return true if a fragment is present ¦xref:boost-urls-url_view_base-has_password[`has_password`] ¦ Return true if a password is present ¦xref:boost-urls-url_view_base-has_port[`has_port`] ¦ Return true if a port is present ¦xref:boost-urls-url_view_base-has_query[`has_query`] ¦ Return true if a query is present ¦xref:boost-urls-url_view_base-has_scheme[`has_scheme`] ¦ Return true a scheme is present ¦xref:boost-urls-url_view_base-has_userinfo[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost-urls-url_view_base-host[`host`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_address[`host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_ipv4_address[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost-urls-url_view_base-host_ipv6_address[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost-urls-url_view_base-host_ipvfuture[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost-urls-url_view_base-host_name[`host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-host_type[`host_type`] ¦ Return the host type ¦xref:boost-urls-url_view_base-is_path_absolute[`is_path_absolute`] ¦ Return true if the path is absolute ¦xref:boost-urls-url_view_base-2conversion[`operator core::string_view`] ¦ Return the URL as a core::string_view ¦xref:boost-urls-url_view-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-url_view_base-params[`params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-password[`password`] ¦ Return the password ¦xref:boost-urls-url_view_base-path[`path`] ¦ Return the path ¦xref:boost-urls-url_view_base-persist[`persist`] ¦ Return a shared, persistent copy of the url ¦xref:boost-urls-url_view_base-port[`port`] ¦ Return the port ¦xref:boost-urls-url_view_base-port_number[`port_number`] ¦ Return the port ¦xref:boost-urls-url_view_base-query[`query`] ¦ Return the query ¦xref:boost-urls-url_view_base-scheme[`scheme`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-scheme_id[`scheme_id`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-segments[`segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-size[`size`] ¦ Return the number of characters in the url ¦xref:boost-urls-url_view-2constructor[`url_view`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-url_view_base-user[`user`] ¦ Return the user ¦xref:boost-urls-url_view_base-userinfo[`userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-zone_id[`zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url_view-2destructor[`~url_view`] [.small]#[destructor]# ¦ Destructor |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-08friend-02[`operator!=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-05[`operator<`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-0f[`operator<<`] ¦ Format the url to the output stream ¦xref:boost-urls-url_view_base-08friend-04[`operator<=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-07c[`operator==`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-073[`operator>`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-06[`operator>=`] ¦ Return the result of comparing two URLs |=== === Description Objects of this type represent valid URL strings constructed from a parsed, external character buffer whose storage is managed by the caller. That is, it acts like a `core::string_view` in terms of ownership. The caller is responsible for ensuring that the lifetime of the underlying character buffer extends until it is no longer referenced. === Construction from a string parses the input as a _URI-reference_ and throws an exception on error. Upon success, the constructed object points to the passed character buffer; ownership is not transferred. [,cpp] ---- url_view u( "https://www.example.com/index.htm?text=none#a1" ); ---- === Parsing functions like xref:boost-urls-parse_uri_reference[parse_uri_reference] return a result containing either a valid xref:boost-urls-url_view-2constructor-0c[url_view] upon succcess, otherwise they contain an error. The error can be converted to an exception by the caller if desired: [,cpp] ---- system::result< url_view > rv = parse_uri_reference( "https://www.example.com/index.htm?text=none#a1" ); ---- [,cpp] ---- URI-reference = URI / relative-ref URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://tools.ietf.org/html/rfc3986[Uniform Resource Identifier (URI): Generic Syntax (rfc3986)] === See Also xref:boost-urls-parse_absolute_uri[parse_absolute_uri] , xref:boost-urls-parse_origin_form[parse_origin_form] , xref:boost-urls-parse_relative_ref[parse_relative_ref] , xref:boost-urls-parse_uri[parse_uri] , xref:boost-urls-parse_uri_reference[parse_uri_reference] . [#boost-urls-url_view-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::~url_view Destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ~url_view() = default; ---- === Description Any params, segments, iterators, or other views which reference the same underlying character buffer remain valid. [#boost-urls-url_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::url_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view-2constructor-0c[pass:[url_view]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view-2constructor-025[pass:[url_view]](core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class String, class = void> xref:boost-urls-url_view-2constructor-00[pass:[url_view]](String const& s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view-2constructor-024[pass:[url_view]](xref:boost-urls-url_view[url_view] const& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view-2constructor-0a[pass:[url_view]](xref:boost-urls-url_view_base[url_view_base] const& other) noexcept; ---- === Description Default constructed views refer to a string with zero length, which always remains valid. This matches the grammar for a relative-ref with an empty path and no query or fragment. [,cpp] ---- url_view u; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- === 4.2. Relative Reference (rfc3986) === Exceptions |=== | Name | Thrown on | `The` | input failed to parse correctly. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-url_view-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view[url_view]& xref:boost-urls-url_view-operator_assign-02[pass:[operator=]](xref:boost-urls-url_view[url_view] const& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view[url_view]& xref:boost-urls-url_view-operator_assign-0f[pass:[operator=]](xref:boost-urls-url_view_base[url_view_base] const& other) noexcept; ---- === Description After assignment, both views reference the same underlying character buffer. Ownership is not transferred. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing. [#boost-urls-url_view-max_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::max_size Return the maximum number of characters possible === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t max_size() noexcept; ---- === Description This represents the largest number of characters that are possible in a url, not including any null terminator. === Constant. === Throws nothing. [#boost-urls-authority_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::authority_view A non-owning reference to a valid authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class authority_view; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-authority_view-2constructor[`authority_view`] [.small]#[constructor]# ¦ Construct from a string. Constructor ¦xref:boost-urls-authority_view-buffer[`buffer`] ¦ Return the complete authority ¦xref:boost-urls-authority_view-compare[`compare`] ¦ Return the result of comparing this with another authority ¦xref:boost-urls-authority_view-data[`data`] ¦ Return a pointer to the first character ¦xref:boost-urls-authority_view-empty[`empty`] ¦ Return true if the authority is empty ¦xref:boost-urls-authority_view-encoded_host[`encoded_host`] ¦ Return the host ¦xref:boost-urls-authority_view-encoded_host_address[`encoded_host_address`] ¦ Return the host ¦xref:boost-urls-authority_view-encoded_host_and_port[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost-urls-authority_view-encoded_host_name[`encoded_host_name`] ¦ Return the host name ¦xref:boost-urls-authority_view-encoded_password[`encoded_password`] ¦ Return the password ¦xref:boost-urls-authority_view-encoded_user[`encoded_user`] ¦ Return the user ¦xref:boost-urls-authority_view-encoded_userinfo[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost-urls-authority_view-has_password[`has_password`] ¦ Return true if a password is present ¦xref:boost-urls-authority_view-has_port[`has_port`] ¦ Return true if a port is present ¦xref:boost-urls-authority_view-has_userinfo[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost-urls-authority_view-host[`host`] ¦ Return the host ¦xref:boost-urls-authority_view-host_address[`host_address`] ¦ Return the host ¦xref:boost-urls-authority_view-host_ipv4_address[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost-urls-authority_view-host_ipv6_address[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost-urls-authority_view-host_ipvfuture[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost-urls-authority_view-host_name[`host_name`] ¦ Return the host name ¦xref:boost-urls-authority_view-host_type[`host_type`] ¦ Return the host type ¦xref:boost-urls-authority_view-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-authority_view-password[`password`] ¦ Return the password ¦xref:boost-urls-authority_view-port[`port`] ¦ Return the port ¦xref:boost-urls-authority_view-port_number[`port_number`] ¦ Return the port ¦xref:boost-urls-authority_view-size[`size`] ¦ Return the number of characters in the authority ¦xref:boost-urls-authority_view-user[`user`] ¦ Return the user ¦xref:boost-urls-authority_view-userinfo[`userinfo`] ¦ Return the userinfo ¦xref:boost-urls-authority_view-2destructor[`~authority_view`] [.small]#[destructor]# ¦ Destructor |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-authority_view-08friend-0c[`operator!=`] ¦ Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-authority_view-08friend-076[`operator<`] ¦ Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-authority_view-08friend-08[`operator<<`] ¦ Format the encoded authority to the output stream ¦xref:boost-urls-authority_view-08friend-007[`operator<=`] ¦ Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-authority_view-08friend-00c[`operator==`] ¦ Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-authority_view-08friend-0d[`operator>`] ¦ Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. ¦xref:boost-urls-authority_view-08friend-072[`operator>=`] ¦ Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. |=== === Description Objects of this type represent valid authority strings constructed from a parsed, external character buffer whose storage is managed by the caller. That is, it acts like a `core::string_view` in terms of ownership. The caller is responsible for ensuring that the lifetime of the underlying character buffer extends until it is no longer referenced. === Construction from a string parses the input as an _authority_ and throws an exception on error. Upon success, the constructed object points to the passed character buffer; ownership is not transferred. [,cpp] ---- authority_view a( "user:pass@www.example.com:8080" ); ---- === The parsing function xref:boost-urls-parse_authority[parse_authority] returns a result containing either a valid xref:boost-urls-authority_view-2constructor-0e[authority_view] upon succcess, otherwise it contain an error. The error can be converted to an exception by the caller if desired: [,cpp] ---- system::result< authority_view > rv = parse_authority( "user:pass@www.example.com:8080" ); ---- [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] === See Also xref:boost-urls-parse_authority[parse_authority] . [#boost-urls-authority_view-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::~authority_view Destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual ~authority_view(); ---- [#boost-urls-authority_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::authority_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-authority_view-2constructor-0e[pass:[authority_view]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-authority_view-2constructor-03[pass:[authority_view]](core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-authority_view-2constructor-04[pass:[authority_view]](xref:boost-urls-authority_view[authority_view] const&) noexcept; ---- === Description Default constructed authorities refer to a string with zero length, which is always valid. This matches the grammar for a zero-length host. === Throws nothing. [#boost-urls-authority_view-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-authority_view[authority_view]& operator=(xref:boost-urls-authority_view[authority_view] const&) noexcept; ---- [#boost-urls-authority_view-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::size Return the number of characters in the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t size() const noexcept; ---- === Description This function returns the number of characters in the authority. [,cpp] ---- assert( authority_view( "user:pass@www.example.com:8080" ).size() == 30 ); ---- === Throws nothing. [#boost-urls-authority_view-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::empty Return true if the authority is empty === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description An empty authority has an empty host, no userinfo, and no port. [,cpp] ---- assert( authority_view( "" ).empty() ); ---- === Throws nothing. [#boost-urls-authority_view-data] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::data Return a pointer to the first character === Synopsis Declared in header `` [source,cpp,subs="verbatim,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-terminated. === Throws nothing. [#boost-urls-authority_view-buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::buffer Return the complete authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view buffer() const noexcept; ---- === Description This function returns the authority as a percent-encoded string. [,cpp] ---- assert( parse_authority( "www.example.com" ).value().buffer() == "www.example.com" ); ---- [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] [#boost-urls-authority_view-has_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::has_userinfo Return true if a userinfo is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_userinfo() const noexcept; ---- === Description This function returns true if this contains a userinfo. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_userinfo() ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_password[has_password] , xref:boost-urls-authority_view-encoded_password[encoded_password] , xref:boost-urls-authority_view-encoded_user[encoded_user] , xref:boost-urls-authority_view-encoded_userinfo[encoded_userinfo] , xref:boost-urls-authority_view-password[password] , xref:boost-urls-authority_view-user[user] , xref:boost-urls-authority_view-userinfo[userinfo] . [#boost-urls-authority_view-userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::userinfo Return the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type userinfo(StringToken&& token) const; ---- === Description If present, this function returns a string representing the userinfo (which may be empty). Otherwise it returns an empty string. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).userinfo() == "jane-doe:pass" ); ---- === Linear in `this->userinfo().size()`. === Calls to allocate may throw. [,cpp] ---- userinfo = user [ ":" [ password ] ] authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_password[has_password] , xref:boost-urls-authority_view-has_userinfo[has_userinfo] , xref:boost-urls-authority_view-encoded_password[encoded_password] , xref:boost-urls-authority_view-encoded_user[encoded_user] , xref:boost-urls-authority_view-encoded_userinfo[encoded_userinfo] , xref:boost-urls-authority_view-password[password] , xref:boost-urls-authority_view-user[user] . [#boost-urls-authority_view-encoded_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::encoded_userinfo Return the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_userinfo() const noexcept; ---- === Description If present, this function returns a string representing the userinfo (which may be empty). Otherwise it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_userinfo() == "jane%2Ddoe:pass" ); ---- === Constant. === Throws nothing [,cpp] ---- userinfo = user [ ":" [ password ] ] authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_password[has_password] , xref:boost-urls-authority_view-has_userinfo[has_userinfo] , xref:boost-urls-authority_view-encoded_password[encoded_password] , xref:boost-urls-authority_view-encoded_user[encoded_user] , xref:boost-urls-authority_view-password[password] , xref:boost-urls-authority_view-user[user] , xref:boost-urls-authority_view-userinfo[userinfo] . [#boost-urls-authority_view-user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::user Return the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type user(StringToken&& token) const; ---- === Description If present, this function returns a string representing the user (which may be empty). Otherwise it returns an empty string. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).user() == "jane-doe" ); ---- === Linear in `this->user().size()`. === Calls to allocate may throw. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_password[has_password] , xref:boost-urls-authority_view-has_userinfo[has_userinfo] , xref:boost-urls-authority_view-encoded_password[encoded_password] , xref:boost-urls-authority_view-encoded_user[encoded_user] , xref:boost-urls-authority_view-encoded_userinfo[encoded_userinfo] , xref:boost-urls-authority_view-password[password] , xref:boost-urls-authority_view-userinfo[userinfo] . [#boost-urls-authority_view-encoded_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::encoded_user Return the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_user() const noexcept; ---- === Description If present, this function returns a string representing the user (which may be empty). Otherwise it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_user() == "jane%2Ddoe" ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_password[has_password] , xref:boost-urls-authority_view-has_userinfo[has_userinfo] , xref:boost-urls-authority_view-encoded_password[encoded_password] , xref:boost-urls-authority_view-encoded_userinfo[encoded_userinfo] , xref:boost-urls-authority_view-password[password] , xref:boost-urls-authority_view-user[user] , xref:boost-urls-authority_view-userinfo[userinfo] . [#boost-urls-authority_view-has_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::has_password Return true if a password is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_password() const noexcept; ---- === Description This function returns true if the userinfo is present and contains a password. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_password() ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_userinfo[has_userinfo] , xref:boost-urls-authority_view-encoded_password[encoded_password] , xref:boost-urls-authority_view-encoded_user[encoded_user] , xref:boost-urls-authority_view-encoded_userinfo[encoded_userinfo] , xref:boost-urls-authority_view-password[password] , xref:boost-urls-authority_view-user[user] , xref:boost-urls-authority_view-userinfo[userinfo] . [#boost-urls-authority_view-password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::password Return the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type password(StringToken&& token) const; ---- === Description If present, this function returns a string representing the password (which may be an empty string). Otherwise it returns an empty string. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).password() == "pass" ); ---- === Linear in `this->password().size()`. === Calls to allocate may throw. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_password[has_password] , xref:boost-urls-authority_view-has_userinfo[has_userinfo] , xref:boost-urls-authority_view-encoded_password[encoded_password] , xref:boost-urls-authority_view-encoded_user[encoded_user] , xref:boost-urls-authority_view-encoded_userinfo[encoded_userinfo] , xref:boost-urls-authority_view-user[user] , xref:boost-urls-authority_view-userinfo[userinfo] . [#boost-urls-authority_view-encoded_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::encoded_password Return the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_password() const noexcept; ---- === Description This function returns the password portion of the userinfo as a percent-encoded string. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_password() == "pass" ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-authority_view-has_password[has_password] , xref:boost-urls-authority_view-has_userinfo[has_userinfo] , xref:boost-urls-authority_view-encoded_user[encoded_user] , xref:boost-urls-authority_view-encoded_userinfo[encoded_userinfo] , xref:boost-urls-authority_view-password[password] , xref:boost-urls-authority_view-user[user] , xref:boost-urls-authority_view-userinfo[userinfo] . [#boost-urls-authority_view-host_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::host_type Return the host type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls[urls]::xref:boost-urls-host_type[host_type] host_type() const noexcept; ---- === Description This function returns one of the following constants representing the type of host present. * xref:boost-urls-host_type-ipv4[host_type::ipv4] * xref:boost-urls-host_type-ipv6[host_type::ipv6] * xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] * xref:boost-urls-host_type-name[host_type::name] [,cpp] ---- assert( url_view( "https://192.168.0.1/local.htm" ).host_type() == host_type::ipv4 ); ---- === Constant. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::host Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type host(StringToken&& token) const; ---- === Description This function returns the host portion of the authority as a string, or the empty string if there is no authority. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).host() == "www-root.example.com" ); ---- === Linear in `this->host().size()`. === Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-encoded_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::encoded_host Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_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. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host() == "www%2droot.example.com" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::host_address Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type host_address(StringToken&& token) const; ---- === Description The value returned by this function depends on the type of host returned from the function xref:boost-urls-authority_view-host_type[host_type] . * If the type is xref:boost-urls-host_type-ipv4[host_type::ipv4] , then the IPv4 address string is returned. * If the type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , then the IPv6 address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] , then the IPvFuture address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-name[host_type::name] , then the host name string is returned. Any percent-escapes in the string are decoded first. * If the type is xref:boost-urls-host_type-none[host_type::none] , then an empty string is returned. [,cpp] ---- assert( url_view( "https://[1::6:c0a8:1]/" ).host_address() == "1::6:c0a8:1" ); ---- === Linear in `this->host_address().size()`. === Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-encoded_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::encoded_host_address Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_host_address() const noexcept; ---- === Description The value returned by this function depends on the type of host returned from the function xref:boost-urls-authority_view-host_type[host_type] . * If the type is xref:boost-urls-host_type-ipv4[host_type::ipv4] , then the IPv4 address string is returned. * If the type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , then the IPv6 address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] , then the IPvFuture address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-name[host_type::name] , then the host name string is returned. Any percent-escapes in the string are decoded first. * If the type is xref:boost-urls-host_type-none[host_type::none] , then an empty string is returned. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host_address() == "www%2droot.example.com" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-host_ipv4_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::host_ipv4_address Return the host IPv4 address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv4_address[ipv4_address] host_ipv4_address() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] , this function returns the address as a value of type xref:boost-urls-ipv4_address[ipv4_address] . Otherwise, if the host type is not an IPv4 address, it returns a default-constructed value which is equal to the unspecified address "0.0.0.0". [,cpp] ---- assert( url_view( "http://127.0.0.1/index.htm?user=win95" ).host_ipv4_address() == ipv4_address( "127.0.0.1" ) ); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-host_ipv6_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::host_ipv6_address Return the host IPv6 address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv6_address[ipv6_address] host_ipv6_address() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , this function returns the address as a value of type xref:boost-urls-ipv6_address[ipv6_address] . Otherwise, if the host type is not an IPv6 address, it returns a default-constructed value which is equal to the unspecified address "0:0:0:0:0:0:0:0". [,cpp] ---- assert( url_view( "ftp://[::1]/" ).host_ipv6_address() == ipv6_address( "::1" ) ); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-host_ipvfuture] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::host_ipvfuture Return the host IPvFuture address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view host_ipvfuture() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] , this function returns the address as a string. Otherwise, if the host type is not an IPvFuture address, it returns an empty string. [,cpp] ---- assert( url_view( "http://[v1fe.d:9]/index.htm" ).host_ipvfuture() == "v1fe.d:9" ); ---- === Constant. === Throws nothing. [,cpp] ---- IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::host_name Return the host name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type host_name(StringToken&& token) const; ---- === Description If the host type is xref:boost-urls-host_type-name[host_type::name] , this function returns the name as a string. Otherwise, if the host type is not an name, it returns an empty string. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).host_name() == "www-root.example.com" ); ---- === Linear in `this->host_name().size()`. === Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-encoded_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::encoded_host_name Return the host name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_host_name() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-name[host_type::name] , this function returns the name as a string. Otherwise, if the host type is not an name, it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host_name() == "www%2droot.example.com" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-authority_view-has_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::has_port Return true if a port is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_port() const noexcept; ---- === Description This function returns true if an authority is present and contains a port. [,cpp] ---- assert( url_view( "wss://www.example.com:443" ).has_port() ); ---- === Constant. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-authority_view-encoded_host_and_port[encoded_host_and_port] , xref:boost-urls-authority_view-port[port] , xref:boost-urls-authority_view-port_number[port_number] . [#boost-urls-authority_view-port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::port Return the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view port() const noexcept; ---- === Description If present, this function returns a string representing the port (which may be empty). Otherwise it returns an empty string. [,cpp] ---- assert( url_view( "http://localhost.com:8080" ).port() == "8080" ); ---- === Constant. === Throws nothing. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-authority_view-encoded_host_and_port[encoded_host_and_port] , xref:boost-urls-authority_view-has_port[has_port] , xref:boost-urls-authority_view-port_number[port_number] . [#boost-urls-authority_view-port_number] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::port_number Return the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::uint16_t port_number() const noexcept; ---- === Description If a port is present and the numerical value is representable, it is returned as an unsigned integer. Otherwise, the number zero is returned. [,cpp] ---- assert( url_view( "http://localhost.com:8080" ).port_number() == 8080 ); ---- === Constant. === Throws nothing. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-authority_view-encoded_host_and_port[encoded_host_and_port] , xref:boost-urls-authority_view-has_port[has_port] , xref:boost-urls-authority_view-port[port] . [#boost-urls-authority_view-encoded_host_and_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::encoded_host_and_port Return the host and port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_host_and_port() const noexcept; ---- === Description If an authority is present, this function returns the host and optional port as a string, which may be empty. Otherwise it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://www.example.com:8080/index.htm" ).encoded_host_and_port() == "www.example.com:8080" ); ---- === Constant. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-authority_view-has_port[has_port] , xref:boost-urls-authority_view-port[port] , xref:boost-urls-authority_view-port_number[port_number] . [#boost-urls-authority_view-compare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::compare Return the result of comparing this with another authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- int compare(xref:boost-urls-authority_view[authority_view] const& other) const noexcept; ---- === Description This function compares two authorities according to Syntax-Based comparison algorithm. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value -1 if `*this < other`, 0 if `this == other`, and 1 if `this > other`. [#boost-urls-authority_view-08friend-00c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator==( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-authority_view-08friend-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator!=( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-authority_view-08friend-076] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator< Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator<( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-authority_view-08friend-007] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator<=( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-authority_view-08friend-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator> Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator>( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-authority_view-08friend-072] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator>= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator>=( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-authority_view-08friend-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the encoded authority to the output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend std::ostream& operator<<( std::ostream& os, xref:boost-urls-authority_view[authority_view] const& a); ---- === Description This hidden friend function serializes the encoded URL to the output stream. [,cpp] ---- authority_view a( "www.example.com" ); std::cout << a << std::endl; ---- [#boost-urls-operator_lt] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator< Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_lt-0a[pass:[operator<]]( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool xref:boost-urls-operator_lt-0b[pass:[operator<]]( S0 const& s0, S1 const& s1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_lt-04[pass:[operator<]]( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_le] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_le-01[pass:[operator<=]]( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool xref:boost-urls-operator_le-06[pass:[operator<=]]( S0 const& s0, S1 const& s1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_le-0a[pass:[operator<=]]( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_gt] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator> Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_gt-08[pass:[operator>]]( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool xref:boost-urls-operator_gt-02[pass:[operator>]]( S0 const& s0, S1 const& s1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_gt-09[pass:[operator>]]( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_ge] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator>= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_ge-08[pass:[operator>=]]( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool xref:boost-urls-operator_ge-01[pass:[operator>=]]( S0 const& s0, S1 const& s1) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- bool xref:boost-urls-operator_ge-00[pass:[operator>=]]( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-parse_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_authority Parse an authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_authority(core::string_view s) noexcept; ---- === Description This function parses a string according to the authority grammar below, and returns an xref:boost-urls-authority_view[authority_view] referencing the string. Ownership of the string is not transferred; the caller is responsible for ensuring that the lifetime of the string extends until the view is no longer being accessed. [,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 ---- === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] === Return Value A view to the parsed authority === Parameters |=== | Name | Description | *s* | The string to parse |=== === See Also xref:boost-urls-authority_view[authority_view] . [#boost-urls-encoded_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::encoded_size Return the buffer size needed for percent-encoding === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template std::size_t encoded_size( core::string_view s, CharSet const& unreserved, xref:boost-urls-encoding_opts[encoding_opts] opt = = {}) noexcept; ---- === Description This function returns the exact number of bytes necessary to store the result of applying percent-encoding to the string using the given options and character set. No encoding is actually performed. [,cpp] ---- assert( encoded_size( "My Stuff", pchars ) == 10 ); ---- === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2.1. Percent-Encoding (rfc3986)] === Return Value The number of bytes needed, excluding any null terminator. === Parameters |=== | Name | Description | *s* | The string to measure. | *unreserved* | The set of characters that is not percent-encoded. | *opt* | The options for encoding. If this parameter is omitted, the default options are be used. |=== === See Also xref:boost-urls-encode-04[encode] , xref:boost-urls-encoding_opts[encoding_opts] , xref:boost-urls-make_pct_string_view[make_pct_string_view] . [#boost-urls-encode] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::encode Apply percent-encoding to a string === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- template std::size_t xref:boost-urls-encode-09[pass:[encode]]( char* dest, std::size_t size, core::string_view s, CharSet const& unreserved, xref:boost-urls-encoding_opts[encoding_opts] opt = = {}); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class StringToken = xref:boost-urls-string_token[string_token]::xref:boost-urls-string_token-return_string[return_string], class CharSet> StringToken::result_type xref:boost-urls-encode-04[pass:[encode]]( core::string_view s, CharSet const& unreserved, xref:boost-urls-encoding_opts[encoding_opts] opt = = {}, StringToken&& token) noexcept; ---- === Description This function applies percent-encoding to the string using the given options and character set. The destination buffer provided by the caller is used to store the result, which may be truncated if there is insufficient space. [,cpp] ---- char buf[100]; assert( encode( buf, sizeof(buf), "Program Files", pchars ) == 15 ); ---- === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2.1. Percent-Encoding (rfc3986)] === Return Value The number of characters written to the destination buffer. === Parameters |=== | Name | Description | *dest* | The destination buffer to write to. | *size* | The number of writable characters pointed to by `dest`. If this is less than `encoded_size(s)`, the result is truncated. | *s* | The string to encode. | *unreserved* | The set of characters that is not percent-encoded. | *opt* | The options for encoding. If this parameter is omitted, the default options are used. | *token* | A string token. |=== === See Also xref:boost-urls-encode-04[encode] , xref:boost-urls-encoded_size[encoded_size] , xref:boost-urls-make_pct_string_view[make_pct_string_view] . [#boost-urls-ignore_case] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::ignore_case Ignore case when comparing === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ignore_case_t const ignore_case = {}; ---- === Description This value may be optionally passed to functions accepting a parameter of type xref:boost-urls-ignore_case_param[ignore_case_param] to indicate that comparisons should be case-insensitive. [#boost-urls-ignore_case_param] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::ignore_case_param An optional parameter to determine case-sensitivity === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class ignore_case_param; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-ignore_case_param-2constructor[`ignore_case_param`] [.small]#[constructor]# ¦ Constructor ¦xref: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-insensitive when the value xref:boost-urls-ignore_case[ignore_case] is passed. [#boost-urls-ignore_case_param-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ignore_case_param[pass:[ignore_case_param]]::ignore_case_param Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ignore_case_param-2constructor-03[pass:[ignore_case_param]]() noexcept = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-ignore_case_param-2constructor-01[pass:[ignore_case_param]](ignore_case_t) noexcept; ---- === Description By default, comparisons are case-sensitive. === This function performs case-sensitive comparisons when called with no arguments: [,cpp] ---- void f( ignore_case_param = {} ); ---- [#boost-urls-ignore_case_param-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ignore_case_param[pass:[ignore_case_param]]::operator bool True if an algorithm should ignore case === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator bool() const noexcept; ---- === Description Values of type `ignore_case_param` evaluate to true when constructed with the constant xref:boost-urls-ignore_case[ignore_case] . Otherwise, they are default-constructed and evaluate to `false`. [#boost-urls-no_value_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::no_value_t The type of no_value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct no_value_t; ---- [#boost-urls-param_pct_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::param_pct_view A query parameter === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct param_pct_view; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-param_pct_view-2conversion-00[`operator param`] ¦ Conversion ¦xref:boost-urls-param_pct_view-2conversion-0c[`operator param_view`] ¦ Conversion to param_view ¦xref:boost-urls-param_pct_view-operator_ptr[`operator->`] ¦ Arrow support ¦xref:boost-urls-param_pct_view-2constructor[`param_pct_view`] [.small]#[constructor]# ¦ Construction Constructor aggregate construction |=== === Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-param_pct_view-has_value[`has_value`] ¦ True if a value is present ¦xref:boost-urls-param_pct_view-key[`key`] ¦ The key ¦xref:boost-urls-param_pct_view-value[`value`] ¦ The value |=== === Description Objects of this type represent a single key and value pair in a query string where a key is always present and may be empty, while the presence of a value is indicated by xref:boost-urls-param_pct_view-has_value[has_value] equal to true. An empty value is distinct from no value. The strings may have percent escapes, and offer an additional invariant: they never contain an invalid percent-encoding. For most usages, key comparisons are case-sensitive and duplicate keys in a query are possible. However, it is the authority that has final control over how the query is interpreted. Keys and values in this object reference external character buffers. Ownership of the buffers is not transferred; the caller is responsible for ensuring that the assigned buffers remain valid until they are no longer referenced. [,cpp] ---- query-params = query-param *( "&" query-param ) query-param = key [ "=" value ] key = *qpchar value = *( qpchar / "=" ) ---- * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-param[param] , xref:boost-urls-param_view[param_view] . [#boost-urls-param_pct_view-key] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::key The key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] key; ---- === Description For most usages, key comparisons are case-sensitive and duplicate keys in a query are possible. However, it is the authority that has final control over how the query is interpreted. [#boost-urls-param_pct_view-value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::value The value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] value; ---- === Description The presence of a value is indicated by xref:boost-urls-param_pct_view-has_value[has_value] equal to true. An empty value is distinct from no value. [#boost-urls-param_pct_view-has_value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::has_value True if a value is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_value = false; ---- === Description The presence of a value is indicated by `has_value == true`. An empty value is distinct from no value. [#boost-urls-param_pct_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::param_pct_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-param_pct_view-2constructor-00[pass:[param_pct_view]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param_pct_view-2constructor-0e[pass:[param_pct_view]]( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-pct_string_view[pct_string_view] value) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-param_pct_view-2constructor-05[pass:[param_pct_view]]( xref:boost-urls-pct_string_view[pct_string_view] key, OptionalString const& value); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-param_pct_view-2constructor-03[pass:[param_pct_view]](xref:boost-urls-param_view[param_view] const& p); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param_pct_view-2constructor-02[pass:[param_pct_view]]( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-pct_string_view[pct_string_view] value, bool has_value) noexcept; ---- === Description Default constructed query parameters have an empty key and no value. [,cpp] ---- param_pct_view qp; ---- [,cpp] ---- this->key == "" && this->value == "" && this->has_value == false ---- === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | ``key`` | or `value` contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *key,* | value The key and value to set. | *p* | The param to construct from. |=== [#boost-urls-param_pct_view-2conversion-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::operator param Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit operator xref:boost-urls-param[param]() const; ---- === Description This function performs a conversion from a reference-like query parameter to one retaining ownership of the strings by making a copy. === Linear in `this->key.size() + this->value.size()`. === Calls to allocate may throw. [#boost-urls-param_pct_view-2conversion-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::operator param_view Conversion to param_view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator xref:boost-urls-param_view[param_view]() const noexcept; ---- === Description This function performs a conversion from a pct_string_view query parameter to one using a simple string_view. === Calls to allocate may throw. [#boost-urls-param_pct_view-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::operator-> Arrow support === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param_pct_view[param_pct_view] const* operator->() const noexcept; ---- [#boost-urls-param_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::param_view A query parameter === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct param_view; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-param_view-2conversion[`operator param`] ¦ Conversion ¦xref:boost-urls-param_view-operator_ptr[`operator->`] ¦ ¦xref:boost-urls-param_view-2constructor[`param_view`] [.small]#[constructor]# ¦ Constructor |=== === Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-param_view-has_value[`has_value`] ¦ True if a value is present ¦xref:boost-urls-param_view-key[`key`] ¦ The key ¦xref:boost-urls-param_view-value[`value`] ¦ The value |=== === Description Objects of this type represent a single key and value pair in a query string where a key is always present and may be empty, while the presence of a value is indicated by xref:boost-urls-param_view-has_value[has_value] equal to true. An empty value is distinct from no value. Depending on where the object was obtained, the strings may or may not contain percent escapes. For most usages, key comparisons are case-sensitive and duplicate keys in a query are possible. However, it is the authority that has final control over how the query is interpreted. Keys and values in this object reference external character buffers. Ownership of the buffers is not transferred; the caller is responsible for ensuring that the assigned buffers remain valid until they are no longer referenced. [,cpp] ---- query-params = query-param *( "&" query-param ) query-param = key [ "=" value ] key = *qpchar value = *( qpchar / "=" ) ---- * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-param[param] , xref:boost-urls-param_pct_view[param_pct_view] . [#boost-urls-param_view-key] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::key The key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view key; ---- === Description For most usages, key comparisons are case-sensitive and duplicate keys in a query are possible. However, it is the authority that has final control over how the query is interpreted. [#boost-urls-param_view-value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::value The value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view value; ---- === Description The presence of a value is indicated by xref:boost-urls-param_view-has_value[has_value] equal to true. An empty value is distinct from no value. [#boost-urls-param_view-has_value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::has_value True if a value is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_value = false; ---- === Description The presence of a value is indicated by `has_value == true`. An empty value is distinct from no value. [#boost-urls-param_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::param_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-param_view-2constructor-07a[pass:[param_view]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-param_view-2constructor-01[pass:[param_view]]( core::string_view key, OptionalString const& value) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param_view-2constructor-07e[pass:[param_view]](xref:boost-urls-param[param] const& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param_view-2constructor-03[pass:[param_view]]( core::string_view key_, core::string_view value_, bool has_value_) noexcept; ---- === Description Default constructed query parameters have an empty key and no value. [,cpp] ---- param_view qp; ---- [,cpp] ---- this->key == "" && this->value == "" && this->has_value == false ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *key,* | value The key and value to set. | *other* | The param to reference |=== [#boost-urls-param_view-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::operator param Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit operator xref:boost-urls-param[param](); ---- === Description This function performs a conversion from a reference-like query parameter to one retaining ownership of the strings by making a copy. No validation is performed on the strings. === Linear in `this->key.size() + this->value.size()`. === Calls to allocate may throw. [#boost-urls-param_view-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::operator-> === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param_view[param_view] const* operator->() const noexcept; ---- [#boost-urls-no_value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::no_value Constant indicating no value in a param === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-no_value_t[no_value_t] const no_value = {}; ---- [#boost-urls-param] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::param A query parameter === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct param; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-param-operator_ptr[`operator->`] ¦ ¦xref:boost-urls-param-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-param-2constructor[`param`] [.small]#[constructor]# ¦ Constructor |=== === Data Members [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-param-has_value[`has_value`] ¦ True if a value is present ¦xref:boost-urls-param-key[`key`] ¦ The key ¦xref:boost-urls-param-value[`value`] ¦ The value |=== === Description Objects of this type represent a single key and value pair in a query string where a key is always present and may be empty, while the presence of a value is indicated by xref:boost-urls-param-has_value[has_value] equal to true. An empty value is distinct from no value. Depending on where the object was obtained, the strings may or may not contain percent escapes. For most usages, key comparisons are case-sensitive and duplicate keys in a query are possible. However, it is the authority that has final control over how the query is interpreted. [,cpp] ---- query-params = query-param *( "&" query-param ) query-param = key [ "=" value ] key = *qpchar value = *( qpchar / "=" ) ---- * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-param_view[param_view] , xref:boost-urls-param_pct_view[param_pct_view] . [#boost-urls-param-key] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::key The key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::string key; ---- === Description For most usages, key comparisons are case-sensitive and duplicate keys in a query are possible. However, it is the authority that has final control over how the query is interpreted. [#boost-urls-param-value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::value The value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::string value; ---- === Description The presence of a value is indicated by xref:boost-urls-param-has_value[has_value] equal to true. An empty value is distinct from no value. [#boost-urls-param-has_value] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::has_value True if a value is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_value = false; ---- === Description The presence of a value is indicated by `has_value == true`. An empty value is distinct from no value. [#boost-urls-param-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::param Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-param-2constructor-09[pass:[param]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param-2constructor-07[pass:[param]](xref:boost-urls-param[param]&& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-param-2constructor-0d[pass:[param]](xref:boost-urls-param[param] const& other) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-param-2constructor-0b[pass:[param]]( core::string_view key, OptionalString const& value); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param-2constructor-0a[pass:[param]]( core::string_view key, core::string_view value, bool has_value) noexcept; ---- === Description Default constructed query parameters have an empty key and no value. [,cpp] ---- param qp; ---- [,cpp] ---- this->key == "" && this->value == "" && this->has_value == false ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *key,* | value The key and value to set. |=== [#boost-urls-param-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param[param]& xref:boost-urls-param-operator_assign-0b[pass:[operator=]](xref:boost-urls-param[param]&& other) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-param[param]& xref:boost-urls-param-operator_assign-0cd[pass:[operator=]](xref:boost-urls-param[param] const&) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param[param]& xref:boost-urls-param-operator_assign-0cb[pass:[operator=]](xref:boost-urls-param_view[param_view] const& other); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param[param]& xref:boost-urls-param-operator_assign-03[pass:[operator=]](xref:boost-urls-param_pct_view[param_pct_view] const& other); ---- === Description Upon assignment, this acquires ownership of the members of other via move assignment. The moved from object is as if default constructed. === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The parameter to copy. |=== [#boost-urls-param-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::operator-> === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param[param] const* operator->() const noexcept; ---- [#boost-urls-params_encoded_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::params_encoded_base Common functionality for containers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class params_encoded_base; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_encoded_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-params_encoded_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-params_encoded_base-iterator[`iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_encoded_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-params_encoded_base-size_type[`size_type`] ¦ An unsigned integer type to represent sizes. ¦xref:boost-urls-params_encoded_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-params_encoded_base-buffer[`buffer`] ¦ Return the query corresponding to these params ¦xref:boost-urls-params_encoded_base-contains[`contains`] ¦ Return true if a matching key exists ¦xref:boost-urls-params_encoded_base-count[`count`] ¦ Return the number of matching keys ¦xref:boost-urls-params_encoded_base-empty[`empty`] ¦ Return true if there are no params ¦xref:boost-urls-params_encoded_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-params_encoded_base-find[`find`] ¦ Find a matching key ¦xref:boost-urls-params_encoded_base-find_last[`find_last`] ¦ Find a matching key ¦xref:boost-urls-params_encoded_base-size[`size`] ¦ Return the number of params |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description This base class is used by the library to provide common member functions for containers. This cannot be instantiated directly; Instead, use one of the containers or functions: * xref:boost-urls-params_ref[params_ref] * xref:boost-urls-params_view[params_view] * xref:boost-urls-params_encoded_ref[params_encoded_ref] * xref:boost-urls-params_encoded_view[params_encoded_view] [#boost-urls-params_encoded_base-iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::iterator A Bidirectional iterator to a query parameter === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class iterator; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-iterator-difference_type[`difference_type`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-iterator_category[`iterator_category`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-pointer[`pointer`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-reference[`reference`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-iterator-2constructor[`iterator`] [.small]#[constructor]# ¦ ¦xref:boost-urls-params_encoded_base-iterator-operator_star[`operator*`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-operator_inc[`operator++`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-operator_dec[`operator--`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-operator_ptr[`operator->`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-operator_assign[`operator=`] ¦ |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-iterator-08friend-097[`operator!=`] ¦ ¦xref:boost-urls-params_encoded_base-iterator-08friend-09e[`operator==`] ¦ |=== === Description Objects of this type allow iteration through the parameters in the query. Strings returned by iterators may contain percent escapes. The values returned are read-only; changes to parameters must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced refer to the underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced by any container or iterator. [#boost-urls-params_encoded_base-iterator-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-params_encoded_base[params_encoded_base]::xref:boost-urls-params_encoded_base-value_type[value_type]; ---- [#boost-urls-params_encoded_base-iterator-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = xref:boost-urls-params_encoded_base[params_encoded_base]::xref:boost-urls-params_encoded_base-reference[reference]; ---- [#boost-urls-params_encoded_base-iterator-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::pointer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using pointer = xref:boost-urls-params_encoded_base-iterator-reference[reference]; ---- [#boost-urls-params_encoded_base-iterator-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::difference_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-params_encoded_base-iterator-iterator_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::iterator_category === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using iterator_category = std::bidirectional_iterator_tag; ---- [#boost-urls-params_encoded_base-iterator-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::iterator === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_encoded_base-iterator-2constructor-0c[pass:[iterator]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_encoded_base-iterator-2constructor-0e[pass:[iterator]](xref:boost-urls-params_encoded_base-iterator[iterator] const&) = default; ---- [#boost-urls-params_encoded_base-iterator-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_encoded_base-iterator[iterator]& operator=(xref:boost-urls-params_encoded_base-iterator[iterator] const&) = default; ---- [#boost-urls-params_encoded_base-iterator-operator_inc] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator++ === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator]& xref:boost-urls-params_encoded_base-iterator-operator_inc-09[pass:[operator++]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_base-iterator-operator_inc-03[pass:[operator++]](int) noexcept; ---- [#boost-urls-params_encoded_base-iterator-operator_dec] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator-- === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator]& xref:boost-urls-params_encoded_base-iterator-operator_dec-01[pass:[operator--]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_base-iterator-operator_dec-05[pass:[operator--]](int) noexcept; ---- [#boost-urls-params_encoded_base-iterator-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator* === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator-reference[reference] operator*() const; ---- [#boost-urls-params_encoded_base-iterator-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator-> === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator-pointer[pointer] operator->() const; ---- [#boost-urls-params_encoded_base-iterator-08friend-09e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator==( xref:boost-urls-params_encoded_base-iterator[iterator] const& it0, xref:boost-urls-params_encoded_base-iterator[iterator] const& it1) noexcept; ---- [#boost-urls-params_encoded_base-iterator-08friend-097] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator!=( xref:boost-urls-params_encoded_base-iterator[iterator] const& it0, xref:boost-urls-params_encoded_base-iterator[iterator] const& it1) noexcept; ---- [#boost-urls-params_encoded_base-const_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::const_iterator A Bidirectional iterator to a query parameter === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_iterator = xref:boost-urls-params_encoded_base-iterator[iterator]; ---- === Description Objects of this type allow iteration through the parameters in the query. Strings returned by iterators may contain percent escapes. The values returned are read-only; changes to parameters must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced refer to the underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced by any container or iterator. [#boost-urls-params_encoded_base-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::value_type The value type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-param[param]; ---- === Description Values of this type represent parameters whose strings retain unique ownership by making a copy. [,cpp] ---- params_encoded_view::value_type qp( *url_view( "?first=John&last=Doe" ).params().find( "first" ) ); ---- === See Also xref:boost-urls-param[param] . [#boost-urls-params_encoded_base-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = xref:boost-urls-param_pct_view[param_pct_view]; ---- === Description This is the type of value returned when iterators of the view are dereferenced. === See Also xref:boost-urls-param_view[param_view] . [#boost-urls-params_encoded_base-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::const_reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_reference = xref:boost-urls-param_pct_view[param_pct_view]; ---- === Description This is the type of value returned when iterators of the view are dereferenced. === See Also xref:boost-urls-param_view[param_view] . [#boost-urls-params_encoded_base-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::size_type An unsigned integer type to represent sizes. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using size_type = std::size_t; ---- [#boost-urls-params_encoded_base-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::difference_type A signed integer type used to represent differences. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-params_encoded_base-max_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::max_size Return the maximum number of characters possible === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t max_size() noexcept; ---- === Description This represents the largest number of characters that are possible in a path, not including any null terminator. === Throws nothing. [#boost-urls-params_encoded_base-buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::buffer Return the query corresponding to these params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] buffer() const noexcept; ---- === Description This function returns the query string referenced by the container. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).encoded_params().buffer() == "first=John&last=Doe" ); ---- === Constant. === Throws nothing. [,cpp] ---- query-params = query-param *( "&" query-param ) query-param = key [ "=" value ] key = *qpchar value = *( qpchar / "=" ) ---- * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] [#boost-urls-params_encoded_base-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::empty Return true if there are no params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description [,cpp] ---- assert( ! url_view( "?key=value" ).encoded_params().empty() ); ---- === Constant. === Throws nothing. [#boost-urls-params_encoded_base-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::size Return the number of params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t size() const noexcept; ---- === Description [,cpp] ---- assert( url_view( "?key=value").encoded_params().size() == 1 ); ---- === Constant. === Throws nothing. [#boost-urls-params_encoded_base-begin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::begin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] begin() const noexcept; ---- === Description === Linear in the size of the first param. === Throws nothing. [#boost-urls-params_encoded_base-end] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::end Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] end() const noexcept; ---- === Description === Constant. === Throws nothing. [#boost-urls-params_encoded_base-contains] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::contains Return true if a matching key exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool contains( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key, which may contain percent escapes. The comparison is performed as if all escaped characters were decoded first. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).encoded_params().contains( "first" ) ); ---- === Linear in `this->buffer().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_encoded_base-count] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::count Return the number of matching keys === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t count( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) 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. The comparison is performed as if all escaped characters were decoded first. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).encoded_params().count( "first" ) == 1 ); ---- === Linear in `this->buffer().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_encoded_base-find] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::find Find a matching key === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_base-find-03[pass:[find]]( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_base-find-00[pass:[find]]( xref:boost-urls-params_encoded_base-iterator[iterator] from, xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key, which may contain percent escapes. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).encoded_params().find( "First", ignore_case )->value == "John" ); ---- [,cpp] ---- return this->find( this->begin(), key, ic ); ---- === Linear in `this->buffer().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. | *from* | The position to begin the search from. This can be `end()`. |=== [#boost-urls-params_encoded_base-find_last] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::find_last Find a matching key === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_base-find_last-05[pass:[find_last]]( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_base-find_last-0d[pass:[find_last]]( xref:boost-urls-params_encoded_base-iterator[iterator] before, xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key, which may contain percent escapes. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).encoded_params().find_last( "last" )->value == "Doe" ); ---- === Linear in `this->buffer().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. | *before* | One past the position to begin the search from. This can be `end()`. |=== [#boost-urls-params_ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::params_ref A view representing query parameters in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class params_ref : public xref:boost-urls-params_base[params_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-params_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-params_base-iterator[`iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-params_base-size_type[`size_type`] ¦ An unsigned integer type to represent sizes. ¦xref:boost-urls-params_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_ref-append[`append`] ¦ Append elements ¦xref:boost-urls-params_ref-assign[`assign`] ¦ Assign elements ¦xref:boost-urls-params_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-params_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-params_ref-clear[`clear`] ¦ Clear the contents of the container ¦xref:boost-urls-params_base-contains[`contains`] ¦ Return true if a matching key exists ¦xref:boost-urls-params_base-count[`count`] ¦ Return the number of matching keys ¦xref:boost-urls-params_base-empty[`empty`] ¦ Return true if there are no params ¦xref:boost-urls-params_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-params_ref-erase[`erase`] ¦ Erase elements ¦xref:boost-urls-params_base-find[`find`] ¦ Find a matching key ¦xref:boost-urls-params_base-find_last[`find_last`] ¦ Find a matching key ¦xref:boost-urls-params_ref-insert[`insert`] ¦ Insert elements ¦xref:boost-urls-params_ref-2conversion[`operator params_view`] ¦ Conversion ¦xref:boost-urls-params_ref-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-params_ref-2constructor[`params_ref`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-params_ref-replace[`replace`] ¦ Replace elements ¦xref:boost-urls-params_ref-set[`set`] ¦ Set a value ¦xref:boost-urls-params_base-size[`size`] ¦ Return the number of params ¦xref:boost-urls-params_ref-unset[`unset`] ¦ Remove the value on an element ¦xref:boost-urls-params_ref-url[`url`] ¦ Return the referenced url |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description Objects of this type are used to interpret the query parameters as a bidirectional view of key/value pairs. The view does not retain ownership of the elements and instead references the original url. The caller is responsible for ensuring that the lifetime of the referenced url extends until it is no longer referenced. The view is modifiable; calling non-const members causes changes to the referenced url. Percent escapes in strings returned when dereferencing iterators are automatically decoded. Reserved characters in strings supplied to modifier functions are automatically percent-escaped. [,cpp] ---- url u( "?first=John&last=Doe" ); params_ref p = u.params(); ---- === Changes to the underlying character buffer can invalidate iterators which reference it. Modifications made through the container invalidate some or all iterators: * xref:boost-urls-params_ref-append-0f[append] : Only `end()`. * xref:boost-urls-params_ref-assign-09[assign] , xref:boost-urls-params_ref-clear[clear] , `operator=` : All elements. * xref:boost-urls-params_ref-erase-05[erase] : Erased elements and all elements after (including `end()`). * xref:boost-urls-params_ref-insert-08[insert] : All elements at or after the insertion point (including `end()`). * xref:boost-urls-params_ref-replace-0d[replace] , xref:boost-urls-params_ref-set-01[set] : Modified elements and all elements after (including `end()`). [#boost-urls-params_ref-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::params_ref Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_ref-2constructor-0b[pass:[params_ref]](xref:boost-urls-params_ref[params_ref] const& other) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref-2constructor-09[pass:[params_ref]]( xref:boost-urls-params_ref[params_ref] const& other, xref:boost-urls-encoding_opts[encoding_opts] opt) noexcept; ---- === Description After construction, both views reference the same url. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the url extends until it is no longer referenced. [,cpp] ---- &this->url() == &other.url() ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The other view. | *opt* | The options for decoding. If this parameter is omitted, `space_as_plus` is used. |=== [#boost-urls-params_ref-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref]& xref:boost-urls-params_ref-operator_assign-0c[pass:[operator=]](xref:boost-urls-params_ref[params_ref] const& other); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref]& xref:boost-urls-params_ref-operator_assign-03[pass:[operator=]](std::initializer_list init); ---- === Description The previous contents of this are replaced by the contents of `other. All iterators are invalidated. [NOTE] The strings referenced by `other` must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *other* | The params to assign. | *init* | The list of params to assign. |=== [#boost-urls-params_ref-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::operator params_view Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator xref:boost-urls-params_view[params_view]() const noexcept; ---- [#boost-urls-params_ref-url] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::url Return the referenced url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& url() const noexcept; ---- === Description This function returns the url referenced by the view. [,cpp] ---- url u( "?key=value" ); assert( &u.segments().url() == &u ); ---- [,cpp] ---- Throws nothing. ---- [#boost-urls-params_ref-clear] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::clear Clear the contents of the container === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void clear() noexcept; ---- === Description All iterators are invalidated. [,cpp] ---- this->url().remove_query(); ---- [,cpp] ---- this->empty() == true && this->url().has_query() == false ---- === Constant. === Throws nothing. [#boost-urls-params_ref-assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::assign Assign elements === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- void xref:boost-urls-params_ref-assign-09[pass:[assign]](std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template void xref:boost-urls-params_ref-assign-02[pass:[assign]]( FwdIt first, FwdIt last); ---- === Description This function replaces the entire contents of the view with the params in the _initializer-list_ . All iterators are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- url u; u.params().assign( {{ "first", "John" }, { "last", "Doe" }} ); ---- === Linear in `init.size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *init* | The list of params to assign. | *first,* | last The range of params to assign. |=== [#boost-urls-params_ref-append] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::append Append elements === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-append-0f[pass:[append]](xref:boost-urls-param_view[param_view] const& p); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-append-07[pass:[append]](std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-append-0c[pass:[append]]( FwdIt first, FwdIt last); ---- === Description This function appends a param to the view. The `end()` iterator is invalidated. [,cpp] ---- url u; u.params().append( { "first", "John" } ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the new element. === Parameters |=== | Name | Description | *p* | The param to append. | *init* | The list of params to append. | *first,* | last The range of params to append. |=== [#boost-urls-params_ref-insert] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::insert Insert elements === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-insert-08[pass:[insert]]( xref:boost-urls-params_base-iterator[iterator] before, xref:boost-urls-param_view[param_view] const& p); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-insert-02[pass:[insert]]( xref:boost-urls-params_base-iterator[iterator] before, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-insert-05[pass:[insert]]( xref:boost-urls-params_base-iterator[iterator] before, FwdIt first, FwdIt last); ---- === Description This function inserts a param before the specified position. All iterators that are equal to `before` or come after are invalidated. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the inserted element. === Parameters |=== | Name | Description | *before* | An iterator before which the param is inserted. This may be equal to `end()`. | *p* | The param to insert. | *init* | The list of params to insert. | *first,* | last The range of params to insert. |=== [#boost-urls-params_ref-erase] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::erase Erase elements === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-erase-05[pass:[erase]](xref:boost-urls-params_base-iterator[iterator] pos) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-erase-0f[pass:[erase]]( xref:boost-urls-params_base-iterator[iterator] first, xref:boost-urls-params_base-iterator[iterator] last) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t xref:boost-urls-params_ref-erase-00[pass:[erase]]( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) noexcept; ---- === Description This function removes an element from the container. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?first=John&last=Doe" ); params_ref::iterator it = u.params().erase( u.params().begin() ); assert( u.encoded_query() == "last=Doe" ); ---- === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value An iterator to one past the removed element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *first,* | last The range of elements to erase. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_ref-replace] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::replace Replace elements === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-replace-0d[pass:[replace]]( xref:boost-urls-params_base-iterator[iterator] pos, xref:boost-urls-param_view[param_view] const& p); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-replace-0b[pass:[replace]]( xref:boost-urls-params_base-iterator[iterator] from, xref:boost-urls-params_base-iterator[iterator] to, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-replace-01[pass:[replace]]( xref:boost-urls-params_base-iterator[iterator] from, xref:boost-urls-params_base-iterator[iterator] to, FwdIt first, FwdIt last); ---- === Description This function replaces the contents of the element at `pos` with the specified param. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?first=John&last=Doe" ); u.params().replace( u.params().begin(), { "title", "Mr" }); assert( u.encoded_query() == "title=Mr&last=Doe" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *p* | The param to assign. | *from,to* | The range of elements to replace. | *init* | The list of params to assign. | *first,* | last The range of params to assign. |=== [#boost-urls-params_ref-unset] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::unset Remove the value on an element === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] unset(xref:boost-urls-params_base-iterator[iterator] pos) noexcept; ---- === Description This function removes the value of an element at the specified position. After the call returns, `has_value` for the element is false. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?first=John&last=Doe" ); u.params().unset( u.params().begin() ); assert( u.encoded_query() == "first&last=Doe" ); ---- === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. |=== [#boost-urls-params_ref-set] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::set Set a value === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-set-09[pass:[set]]( xref:boost-urls-params_base-iterator[iterator] pos, core::string_view value); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_ref-set-01[pass:[set]]( core::string_view key, core::string_view value, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}); ---- === Description This function replaces the value of an element at the specified position. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?id=42&id=69" ); u.params().set( u.params().begin(), "none" ); assert( u.encoded_query() == "id=none&id=69" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *value* | The value to assign. The empty string still counts as a value. That is, `has_value` for the element is true. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::params_base Common functionality for containers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class params_base; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-params_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-params_base-iterator[`iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-params_base-size_type[`size_type`] ¦ An unsigned integer type to represent sizes. ¦xref:boost-urls-params_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-params_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-params_base-contains[`contains`] ¦ Return true if a matching key exists ¦xref:boost-urls-params_base-count[`count`] ¦ Return the number of matching keys ¦xref:boost-urls-params_base-empty[`empty`] ¦ Return true if there are no params ¦xref:boost-urls-params_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-params_base-find[`find`] ¦ Find a matching key ¦xref:boost-urls-params_base-find_last[`find_last`] ¦ Find a matching key ¦xref:boost-urls-params_base-size[`size`] ¦ Return the number of params |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description This base class is used by the library to provide common member functions for containers. This cannot be instantiated directly; Instead, use one of the containers or functions: * xref:boost-urls-params_ref[params_ref] * xref:boost-urls-params_view[params_view] * xref:boost-urls-params_encoded_ref[params_encoded_ref] * xref:boost-urls-params_encoded_view[params_encoded_view] [#boost-urls-params_base-iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::iterator A Bidirectional iterator to a query parameter === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class iterator; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-iterator-difference_type[`difference_type`] ¦ ¦xref:boost-urls-params_base-iterator-iterator_category[`iterator_category`] ¦ ¦xref:boost-urls-params_base-iterator-pointer[`pointer`] ¦ ¦xref:boost-urls-params_base-iterator-reference[`reference`] ¦ ¦xref:boost-urls-params_base-iterator-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-iterator-2constructor[`iterator`] [.small]#[constructor]# ¦ ¦xref:boost-urls-params_base-iterator-operator_not_eq[`operator!=`] ¦ ¦xref:boost-urls-params_base-iterator-operator_star[`operator*`] ¦ ¦xref:boost-urls-params_base-iterator-operator_inc[`operator++`] ¦ ¦xref:boost-urls-params_base-iterator-operator_dec[`operator--`] ¦ ¦xref:boost-urls-params_base-iterator-operator_ptr[`operator->`] ¦ ¦xref:boost-urls-params_base-iterator-operator_assign[`operator=`] ¦ ¦xref:boost-urls-params_base-iterator-operator_eq[`operator==`] ¦ |=== === Description Objects of this type allow iteration through the parameters in the query. Any percent-escapes in returned strings are decoded first. The values returned are read-only; changes to parameters must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced belong to the iterator and become invalidated when that particular iterator is incremented, decremented, or destroyed. [NOTE] The implementation may use temporary, recycled storage to store decoded strings. These iterators are meant to be used ephemerally. That is, for short durations such as within a function scope. Do not store iterators with static storage duration or as long-lived objects. [#boost-urls-params_base-iterator-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-params_base[params_base]::xref:boost-urls-params_base-value_type[value_type]; ---- [#boost-urls-params_base-iterator-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = xref:boost-urls-params_base[params_base]::xref:boost-urls-params_base-reference[reference]; ---- [#boost-urls-params_base-iterator-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::pointer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using pointer = xref:boost-urls-params_base-iterator-reference[reference]; ---- [#boost-urls-params_base-iterator-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::difference_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = xref:boost-urls-params_base[params_base]::xref:boost-urls-params_base-difference_type[difference_type]; ---- [#boost-urls-params_base-iterator-iterator_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::iterator_category === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using iterator_category = std::bidirectional_iterator_tag; ---- [#boost-urls-params_base-iterator-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::iterator === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_base-iterator-2constructor-0c[pass:[iterator]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_base-iterator-2constructor-00[pass:[iterator]](xref:boost-urls-params_base-iterator[iterator] const&) = default; ---- [#boost-urls-params_base-iterator-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_base-iterator[iterator]& operator=(xref:boost-urls-params_base-iterator[iterator] const&) noexcept = default; ---- [#boost-urls-params_base-iterator-operator_inc] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator++ === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator]& xref:boost-urls-params_base-iterator-operator_inc-01[pass:[operator++]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_base-iterator-operator_inc-09[pass:[operator++]](int) noexcept; ---- [#boost-urls-params_base-iterator-operator_dec] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator-- === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator]& xref:boost-urls-params_base-iterator-operator_dec-0c[pass:[operator--]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_base-iterator-operator_dec-08[pass:[operator--]](int) noexcept; ---- [#boost-urls-params_base-iterator-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator* === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator-reference[reference] operator*() const; ---- [#boost-urls-params_base-iterator-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator-> === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator-pointer[pointer] operator->() const = delete; ---- [#boost-urls-params_base-iterator-operator_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator== === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==(xref:boost-urls-params_base-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-params_base-iterator-operator_not_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator!= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=(xref:boost-urls-params_base-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-params_base-const_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::const_iterator A Bidirectional iterator to a query parameter === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_iterator = xref:boost-urls-params_base-iterator[iterator]; ---- === Description Objects of this type allow iteration through the parameters in the query. Any percent-escapes in returned strings are decoded first. The values returned are read-only; changes to parameters must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced belong to the iterator and become invalidated when that particular iterator is incremented, decremented, or destroyed. [NOTE] The implementation may use temporary, recycled storage to store decoded strings. These iterators are meant to be used ephemerally. That is, for short durations such as within a function scope. Do not store iterators with static storage duration or as long-lived objects. [#boost-urls-params_base-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::value_type The value type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-param[param]; ---- === Description Values of this type represent parameters whose strings retain unique ownership by making a copy. [,cpp] ---- params_view::value_type qp( *url_view( "?first=John&last=Doe" ).params().find( "first" ) ); ---- === See Also xref:boost-urls-param[param] . [#boost-urls-params_base-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = xref:boost-urls-param[param]; ---- === Description This is the type of value returned when iterators of the view are dereferenced. === See Also xref:boost-urls-param_view[param_view] . [#boost-urls-params_base-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::const_reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_reference = xref:boost-urls-param[param]; ---- === Description This is the type of value returned when iterators of the view are dereferenced. === See Also xref:boost-urls-param_view[param_view] . [#boost-urls-params_base-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::size_type An unsigned integer type to represent sizes. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using size_type = std::size_t; ---- [#boost-urls-params_base-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::difference_type A signed integer type used to represent differences. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-params_base-max_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::max_size Return the maximum number of characters possible === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t max_size() noexcept; ---- === Description This represents the largest number of characters that are possible in a path, not including any null terminator. === Throws nothing. [#boost-urls-params_base-buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::buffer Return the referenced character buffer. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] buffer() const noexcept; ---- === Description This function returns the character buffer referenced by the view. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).params().buffer() == "?first=John&last=Doe" ); ---- === Constant. === Throws nothing. [#boost-urls-params_base-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::empty Return true if there are no params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description [,cpp] ---- assert( ! url_view( "?key=value" ).params().empty() ); ---- === Constant. === Throws nothing. [#boost-urls-params_base-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::size Return the number of params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t size() const noexcept; ---- === Description [,cpp] ---- assert( url_view( "?key=value").params().size() == 1 ); ---- === Constant. === Throws nothing. [#boost-urls-params_base-begin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::begin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] begin() const noexcept; ---- === Description === Linear in the size of the first param. === Throws nothing. [#boost-urls-params_base-end] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::end Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] end() const noexcept; ---- === Description === Constant. === Throws nothing. [#boost-urls-params_base-contains] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::contains Return true if a matching key exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool contains( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key. The comparison is performed as if all escaped characters were decoded first. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).params().contains( "first" ) ); ---- === Linear in `this->buffer().size()`. === Throws nothing. === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_base-count] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::count Return the number of matching keys === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t count( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find the number of matches for the specified key. The comparison is performed as if all escaped characters were decoded first. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).params().count( "first" ) == 1 ); ---- === Linear in `this->buffer().size()`. === Throws nothing. === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_base-find] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::find Find a matching key === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_base-find-09[pass:[find]]( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_base-find-04[pass:[find]]( xref:boost-urls-params_base-iterator[iterator] from, core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( (*url_view( "?first=John&last=Doe" ).params().find( "First", ignore_case )).value == "John" ); ---- [,cpp] ---- return this->find( this->begin(), key, ic ); ---- === Linear in `this->buffer().size()`. === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. | *from* | The position to begin the search from. This can be `end()`. |=== [#boost-urls-params_base-find_last] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::find_last Find a matching key === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_base-find_last-04[pass:[find_last]]( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] xref:boost-urls-params_base-find_last-0d[pass:[find_last]]( xref:boost-urls-params_base-iterator[iterator] before, core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( (*url_view( "?first=John&last=Doe" ).params().find_last( "last" )).value == "Doe" ); ---- === Linear in `this->buffer().size()`. === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. | *before* | One past the position to begin the search from. This can be `end()`. |=== [#boost-urls-params_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::params_view A view representing query parameters in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class params_view : public xref:boost-urls-params_base[params_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-params_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-params_base-iterator[`iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-params_base-size_type[`size_type`] ¦ An unsigned integer type to represent sizes. ¦xref:boost-urls-params_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-params_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-params_base-contains[`contains`] ¦ Return true if a matching key exists ¦xref:boost-urls-params_base-count[`count`] ¦ Return the number of matching keys ¦xref:boost-urls-params_base-empty[`empty`] ¦ Return true if there are no params ¦xref:boost-urls-params_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-params_base-find[`find`] ¦ Find a matching key ¦xref:boost-urls-params_base-find_last[`find_last`] ¦ Find a matching key ¦xref:boost-urls-params_view-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-params_view-2constructor[`params_view`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-params_base-size[`size`] ¦ Return the number of params |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description Objects of this type are used to interpret the query parameters as a bidirectional view of key/value pairs. The view does not retain ownership of the elements and instead references the original character buffer. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- url_view u( "?first=John&last=Doe" ); params_view p = u.params(); ---- Percent escapes in strings returned when dereferencing iterators are automatically decoded. === Changes to the underlying character buffer can invalidate iterators which reference it. [#boost-urls-params_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_view[pass:[params_view]]::params_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view-2constructor-0d[pass:[params_view]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_view-2constructor-091[pass:[params_view]](xref:boost-urls-params_view[params_view] const& other) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view-2constructor-01[pass:[params_view]]( xref:boost-urls-params_view[params_view] const& other, xref:boost-urls-encoding_opts[encoding_opts] opt) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view-2constructor-09a[pass:[params_view]](core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view-2constructor-04[pass:[params_view]]( core::string_view s, xref:boost-urls-encoding_opts[encoding_opts] opt); ---- === Description Default-constructed params have zero elements. [,cpp] ---- params_view qp; ---- [,cpp] ---- return params_view( "" ); ---- === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid query parameter string. |=== === Parameters |=== | Name | Description | *s* | The string to parse. | *opt* | The options for decoding. If this parameter is omitted, `space_as_plus` is used. |=== [#boost-urls-params_view-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_view[pass:[params_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view[params_view]& operator=(xref:boost-urls-params_view[params_view] const&) = default; ---- === Description After assignment, both views reference the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant === Throws nothing [#boost-urls-implementation_defined] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::implementation_defined === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-absolute_uri_rule_t[`absolute_uri_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-authority_rule_t[`authority_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-ipv4_address_rule_t[`ipv4_address_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-ipv6_address_rule_t[`ipv6_address_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-named_arg[`named_arg`] ¦ ¦xref:boost-urls-implementation_defined-pct_encoded_rule_t[`pct_encoded_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-query_rule_t[`query_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-relative_ref_rule_t[`relative_ref_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-uri_reference_rule_t[`uri_reference_rule_t`] ¦ ¦xref:boost-urls-implementation_defined-uri_rule_t[`uri_rule_t`] ¦ |=== [#boost-urls-implementation_defined-query_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::query_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct query_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-query_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-query_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-query_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-query_rule_t[pass:[query_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-params_encoded_view[params_encoded_view]; ---- [#boost-urls-implementation_defined-query_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-query_rule_t[pass:[query_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-implementation_defined-named_arg] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::named_arg === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template using named_arg = detail::named_arg; ---- [#boost-urls-implementation_defined-absolute_uri_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::absolute_uri_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct absolute_uri_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-absolute_uri_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-absolute_uri_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-absolute_uri_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-absolute_uri_rule_t[pass:[absolute_uri_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-url_view[url_view]; ---- [#boost-urls-implementation_defined-absolute_uri_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-absolute_uri_rule_t[pass:[absolute_uri_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-implementation_defined-authority_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::authority_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct authority_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-authority_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-authority_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-authority_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-authority_rule_t[pass:[authority_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-authority_view[authority_view]; ---- [#boost-urls-implementation_defined-authority_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-authority_rule_t[pass:[authority_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-implementation_defined-ipv4_address_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::ipv4_address_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct ipv4_address_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-ipv4_address_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-ipv4_address_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-ipv4_address_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-ipv4_address_rule_t[pass:[ipv4_address_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-ipv4_address[ipv4_address]; ---- [#boost-urls-implementation_defined-ipv4_address_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-ipv4_address_rule_t[pass:[ipv4_address_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-implementation_defined-ipv6_address_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::ipv6_address_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct ipv6_address_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-ipv6_address_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-ipv6_address_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-ipv6_address_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-ipv6_address_rule_t[pass:[ipv6_address_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-ipv6_address[ipv6_address]; ---- [#boost-urls-implementation_defined-ipv6_address_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-ipv6_address_rule_t[pass:[ipv6_address_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-implementation_defined-pct_encoded_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::pct_encoded_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template struct pct_encoded_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-pct_encoded_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-pct_encoded_rule_t-parse[`parse`] ¦ ¦xref:boost-urls-implementation_defined-pct_encoded_rule_t-2constructor[`pct_encoded_rule_t`] [.small]#[constructor]# ¦ |=== [#boost-urls-implementation_defined-pct_encoded_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-pct_encoded_rule_t[pass:[pct_encoded_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-pct_string_view[pct_string_view]; ---- [#boost-urls-implementation_defined-pct_encoded_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-pct_encoded_rule_t[pass:[pct_encoded_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-implementation_defined-pct_encoded_rule_t-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-pct_encoded_rule_t[pass:[pct_encoded_rule_t]]::pct_encoded_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pct_encoded_rule_t(CharSet const& cs) noexcept; ---- [#boost-urls-implementation_defined-relative_ref_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::relative_ref_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct relative_ref_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-relative_ref_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-relative_ref_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-relative_ref_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-relative_ref_rule_t[pass:[relative_ref_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-url_view[url_view]; ---- [#boost-urls-implementation_defined-relative_ref_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-relative_ref_rule_t[pass:[relative_ref_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-implementation_defined-uri_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::uri_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct uri_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-uri_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-uri_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-uri_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-uri_rule_t[pass:[uri_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-url_view[url_view]; ---- [#boost-urls-implementation_defined-uri_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-uri_rule_t[pass:[uri_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const const* end) const noexcept; ---- [#boost-urls-implementation_defined-uri_reference_rule_t] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::uri_reference_rule_t === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- struct uri_reference_rule_t; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-uri_reference_rule_t-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-implementation_defined-uri_reference_rule_t-parse[`parse`] ¦ |=== [#boost-urls-implementation_defined-uri_reference_rule_t-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-uri_reference_rule_t[pass:[uri_reference_rule_t]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-url_view[url_view]; ---- [#boost-urls-implementation_defined-uri_reference_rule_t-parse] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-implementation_defined[pass:[implementation_defined]]::xref:boost-urls-implementation_defined-uri_reference_rule_t[pass:[uri_reference_rule_t]]::parse === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse( char const*& it, char const* end) const noexcept; ---- [#boost-urls-params_encoded_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::params_encoded_view A view representing query parameters in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class params_encoded_view : public xref:boost-urls-params_encoded_base[params_encoded_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_encoded_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-params_encoded_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-params_encoded_base-iterator[`iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_encoded_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-params_encoded_base-size_type[`size_type`] ¦ An unsigned integer type to represent sizes. ¦xref:boost-urls-params_encoded_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-params_encoded_base-buffer[`buffer`] ¦ Return the query corresponding to these params ¦xref:boost-urls-params_encoded_base-contains[`contains`] ¦ Return true if a matching key exists ¦xref:boost-urls-params_encoded_base-count[`count`] ¦ Return the number of matching keys ¦xref:boost-urls-params_encoded_base-empty[`empty`] ¦ Return true if there are no params ¦xref:boost-urls-params_encoded_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-params_encoded_base-find[`find`] ¦ Find a matching key ¦xref:boost-urls-params_encoded_base-find_last[`find_last`] ¦ Find a matching key ¦xref:boost-urls-params_encoded_view-2conversion[`operator params_view`] ¦ Conversion ¦xref:boost-urls-params_encoded_view-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-params_encoded_view-2constructor[`params_encoded_view`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-params_encoded_base-size[`size`] ¦ Return the number of params |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_view-08friend[`parse_query`] ¦ Parse a string and return an encoded params view |=== === Description Objects of this type are used to interpret the query parameters as a bidirectional view of key/value pairs. The view does not retain ownership of the elements and instead references the original character buffer. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- url_view u( "?first=John&last=Doe" ); params_encoded_view p = u.encoded_params(); ---- Strings produced when elements are returned have type xref:boost-urls-param_pct_view[param_pct_view] and represent encoded strings. Strings passed to member functions may contain percent escapes, and throw exceptions on invalid inputs. === Changes to the underlying character buffer can invalidate iterators which reference it. [#boost-urls-params_encoded_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_view[pass:[params_encoded_view]]::params_encoded_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_encoded_view-2constructor-02[pass:[params_encoded_view]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_encoded_view-2constructor-06[pass:[params_encoded_view]](xref:boost-urls-params_encoded_view[params_encoded_view] const& other) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_view-2constructor-0c[pass:[params_encoded_view]](core::string_view s); ---- === Description Default-constructed params have zero elements. [,cpp] ---- params_encoded_view qp; ---- [,cpp] ---- return params_encoded_view( "" ); ---- === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid query parameter string. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-params_encoded_view-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_view[pass:[params_encoded_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-params_encoded_view[params_encoded_view]& operator=(xref:boost-urls-params_encoded_view[params_encoded_view] const&) = default; ---- === Description After assignment, both views reference the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant === Throws nothing [#boost-urls-params_encoded_view-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_view[pass:[params_encoded_view]]::operator params_view Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator xref:boost-urls-params_view[params_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. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- params_view qp = parse_path( "/path/to/file.txt" ).value(); ---- [,cpp] ---- params_view( *this ).buffer().data() == this->buffer().data() ---- === Constant === Throws nothing [#boost-urls-params_encoded_view-08friend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_query Parse a string and return an encoded params view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend system::result parse_query(core::string_view s) noexcept; ---- === Description This function parses the string and returns the corresponding params object if the string is valid, otherwise returns an error. [,cpp] ---- query = *( pchar / "/" / "?" ) ---- === No-throw guarantee. === See Also xref:boost-urls-params_encoded_view-2constructor-02[params_encoded_view] . [#boost-urls-parse_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_query Parse a string and return an encoded params view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_query(core::string_view s) noexcept; ---- === Description This function parses the string and returns the corresponding params object if the string is valid, otherwise returns an error. [,cpp] ---- query = *( pchar / "/" / "?" ) ---- === No-throw guarantee. Parse a string and return an encoded params view This function parses the string and returns the corresponding params object if the string is valid, otherwise returns an error. [,cpp] ---- query = *( pchar / "/" / "?" ) ---- === No-throw guarantee. === Return Value A valid view on success, otherwise an error code. === Parameters |=== | Name | Description | *s* | The string to parse | *s* | The string to parse |=== === See Also xref:boost-urls-params_encoded_view[params_encoded_view] . xref:boost-urls-params_encoded_view[params_encoded_view] . [#boost-urls-url_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::url_base Common functionality for containers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class url_base : public xref:boost-urls-url_view_base[url_view_base]; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-authority[`authority`] ¦ Return the authority ¦xref:boost-urls-url_view_base-buffer[`buffer`] ¦ Return the url string ¦xref:boost-urls-url_base-c_str[`c_str`] ¦ Return the url as a null-terminated string ¦xref:boost-urls-url_base-capacity[`capacity`] ¦ Return the number of characters that can be stored without reallocating ¦xref:boost-urls-url_base-clear[`clear`] ¦ Clear the contents while preserving the capacity ¦xref:boost-urls-url_view_base-compare[`compare`] ¦ Return the result of comparing this with another url ¦xref:boost-urls-url_view_base-data[`data`] ¦ Return a pointer to the url's character buffer ¦xref:boost-urls-url_view_base-empty[`empty`] ¦ Return true if the url is empty ¦xref:boost-urls-url_view_base-encoded_authority[`encoded_authority`] ¦ Return the authority. ¦xref:boost-urls-url_view_base-encoded_fragment[`encoded_fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-encoded_host[`encoded_host`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_address[`encoded_host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_and_port[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost-urls-url_view_base-encoded_host_name[`encoded_host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-encoded_origin[`encoded_origin`] ¦ Return the origin ¦xref:boost-urls-url_view_base-encoded_params[`encoded_params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-encoded_password[`encoded_password`] ¦ Return the password ¦xref:boost-urls-url_view_base-encoded_path[`encoded_path`] ¦ Return the path ¦xref:boost-urls-url_view_base-encoded_query[`encoded_query`] ¦ Return the query ¦xref:boost-urls-url_view_base-encoded_resource[`encoded_resource`] ¦ Return the resource ¦xref:boost-urls-url_view_base-encoded_segments[`encoded_segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-encoded_target[`encoded_target`] ¦ Return the target ¦xref:boost-urls-url_view_base-encoded_user[`encoded_user`] ¦ Return the user ¦xref:boost-urls-url_view_base-encoded_userinfo[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-encoded_zone_id[`encoded_zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url_view_base-fragment[`fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-has_authority[`has_authority`] ¦ Return true if an authority is present ¦xref:boost-urls-url_view_base-has_fragment[`has_fragment`] ¦ Return true if a fragment is present ¦xref:boost-urls-url_view_base-has_password[`has_password`] ¦ Return true if a password is present ¦xref:boost-urls-url_view_base-has_port[`has_port`] ¦ Return true if a port is present ¦xref:boost-urls-url_view_base-has_query[`has_query`] ¦ Return true if a query is present ¦xref:boost-urls-url_view_base-has_scheme[`has_scheme`] ¦ Return true a scheme is present ¦xref:boost-urls-url_view_base-has_userinfo[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost-urls-url_view_base-host[`host`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_address[`host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_ipv4_address[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost-urls-url_view_base-host_ipv6_address[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost-urls-url_view_base-host_ipvfuture[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost-urls-url_view_base-host_name[`host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-host_type[`host_type`] ¦ Return the host type ¦xref:boost-urls-url_view_base-is_path_absolute[`is_path_absolute`] ¦ Return true if the path is absolute ¦xref:boost-urls-url_base-normalize[`normalize`] ¦ Normalize the URL components ¦xref:boost-urls-url_base-normalize_authority[`normalize_authority`] ¦ Normalize the URL authority ¦xref:boost-urls-url_base-normalize_fragment[`normalize_fragment`] ¦ Normalize the URL fragment ¦xref:boost-urls-url_base-normalize_path[`normalize_path`] ¦ Normalize the URL path ¦xref:boost-urls-url_base-normalize_query[`normalize_query`] ¦ Normalize the URL query ¦xref:boost-urls-url_base-normalize_scheme[`normalize_scheme`] ¦ Normalize the URL scheme ¦xref:boost-urls-url_view_base-2conversion[`operator core::string_view`] ¦ Return the URL as a core::string_view ¦xref:boost-urls-url_view_base-params[`params`] ¦ Return the query as a container of parameters xref:boost-urls-url_view_base-params-05[url_view_base::params] ¦xref:boost-urls-url_view_base-password[`password`] ¦ Return the password ¦xref:boost-urls-url_view_base-path[`path`] ¦ Return the path ¦xref:boost-urls-url_view_base-persist[`persist`] ¦ Return a shared, persistent copy of the url ¦xref:boost-urls-url_view_base-port[`port`] ¦ Return the port ¦xref:boost-urls-url_view_base-port_number[`port_number`] ¦ Return the port ¦xref:boost-urls-url_view_base-query[`query`] ¦ Return the query ¦xref:boost-urls-url_base-remove_authority[`remove_authority`] ¦ Remove the authority ¦xref:boost-urls-url_base-remove_fragment[`remove_fragment`] ¦ Remove the fragment ¦xref:boost-urls-url_base-remove_origin[`remove_origin`] ¦ Remove the origin component ¦xref:boost-urls-url_base-remove_password[`remove_password`] ¦ Remove the password ¦xref:boost-urls-url_base-remove_port[`remove_port`] ¦ Remove the port ¦xref:boost-urls-url_base-remove_query[`remove_query`] ¦ Remove the query ¦xref:boost-urls-url_base-remove_scheme[`remove_scheme`] ¦ Remove the scheme ¦xref:boost-urls-url_base-remove_userinfo[`remove_userinfo`] ¦ Remove the userinfo ¦xref:boost-urls-url_base-reserve[`reserve`] ¦ Adjust the capacity without changing the size ¦xref:boost-urls-url_base-resolve[`resolve`] ¦ Resolve a URL reference against this base URL ¦xref:boost-urls-url_view_base-scheme[`scheme`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-scheme_id[`scheme_id`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-segments[`segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_base-set_encoded_authority[`set_encoded_authority`] ¦ Set the authority ¦xref:boost-urls-url_base-set_encoded_fragment[`set_encoded_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_encoded_host[`set_encoded_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_encoded_host_address[`set_encoded_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_encoded_host_name[`set_encoded_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_encoded_params[`set_encoded_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_encoded_password[`set_encoded_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_encoded_path[`set_encoded_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_encoded_query[`set_encoded_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_encoded_user[`set_encoded_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_encoded_userinfo[`set_encoded_userinfo`] ¦ Set the userinfo. ¦xref:boost-urls-url_base-set_fragment[`set_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_host[`set_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_host_address[`set_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv4[`set_host_ipv4`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv6[`set_host_ipv6`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipvfuture[`set_host_ipvfuture`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_name[`set_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_params[`set_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_password[`set_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_path[`set_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_path_absolute[`set_path_absolute`] ¦ Set if the path is absolute ¦xref:boost-urls-url_base-set_port[`set_port`] ¦ Set the port ¦xref:boost-urls-url_base-set_port_number[`set_port_number`] ¦ Set the port ¦xref:boost-urls-url_base-set_query[`set_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_scheme[`set_scheme`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_scheme_id[`set_scheme_id`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_user[`set_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_userinfo[`set_userinfo`] ¦ Set the userinfo ¦xref:boost-urls-url_view_base-size[`size`] ¦ Return the number of characters in the url ¦xref:boost-urls-url_view_base-user[`user`] ¦ Return the user ¦xref:boost-urls-url_view_base-userinfo[`userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-zone_id[`zone_id`] ¦ Return the IPv6 Zone ID |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-08friend-02[`operator!=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-05[`operator<`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-0f[`operator<<`] ¦ Format the url to the output stream ¦xref:boost-urls-url_view_base-08friend-04[`operator<=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-07c[`operator==`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-073[`operator>`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-06[`operator>=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_base-08friend[`resolve`] ¦ Resolve a URL reference against a base URL |=== === Description This base class is used by the library to provide common member functions for containers. This cannot be instantiated directly; Instead, use one of the containers or functions: * xref:boost-urls-url[url] * xref:boost-urls-url_view[url_view] * xref:boost-urls-static_url[static_url] * xref:boost-urls-parse_absolute_uri[parse_absolute_uri] * xref:boost-urls-parse_origin_form[parse_origin_form] * xref:boost-urls-parse_relative_ref[parse_relative_ref] * xref:boost-urls-parse_uri[parse_uri] * xref:boost-urls-parse_uri_reference[parse_uri_reference] [#boost-urls-url_base-c_str] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::c_str Return the url as a null-terminated string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- char const* c_str() const noexcept; ---- === Description This function returns a pointer to a null terminated string representing the url, which may contain percent escapes. [,cpp] ---- assert( std::strlen( url( "http://www.example.com" ).c_str() ) == 22 ); ---- === Constant. === Throws nothing. [#boost-urls-url_base-capacity] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::capacity Return the number of characters that can be stored without reallocating === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t capacity() const noexcept; ---- === Description This does not include the null terminator, which is always present. === Constant. === Throws nothing. [#boost-urls-url_base-clear] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::clear Clear the contents while preserving the capacity === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void clear() noexcept; ---- === Description [,cpp] ---- this->empty() == true ---- === Constant. === No-throw guarantee. [#boost-urls-url_base-reserve] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::reserve Adjust the capacity without changing the size === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void reserve(std::size_t n); ---- === Description This function adjusts the capacity of the container in characters, without affecting the current contents. Has no effect if `n<= this->capacity()`. === Strong guarantee. Calls to allocate may throw. === Exceptions |=== | Name | Thrown on | `Allocation` | failure |=== === Parameters |=== | Name | Description | *n* | The capacity in characters, excluding any null terminator. |=== [#boost-urls-url_base-set_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_scheme Set the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_scheme(core::string_view s); ---- === Description The scheme is set to the specified string, which must contain a valid scheme without any trailing colon (':'). Note that schemes are case-insensitive, and the canonical form is lowercased. [,cpp] ---- assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid scheme. |=== === Parameters |=== | Name | Description | *s* | The scheme to set. |=== === See Also xref:boost-urls-url_base-remove_scheme[remove_scheme] . [#boost-urls-url_base-set_scheme_id] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_scheme_id Set the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_scheme_id(xref:boost-urls[urls]::xref:boost-urls-scheme[scheme] id); ---- === Description This function sets the scheme to the specified known xref:boost-urls-scheme[urls::scheme] id, which may not be xref:boost-urls-scheme-unknown[scheme::unknown] or else an exception is thrown. If the id is xref:boost-urls-scheme-none[scheme::none] , this function behaves as if xref:boost-urls-url_base-remove_scheme[remove_scheme] were called. [,cpp] ---- assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" ); ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | scheme is invalid. |=== === Parameters |=== | Name | Description | *id* | The scheme to set. |=== [#boost-urls-url_base-remove_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_scheme Remove the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_scheme(); ---- === Description This function removes the scheme if it is present. [,cpp] ---- assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" ); ---- [,cpp] ---- this->has_scheme() == false && this->scheme_id() == scheme::none ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === See Also xref:boost-urls-url_base-set_scheme[set_scheme] . [#boost-urls-url_base-set_encoded_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_authority Set the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_authority(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the authority to the specified string. The string may contain percent-escapes. [,cpp] ---- assert( url().set_encoded_authority( "My%20Computer" ).has_authority() ); ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) host = IP-literal / IPv4address / reg-name port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[ 3.2. Authority (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The authority string to set. |=== === See Also xref:boost-urls-url_base-remove_authority[remove_authority] . [#boost-urls-url_base-remove_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_authority Remove the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_authority(); ---- === Description This function removes the authority, which includes the userinfo, host, and a port if present. [,cpp] ---- assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" ); ---- [,cpp] ---- this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) host = IP-literal / IPv4address / reg-name port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[ 3.2. Authority (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_authority[set_encoded_authority] . [#boost-urls-url_base-set_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_userinfo Set the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_userinfo(core::string_view s); ---- === Description The userinfo is set to the given string, which may contain percent-escapes. Any special or reserved characters in the string are automatically percent-encoded. The effects on the user and password depend on the presence of a colon (':') in the string: * 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. In this case xref:boost-urls-url_view_base-has_password[has_password] returns true. Otherwise, * If there is no colon, the user is set to the string. The function xref:boost-urls-url_view_base-has_password[has_password] returns false. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_userinfo[remove_userinfo] , xref:boost-urls-url_base-set_encoded_userinfo[set_encoded_userinfo] . [#boost-urls-url_base-set_encoded_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_userinfo Set the userinfo. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_userinfo(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description The userinfo is set to the given string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The effects on the user and password depend on the presence of a colon (':') in the string: * 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. In this case xref:boost-urls-url_view_base-has_password[has_password] returns true. Otherwise, * If there is no colon, the user is set to the string. The function xref:boost-urls-url_view_base-has_password[has_password] returns false. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_userinfo[remove_userinfo] , xref:boost-urls-url_base-set_userinfo[set_userinfo] . [#boost-urls-url_base-remove_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_userinfo Remove the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_userinfo() noexcept; ---- === Description This function removes the userinfo if present, without removing any authority. [,cpp] ---- assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false ); ---- [,cpp] ---- this->has_userinfo() == false && this->encoded_userinfo().empty == true ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_userinfo[set_encoded_userinfo] , xref:boost-urls-url_base-set_userinfo[set_userinfo] . [#boost-urls-url_base-set_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_user Set the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_user(core::string_view s); ---- === Description This function sets the user part of the userinfo to the string. Any special or reserved characters in the string are automatically percent-encoded. [,cpp] ---- assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" ); ---- [,cpp] ---- this->has_authority() == true && this->has_userinfo() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_password[set_password] . [#boost-urls-url_base-set_encoded_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_user Set the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_user(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the user part of the userinfo the the string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" ); ---- [,cpp] ---- this->has_authority() == true && this->has_userinfo() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_password[set_password] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url_base-set_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_password Set the password. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_password(core::string_view s); ---- === Description This function sets the password in the userinfo to the string. Reserved characters in the string are percent-escaped in the result. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- [,cpp] ---- this->has_password() == true && this->password() == s ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. This string may contain any characters, including nulls. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url_base-set_encoded_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_password Set the password. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_password(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the password in the userinfo to the string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- [,cpp] ---- this->has_password() == true ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. This string may contain any characters, including nulls. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url_base-remove_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_password Remove the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_password() noexcept; ---- === Description This function removes the password from the userinfo if a password exists. If there is no userinfo or no authority, the call has no effect. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" ); ---- [,cpp] ---- this->has_password() == false && this->encoded_password().empty() == true ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_password[set_password] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url_base-set_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_host Set the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_host(core::string_view s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_encoded_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_host Set the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_host(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string. This string can contain percent escapes, or can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_host_address Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_host_address(core::string_view s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `s.size()`. === Strong guarantee. Calls to allocate may throw. [,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 / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_encoded_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_host_address Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_host_address(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string. This string can contain percent escapes, or can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,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 / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_host_ipv4] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_host_ipv4 Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_host_ipv4(xref:boost-urls-ipv4_address[ipv4_address] const& addr); ---- === Description The host is set to the specified IPv4 address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . [,cpp] ---- assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" ); ---- === Linear in `this->size()`. [,cpp] ---- this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4 ---- === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *addr* | The address to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_host_ipv6] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_host_ipv6 Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_host_ipv6(xref:boost-urls-ipv6_address[ipv6_address] const& addr); ---- === Description The host is set to the specified IPv6 address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . [,cpp] ---- assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6 ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *addr* | The address to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_host_ipvfuture] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_host_ipvfuture Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_host_ipvfuture(core::string_view s); ---- === Description The host is set to the specified IPvFuture string. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . [,cpp] ---- assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" ); ---- === Linear in `this->size() + s.size()`. [,cpp] ---- this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_host_name Set the host to a name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_host_name(core::string_view s); ---- === Description The host is set to the specified string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . [,cpp] ---- assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] . [#boost-urls-url_base-set_encoded_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_host_name Set the host to a name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_host_name(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description The host is set to the specified string, which may contain percent-escapes and can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . [,cpp] ---- assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url_base-set_port_number] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_port_number Set the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_port_number(std::uint16_t n); ---- === Description The port is set to the specified integer. [,cpp] ---- assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" ); ---- [,cpp] ---- this->has_authority() == true && this->has_port() == true && this->port_number() == n ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === Parameters |=== | Name | Description | *n* | The port number to set. |=== === See Also xref:boost-urls-url_base-remove_port[remove_port] , xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-url_base-set_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_port Set the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_port(core::string_view s); ---- === Description This port is set to the string, which must contain only digits or be empty. An empty port string is distinct from having no port. [,cpp] ---- assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" ); ---- [,cpp] ---- this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n) ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | does not contain a valid port. |=== === Parameters |=== | Name | Description | *s* | The port string to set. |=== === See Also xref:boost-urls-url_base-remove_port[remove_port] , xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-url_base-remove_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_port Remove the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_port() noexcept; ---- === Description If a port exists, it is removed. The rest of the authority is unchanged. [,cpp] ---- assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" ); ---- [,cpp] ---- this->has_port() == false && this->port_number() == 0 && this->port() == "" ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === See Also xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-url_base-set_path_absolute] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_path_absolute Set if the path is absolute === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool set_path_absolute(bool absolute); ---- === Description This function adjusts the path to make it absolute or not, depending on the parameter. [NOTE] If an authority is present, the path is always absolute. In this case, the function has no effect. [,cpp] ---- url u( "path/to/file.txt" ); assert( u.set_path_absolute( true ) ); assert( u.buffer() == "/path/to/file.txt" ); ---- [,cpp] ---- this->is_path_absolute() == true && this->encoded_path().front() == '/' ---- === Linear in `this->size()`. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Return Value true on success. === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-segments-04[segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path[set_path] . [#boost-urls-url_base-set_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_path Set the path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_path(core::string_view s); ---- === Description This function sets the path to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. [NOTE] The library may adjust the final result to ensure that no other parts of the url is semantically affected. [NOTE] This function does not encode '/' chars, which are unreserved for paths but reserved for path segments. If a path segment should include encoded '/'s to differentiate it from path separators, the functions xref:boost-urls-url_base-set_encoded_path[set_encoded_path] or xref:boost-urls-url_base-segments-04[segments] should be used instead. [,cpp] ---- url u( "http://www.example.com" ); u.set_path( "path/to/file.txt" ); assert( u.path() == "/path/to/file.txt" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-segments-04[segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url_base-set_encoded_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_path Set the path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_path(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the path to the string, which may contain percent-escapes and can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [NOTE] The library may adjust the final result to ensure that no other parts of the url is semantically affected. [,cpp] ---- url u( "http://www.example.com" ); u.set_encoded_path( "path/to/file.txt" ); assert( u.encoded_path() == "/path/to/file.txt" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-segments-04[segments] , xref:boost-urls-url_base-set_path[set_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url_base-segments] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::segments Return the path as a container of segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls[urls]::xref:boost-urls-segments_ref[segments_ref] xref:boost-urls-url_base-segments-0e[pass:[segments]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_view[segments_view] xref:boost-urls-url_base-segments-04[pass:[segments]]() const noexcept; ---- === Description This function returns a bidirectional view of segments over the path. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- url u( "http://example.com/path/to/file.txt" ); segments sv = u.segments(); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path[set_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url_base-encoded_segments] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::encoded_segments Return the path as a container of segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref] xref:boost-urls-url_base-encoded_segments-0e8[pass:[encoded_segments]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_view[segments_encoded_view] xref:boost-urls-url_base-encoded_segments-0e5[pass:[encoded_segments]]() const noexcept; ---- === Description This function returns a bidirectional view of segments over the path. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- url u( "http://example.com/path/to/file.txt" ); segments_encoded_ref sv = u.encoded_segments(); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path[set_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url_base-set_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_query Set the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_query(core::string_view s); ---- === Description This sets the query to the string, which can be empty. An empty query is distinct from having no query. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true && this->query() == s ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] . [#boost-urls-url_base-set_encoded_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_query Set the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_query(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This sets the query to the string, which may contain percent-escapes and can be empty. An empty query is distinct from having no query. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true && this->query() == decode_view( s ); ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url_base-params] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::params Return the query as a container of parameters === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref] xref:boost-urls-url_base-params-03[pass:[params]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view[params_view] xref:boost-urls-url_base-params-0b[pass:[params]]() const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref] xref:boost-urls-url_base-params-0c[pass:[params]](xref:boost-urls-encoding_opts[encoding_opts] opt) noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- params_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params(); ---- === Constant. === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Parameters |=== | Name | Description | *opt* | The options for decoding. If this parameter is omitted, the `space_as_plus` is used. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url_base-encoded_params] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::encoded_params Return the query as a container of parameters === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_view[params_encoded_view] xref:boost-urls-url_base-encoded_params-02[pass:[encoded_params]]() const noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_ref[params_encoded_ref] xref:boost-urls-url_base-encoded_params-06[pass:[encoded_params]]() noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. [,cpp] ---- params_encoded_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params(); ---- === Constant. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_params( std::initializer_list ps, xref:boost-urls-encoding_opts[encoding_opts] opts = = {}) noexcept; ---- === Description This sets the query params to the list of param_view, which can be empty. An empty list of params is distinct from having no params. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true ---- === Strong guarantee. Calls to allocate may throw. === Linear. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_params(std::initializer_list ps) noexcept; ---- === Description This sets the query params to the elements in the list, which may contain percent-escapes and can be empty. An empty list of params is distinct from having no query. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_params( {"id", "42"} ).encoded_query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true ---- === Linear. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Exceptions |=== | Name | Thrown on | `some` | element in `ps` contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *ps* | The params to set. |=== === See Also xref:boost-urls-url_base-set_params[set_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url_base-remove_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_query Remove the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_query() noexcept; ---- === Description If a query is present, it is removed. An empty query is distinct from having no query. [,cpp] ---- assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" ); ---- [,cpp] ---- this->has_query() == false && this->params().empty() ---- === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url_base-remove_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_fragment Remove the fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_fragment() noexcept; ---- === Description This function removes the fragment. An empty fragment is distinct from having no fragment. [,cpp] ---- assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" ); ---- [,cpp] ---- this->has_fragment() == false && this->encoded_fragment() == "" ---- === Constant. === Throws nothing. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_encoded_fragment[set_encoded_fragment] , xref:boost-urls-url_base-set_fragment[set_fragment] . [#boost-urls-url_base-set_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_fragment Set the fragment. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_fragment(core::string_view s); ---- === Description This function sets the fragment to the specified string, which may be empty. An empty fragment is distinct from having no fragment. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" ); ---- [,cpp] ---- this->has_fragment() == true && this->fragment() == s ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_encoded_fragment[set_encoded_fragment] . [#boost-urls-url_base-set_encoded_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::set_encoded_fragment Set the fragment. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& set_encoded_fragment(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the fragment to the specified string, which may contain percent-escapes and which may be empty. An empty fragment is distinct from having no fragment. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" ); ---- [,cpp] ---- this->has_fragment() == true && this->fragment() == decode_view( s ) ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_fragment[set_fragment] . [#boost-urls-url_base-remove_origin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::remove_origin Remove the origin component === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& remove_origin(); ---- === Description This function removes the origin, which consists of the scheme and authority. [,cpp] ---- assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" ); ---- [,cpp] ---- this->scheme_id() == scheme::none && this->has_authority() == false ---- === Linear in `this->size()`. === Throws nothing. [#boost-urls-url_base-normalize] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::normalize Normalize the URL components === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& normalize(); ---- === Description Applies Syntax-based normalization to all components of the URL. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_base-normalize_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::normalize_scheme Normalize the URL scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& normalize_scheme(); ---- === Description Applies Syntax-based normalization to the URL scheme. The scheme is normalized to lowercase. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_base-normalize_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::normalize_authority Normalize the URL authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& normalize_authority(); ---- === Description Applies Syntax-based normalization to the URL authority. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_base-normalize_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::normalize_path Normalize the URL path === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& normalize_path(); ---- === Description Applies Syntax-based normalization to the URL path. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. Redundant path-segments are removed. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_base-normalize_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::normalize_query Normalize the URL query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& normalize_query(); ---- === Description Applies Syntax-based normalization to the URL query. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_base-normalize_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::normalize_fragment Normalize the URL fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& normalize_fragment(); ---- === Description Applies Syntax-based normalization to the URL fragment. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_base-resolve] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::resolve Resolve a URL reference against this base URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result resolve(xref:boost-urls-url_view_base[url_view_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. This URL must satisfy the _URI_ grammar. In other words, it must contain a scheme. Relative references are only usable when in the context of a base absolute URI. This process of resolving a relative _reference_ within the context of a _base_ URI is defined in detail in rfc3986 (see below). The resolution process works as if the relative reference is appended to the base URI and the result is normalized. Given the input base URL, this function resolves the relative reference as if performing the following steps: * 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. If an error occurs, the contents of this URL are unspecified and a result with an `system::error_code` is returned. [NOTE] Abnormal hrefs where the number of ".." segments exceeds the number of segments in the base path are handled by including the unmatched ".." segments in the result, as described in link:https://www.rfc-editor.org/errata/eid4547[Errata 4547] . [,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" ); ---- [,cpp] ---- absolute-URI = scheme ":" hier-part [ "?" query ] ---- === Basic guarantee. Calls to allocate may throw. === 5. Reference Resolution (rfc3986) === Return Value An empty result upon success, otherwise an error code if `!base.has_scheme()`. === Parameters |=== | Name | Description | *ref* | The URL reference to resolve. |=== === See Also xref:boost-urls-url[url] , xref:boost-urls-url_view[url_view] . [#boost-urls-url_base-08friend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::resolve Resolve a URL reference against a base URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend system::result resolve( xref:boost-urls-url_view_base[url_view_base] const& base, xref:boost-urls-url_view_base[url_view_base] const& ref, xref:boost-urls-url_base[url_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. The base URL must satisfy the _URI_ grammar. In other words, it must contain a scheme. Relative references are only usable when in the context of a base absolute URI. This process of resolving a relative _reference_ within the context of a _base_ URI is defined in detail in rfc3986 (see below). The resolution process works as if the relative reference is appended to the base URI and the result is normalized. Given the input base URL, this function resolves the relative reference as if performing the following steps: * Ensure the base URI has at least a scheme * Normalizing the reference path * Merge base and reference paths * Normalize the merged path This function places the result of the resolution into `dest`, which can be any of the url containers that inherit from xref:boost-urls-url_base[url_base] . If an error occurs, the contents of `dest` is unspecified and `ec` is set. [NOTE] Abnormal hrefs where the number of ".." segments exceeds the number of segments in the base path are handled by including the unmatched ".." segments in the result, as described in link:https://www.rfc-editor.org/errata/eid4547[Errata 4547] . [,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" ); ---- [,cpp] ---- absolute-URI = scheme ":" hier-part [ "?" query ] ---- === Basic guarantee. Calls to allocate may throw. === 5. Reference Resolution (rfc3986) === See Also xref:boost-urls-url[url] , xref:boost-urls-url_view[url_view] . [#boost-urls-params_encoded_ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::params_encoded_ref A view representing query parameters in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class params_encoded_ref : public xref:boost-urls-params_encoded_base[params_encoded_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_encoded_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-params_encoded_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-params_encoded_base-iterator[`iterator`] ¦ A Bidirectional iterator to a query parameter ¦xref:boost-urls-params_encoded_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-params_encoded_base-size_type[`size_type`] ¦ An unsigned integer type to represent sizes. ¦xref:boost-urls-params_encoded_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_ref-append[`append`] ¦ Append params ¦xref:boost-urls-params_encoded_ref-assign[`assign`] ¦ Assign params ¦xref:boost-urls-params_encoded_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-params_encoded_base-buffer[`buffer`] ¦ Return the query corresponding to these params ¦xref:boost-urls-params_encoded_ref-clear[`clear`] ¦ Clear the contents of the container ¦xref:boost-urls-params_encoded_base-contains[`contains`] ¦ Return true if a matching key exists ¦xref:boost-urls-params_encoded_base-count[`count`] ¦ Return the number of matching keys ¦xref:boost-urls-params_encoded_base-empty[`empty`] ¦ Return true if there are no params ¦xref:boost-urls-params_encoded_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-params_encoded_ref-erase[`erase`] ¦ Erase params ¦xref:boost-urls-params_encoded_base-find[`find`] ¦ Find a matching key ¦xref:boost-urls-params_encoded_base-find_last[`find_last`] ¦ Find a matching key ¦xref:boost-urls-params_encoded_ref-insert[`insert`] ¦ Insert params ¦xref:boost-urls-params_encoded_ref-2conversion[`operator params_encoded_view`] ¦ Conversion ¦xref:boost-urls-params_encoded_ref-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-params_encoded_ref-2constructor[`params_encoded_ref`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-params_encoded_ref-replace[`replace`] ¦ Replace params ¦xref:boost-urls-params_encoded_ref-set[`set`] ¦ Set a value ¦xref:boost-urls-params_encoded_base-size[`size`] ¦ Return the number of params ¦xref:boost-urls-params_encoded_ref-unset[`unset`] ¦ Remove the value on an element ¦xref:boost-urls-params_encoded_ref-url[`url`] ¦ Return the referenced url |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-params_encoded_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description Objects of this type are used to interpret the query parameters as a bidirectional view of key value pairs. The view does not retain ownership of the elements and instead references the original url. The caller is responsible for ensuring that the lifetime of the referenced url extends until it is no longer referenced. The view is modifiable; calling non-const members causes changes to the referenced url. [,cpp] ---- url u( "?first=John&last=Doe" ); params_encoded_ref p = u.encoded_params(); ---- Strings produced when elements are returned have type xref:boost-urls-param_pct_view[param_pct_view] and represent encoded strings. Strings passed to member functions may contain percent escapes, and throw exceptions on invalid inputs. === Changes to the underlying character buffer can invalidate iterators which reference it. Modifications made through the container invalidate some iterators to the underlying character buffer: * xref:boost-urls-params_encoded_ref-append-07[append] : Only `end()`. * xref:boost-urls-params_encoded_ref-assign-00[assign] , xref:boost-urls-params_encoded_ref-clear[clear] , `operator=` : All params. * xref:boost-urls-params_encoded_ref-erase-08[erase] : Erased params and all params after (including `end()`). * xref:boost-urls-params_encoded_ref-insert-03[insert] : All params at or after the insertion point (including `end()`). * xref:boost-urls-params_encoded_ref-replace-0f[replace] , xref:boost-urls-params_encoded_ref-set-07[set] : Modified params and all params after (including `end()`). [#boost-urls-params_encoded_ref-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::params_encoded_ref Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr params_encoded_ref(xref:boost-urls-params_encoded_ref[params_encoded_ref] const& other) = default; ---- === Description After construction, both views reference the same url. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the url extends until it is no longer referenced. [,cpp] ---- &this->url() == &other.url(); ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The other view. |=== [#boost-urls-params_encoded_ref-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_ref[params_encoded_ref]& xref:boost-urls-params_encoded_ref-operator_assign-02[pass:[operator=]](xref:boost-urls-params_encoded_ref[params_encoded_ref] const& other); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_ref[params_encoded_ref]& xref:boost-urls-params_encoded_ref-operator_assign-03[pass:[operator=]](std::initializer_list init); ---- === Description The previous contents of this are replaced by the contents of `other. All iterators are invalidated. [NOTE] The strings referenced by `other` must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. === Exceptions |=== | Name | Thrown on | ``init`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *other* | The params to assign. | *init* | The list of params to assign. |=== [#boost-urls-params_encoded_ref-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::operator params_encoded_view Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator xref:boost-urls-params_encoded_view[params_encoded_view]() const noexcept; ---- === Description === Constant. === Throws nothing. [#boost-urls-params_encoded_ref-url] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::url Return the referenced url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& url() const noexcept; ---- === Description This function returns the url referenced by the view. [,cpp] ---- url u( "?key=value" ); assert( &u.encoded_params().url() == &u ); ---- [,cpp] ---- Throws nothing. ---- [#boost-urls-params_encoded_ref-clear] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::clear Clear the contents of the container === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void clear() noexcept; ---- === Description All iterators are invalidated. [,cpp] ---- this->url().remove_query(); ---- [,cpp] ---- this->empty() == true && this->url().has_query() == false ---- === Constant. === Throws nothing. [#boost-urls-params_encoded_ref-assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::assign Assign params === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- void xref:boost-urls-params_encoded_ref-assign-00[pass:[assign]](std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template void xref:boost-urls-params_encoded_ref-assign-07[pass:[assign]]( FwdIt first, FwdIt last); ---- === Description This function replaces the entire contents of the view with the params in the _initializer-list_ . All iterators are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- url u; u.encoded_params().assign({ { "first", "John" }, { "last", "Doe" } }); ---- === Linear in `init.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``init`` | contains an invalid percent-encoding. | `The` | range contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *init* | The list of params to assign. | *first,* | last The range of params to assign. |=== [#boost-urls-params_encoded_ref-append] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::append Append params === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-append-07[pass:[append]](xref:boost-urls-param_pct_view[param_pct_view] const& p); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-append-0e[pass:[append]](std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-append-08[pass:[append]]( FwdIt first, FwdIt last); ---- === Description This function appends a param to the view. The `end()` iterator is invalidated. [,cpp] ---- url u; u.encoded_params().append( { "first", "John" } ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``p`` | contains an invalid percent-encoding. | ``init`` | contains an invalid percent-encoding. | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the new element. === Parameters |=== | Name | Description | *p* | The param to append. | *init* | The list of params to append. | *first,* | last The range of params to append. |=== [#boost-urls-params_encoded_ref-insert] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::insert Insert params === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-insert-03[pass:[insert]]( xref:boost-urls-params_encoded_base-iterator[iterator] before, xref:boost-urls-param_pct_view[param_pct_view] const& p); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-insert-0b[pass:[insert]]( xref:boost-urls-params_encoded_base-iterator[iterator] before, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-insert-05[pass:[insert]]( xref:boost-urls-params_encoded_base-iterator[iterator] before, FwdIt first, FwdIt last); ---- === Description This function inserts a param before the specified position. All iterators that are equal to `before` or come after are invalidated. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``p`` | contains an invalid percent-encoding. | ``init`` | contains an invalid percent-encoding. | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the inserted element. === Parameters |=== | Name | Description | *before* | An iterator before which the param is inserted. This may be equal to `end()`. | *p* | The param to insert. | *init* | The list of params to insert. | *first,* | last The range of params to insert. |=== [#boost-urls-params_encoded_ref-erase] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::erase Erase params === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-erase-08[pass:[erase]](xref:boost-urls-params_encoded_base-iterator[iterator] pos) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-erase-0b[pass:[erase]]( xref:boost-urls-params_encoded_base-iterator[iterator] first, xref:boost-urls-params_encoded_base-iterator[iterator] last) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t xref:boost-urls-params_encoded_ref-erase-00[pass:[erase]]( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) noexcept; ---- === Description This function removes an element from the container. All iterators that are equal to `pos` or come after are invalidated. [,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" ); ---- === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Return Value An iterator to one past the removed element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *first,* | last The range of params to erase. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_encoded_ref-replace] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::replace Replace params === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-replace-0f[pass:[replace]]( xref:boost-urls-params_encoded_base-iterator[iterator] pos, xref:boost-urls-param_pct_view[param_pct_view] const& p); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-replace-08[pass:[replace]]( xref:boost-urls-params_encoded_base-iterator[iterator] from, xref:boost-urls-params_encoded_base-iterator[iterator] to, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-replace-06[pass:[replace]]( xref:boost-urls-params_encoded_base-iterator[iterator] from, xref:boost-urls-params_encoded_base-iterator[iterator] to, FwdIt first, FwdIt last); ---- === Description This function replaces the contents of the element at `pos` with the specified param. All iterators that are equal to `pos` or come after are invalidated. [NOTE] The strings passed in must not come from the element being replaced, or else the behavior is undefined. [,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" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``p`` | contains an invalid percent-encoding. | ``init`` | contains an invalid percent-encoding. | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *p* | The param to assign. | *from,to* | The range of params to replace. | *init* | The list of params to assign. | *first,* | last The range of params to assign. |=== [#boost-urls-params_encoded_ref-unset] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::unset Remove the value on an element === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] unset(xref:boost-urls-params_encoded_base-iterator[iterator] pos) noexcept; ---- === Description This function removes the value of an element at the specified position. After the call returns, `has_value` for the element is false. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?first=John&last=Doe" ); u.encoded_params().unset( u.encoded_params().begin() ); assert( u.encoded_query() == "first&last=Doe" ); ---- === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. |=== [#boost-urls-params_encoded_ref-set] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::set Set a value === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-set-0d[pass:[set]]( xref:boost-urls-params_encoded_base-iterator[iterator] pos, xref:boost-urls-pct_string_view[pct_string_view] value); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] xref:boost-urls-params_encoded_ref-set-07[pass:[set]]( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-pct_string_view[pct_string_view] value, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}); ---- === Description This function replaces the value of an element at the specified position. All iterators that are equal to `pos` or come after are invalidated. [NOTE] The string passed in must not come from the element being replaced, or else the behavior is undefined. [,cpp] ---- url u( "?id=42&id=69" ); u.encoded_params().set( u.encoded_params().begin(), "none" ); assert( u.encoded_query() == "id=none&id=69" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``value`` | contains an invalid percent-encoding. | ``key`` | or `value` contain an invalid percent-encoding. |=== === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *value* | The value to assign. The empty string still counts as a value. That is, `has_value` for the element is true. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-segments_encoded_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::segments_encoded_base Common functionality for containers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class segments_encoded_base; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_encoded_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-segments_encoded_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-segments_encoded_base-iterator[`iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_encoded_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-segments_encoded_base-size_type[`size_type`] ¦ An unsigned integer type used to represent size. ¦xref:boost-urls-segments_encoded_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-back[`back`] ¦ Return the last segment ¦xref:boost-urls-segments_encoded_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-segments_encoded_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-segments_encoded_base-empty[`empty`] ¦ Return true if there are no segments ¦xref:boost-urls-segments_encoded_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-segments_encoded_base-front[`front`] ¦ Return the first segment ¦xref:boost-urls-segments_encoded_base-is_absolute[`is_absolute`] ¦ Returns true if this references an absolute path. ¦xref:boost-urls-segments_encoded_base-size[`size`] ¦ Return the number of segments |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description This base class is used by the library to provide common member functions for containers. This cannot be instantiated directly; Instead, use one of the containers or functions: * xref:boost-urls-segments_ref[segments_ref] * xref:boost-urls-segments_view[segments_view] * xref:boost-urls-segments_encoded_ref[segments_encoded_ref] * xref:boost-urls-segments_encoded_view[segments_encoded_view] [#boost-urls-segments_encoded_base-iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::iterator A Bidirectional iterator to a path segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class iterator; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-iterator-difference_type[`difference_type`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-iterator_category[`iterator_category`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-pointer[`pointer`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-reference[`reference`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-iterator-2constructor[`iterator`] [.small]#[constructor]# ¦ ¦xref:boost-urls-segments_encoded_base-iterator-operator_not_eq[`operator!=`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-operator_star[`operator*`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-operator_inc[`operator++`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-operator_dec[`operator--`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-operator_ptr[`operator->`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-operator_assign[`operator=`] ¦ ¦xref:boost-urls-segments_encoded_base-iterator-operator_eq[`operator==`] ¦ |=== === Description Objects of this type allow iteration through the segments in the path. Strings returned by iterators may contain percent escapes. The values returned are read-only; changes to segments must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced refer to the underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced by any container or iterator. [#boost-urls-segments_encoded_base-iterator-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-segments_encoded_base[segments_encoded_base]::xref:boost-urls-segments_encoded_base-value_type[value_type]; ---- [#boost-urls-segments_encoded_base-iterator-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = xref:boost-urls-segments_encoded_base[segments_encoded_base]::xref:boost-urls-segments_encoded_base-reference[reference]; ---- [#boost-urls-segments_encoded_base-iterator-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::pointer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using pointer = xref:boost-urls-segments_encoded_base-iterator-reference[reference]; ---- [#boost-urls-segments_encoded_base-iterator-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::difference_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-segments_encoded_base-iterator-iterator_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::iterator_category === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using iterator_category = std::bidirectional_iterator_tag; ---- [#boost-urls-segments_encoded_base-iterator-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::iterator === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_encoded_base-iterator-2constructor-06[pass:[iterator]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_encoded_base-iterator-2constructor-02[pass:[iterator]](xref:boost-urls-segments_encoded_base-iterator[iterator] const&) = default; ---- [#boost-urls-segments_encoded_base-iterator-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_encoded_base-iterator[iterator]& operator=(xref:boost-urls-segments_encoded_base-iterator[iterator] const&) = default; ---- [#boost-urls-segments_encoded_base-iterator-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator* === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator-reference[reference] operator*() const noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator-> === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator-pointer[pointer] operator->() const noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_inc] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator++ === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator]& xref:boost-urls-segments_encoded_base-iterator-operator_inc-08[pass:[operator++]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_base-iterator-operator_inc-0e[pass:[operator++]](int) noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_dec] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator-- === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator]& xref:boost-urls-segments_encoded_base-iterator-operator_dec-00[pass:[operator--]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_base-iterator-operator_dec-05[pass:[operator--]](int) noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator== === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==(xref:boost-urls-segments_encoded_base-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_not_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator!= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=(xref:boost-urls-segments_encoded_base-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-segments_encoded_base-const_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::const_iterator A Bidirectional iterator to a path segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_iterator = xref:boost-urls-segments_encoded_base-iterator[iterator]; ---- === Description Objects of this type allow iteration through the segments in the path. Strings returned by iterators may contain percent escapes. The values returned are read-only; changes to segments must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced refer to the underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced by any container or iterator. [#boost-urls-segments_encoded_base-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::value_type The value type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = std::string; ---- === Description Values of this type represent a segment where unique ownership is retained by making a copy. [,cpp] ---- segments_encoded_base::value_type ps( url_view( "/path/to/file.txt" ).encoded_segments().back() ); ---- [#boost-urls-segments_encoded_base-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = xref:boost-urls-pct_string_view[pct_string_view]; ---- === Description This is the type of value returned when iterators of the view are dereferenced. [#boost-urls-segments_encoded_base-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::const_reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_reference = xref:boost-urls-pct_string_view[pct_string_view]; ---- === Description This is the type of value returned when iterators of the view are dereferenced. [#boost-urls-segments_encoded_base-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::size_type An unsigned integer type used to represent size. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using size_type = std::size_t; ---- [#boost-urls-segments_encoded_base-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::difference_type A signed integer type used to represent differences. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-segments_encoded_base-max_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::max_size Return the maximum number of characters possible === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t max_size() noexcept; ---- === Description This represents the largest number of characters that are possible in a path, not including any null terminator. === Throws nothing. [#boost-urls-segments_encoded_base-buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::buffer Return the referenced character buffer. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] buffer() const noexcept; ---- === Description This function returns the character buffer referenced by the view. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "/path/to/file.txt" ).encoded_segments().buffer() == "/path/to/file.txt" ); ---- === Constant. === Throws nothing. [#boost-urls-segments_encoded_base-is_absolute] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::is_absolute Returns true if this references an absolute path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_absolute() const noexcept; ---- === Description Absolute paths always start with a forward slash ('/'). [,cpp] ---- assert( url_view( "/path/to/file.txt" ).encoded_segments().is_absolute() == true ); ---- === Constant. === Throws nothing. [#boost-urls-segments_encoded_base-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::empty Return true if there are no segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description [,cpp] ---- assert( ! url_view( "/index.htm" ).encoded_segments().empty() ); ---- === Constant. === Throws nothing. [#boost-urls-segments_encoded_base-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::size Return the number of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t size() const noexcept; ---- === Description [,cpp] ---- assert( url_view( "/path/to/file.txt" ).encoded_segments().size() == 3 ); ---- === Constant. === Throws nothing. [#boost-urls-segments_encoded_base-front] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::front Return the first segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] front() const noexcept; ---- === Description This function returns a string with the first segment of the path without any leading or trailing '/' separators. The returned string may contain percent escapes. [,cpp] ---- this->empty() == false ---- [,cpp] ---- return *begin(); ---- [,cpp] ---- assert( url_view( "/path/to/file.txt" ).encoded_segments().front() == "path" ); ---- === Constant. === Throws nothing. [#boost-urls-segments_encoded_base-back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::back Return the last segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] back() const noexcept; ---- === Description This function returns a string with the last segment of the path without any leading or trailing '/' separators. The returned string may contain percent escapes. [,cpp] ---- this->empty() == false ---- [,cpp] ---- assert( url_view( "/path/to/file.txt" ).encoded_segments().back() == "file.txt" ); ---- [,cpp] ---- this->empty() == false ---- [,cpp] ---- return *--end(); ---- === Constant. === Throws nothing. [#boost-urls-segments_encoded_base-begin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::begin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] begin() const noexcept; ---- === Description === Linear in `this->front().size()` or constant if `this->empty()`. === Throws nothing. [#boost-urls-segments_encoded_base-end] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::end Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] end() const noexcept; ---- === Description === Constant. === Throws nothing. [#boost-urls-segments_encoded_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::segments_encoded_view A view representing path segments in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class segments_encoded_view : public xref:boost-urls-segments_encoded_base[segments_encoded_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_encoded_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-segments_encoded_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-segments_encoded_base-iterator[`iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_encoded_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-segments_encoded_base-size_type[`size_type`] ¦ An unsigned integer type used to represent size. ¦xref:boost-urls-segments_encoded_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-back[`back`] ¦ Return the last segment ¦xref:boost-urls-segments_encoded_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-segments_encoded_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-segments_encoded_base-empty[`empty`] ¦ Return true if there are no segments ¦xref:boost-urls-segments_encoded_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-segments_encoded_base-front[`front`] ¦ Return the first segment ¦xref:boost-urls-segments_encoded_base-is_absolute[`is_absolute`] ¦ Returns true if this references an absolute path. ¦xref:boost-urls-segments_encoded_view-2conversion[`operator segments_view`] ¦ Conversion ¦xref:boost-urls-segments_encoded_view-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-segments_encoded_view-2constructor[`segments_encoded_view`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-segments_encoded_base-size[`size`] ¦ Return the number of segments |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_view-08friend[`parse_path`] ¦ Parse a string and return an encoded segment view |=== === Description Objects of this type are used to interpret the path as a bidirectional view of segment strings. The view does not retain ownership of the elements and instead references the original character buffer. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- url_view u( "/path/to/file.txt" ); segments_encoded_view ps = u.encoded_segments(); assert( ps.buffer().data() == u.buffer().data() ); ---- Strings produced when elements are returned have type xref:boost-urls-param_pct_view[param_pct_view] and represent encoded strings. Strings passed to member functions may contain percent escapes, and throw exceptions on invalid inputs. === Changes to the underlying character buffer can invalidate iterators which reference it. === See Also xref:boost-urls-segments_view[segments_view] , xref:boost-urls-segments_encoded_ref[segments_encoded_ref] , xref:boost-urls-segments_ref[segments_ref] . [#boost-urls-segments_encoded_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_view[pass:[segments_encoded_view]]::segments_encoded_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_encoded_view-2constructor-0c[pass:[segments_encoded_view]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_encoded_view-2constructor-0b[pass:[segments_encoded_view]](xref:boost-urls-segments_encoded_view[segments_encoded_view] const&) noexcept = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_view-2constructor-02[pass:[segments_encoded_view]](core::string_view s); ---- === Description Default-constructed segments have zero elements. [,cpp] ---- segments_encoded_view ps; ---- [,cpp] ---- return segments_encoded_view( "" ); ---- === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid path. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-segments_encoded_view-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_view[pass:[segments_encoded_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_encoded_view[segments_encoded_view]& operator=(xref:boost-urls-segments_encoded_view[segments_encoded_view] const&) = default; ---- === Description After assignment, both views reference the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant === Throws nothing [#boost-urls-segments_encoded_view-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_view[pass:[segments_encoded_view]]::operator segments_view Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator xref:boost-urls-segments_view[segments_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. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- segments_view ps = parse_path( "/path/to/file.txt" ).value(); ---- [,cpp] ---- segments_view( *this ).buffer().data() == this->buffer().data() ---- === Constant === Throws nothing [#boost-urls-segments_encoded_view-08friend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_path Parse a string and return an encoded segment view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend system::result parse_path(core::string_view s) noexcept; ---- === Description This function parses the string and returns the corresponding path object if the string is valid, otherwise returns an error. [,cpp] ---- path = [ "/" ] segment *( "/" segment ) ---- === No-throw guarantee. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-segments_encoded_view-2constructor-0c[segments_encoded_view] . [#boost-urls-segments_encoded_ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::segments_encoded_ref A view representing path segments in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class segments_encoded_ref : public xref:boost-urls-segments_encoded_base[segments_encoded_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_encoded_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-segments_encoded_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-segments_encoded_base-iterator[`iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_encoded_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-segments_encoded_base-size_type[`size_type`] ¦ An unsigned integer type used to represent size. ¦xref:boost-urls-segments_encoded_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_ref-assign[`assign`] ¦ Assign segments ¦xref:boost-urls-segments_encoded_base-back[`back`] ¦ Return the last segment ¦xref:boost-urls-segments_encoded_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-segments_encoded_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-segments_encoded_ref-clear[`clear`] ¦ Clear the contents of the container ¦xref:boost-urls-segments_encoded_base-empty[`empty`] ¦ Return true if there are no segments ¦xref:boost-urls-segments_encoded_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-segments_encoded_ref-erase[`erase`] ¦ Erase segments ¦xref:boost-urls-segments_encoded_base-front[`front`] ¦ Return the first segment ¦xref:boost-urls-segments_encoded_ref-insert[`insert`] ¦ Insert segments ¦xref:boost-urls-segments_encoded_base-is_absolute[`is_absolute`] ¦ Returns true if this references an absolute path. ¦xref:boost-urls-segments_encoded_ref-2conversion[`operator segments_encoded_view`] ¦ Conversion ¦xref:boost-urls-segments_encoded_ref-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-segments_encoded_ref-pop_back[`pop_back`] ¦ Remove the last segment ¦xref:boost-urls-segments_encoded_ref-push_back[`push_back`] ¦ Append a segment ¦xref:boost-urls-segments_encoded_ref-replace[`replace`] ¦ Replace segments ¦xref:boost-urls-segments_encoded_ref-2constructor[`segments_encoded_ref`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-segments_encoded_base-size[`size`] ¦ Return the number of segments ¦xref:boost-urls-segments_encoded_ref-url[`url`] ¦ Return the referenced url |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_encoded_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description Objects of this type are used to interpret the path as a bidirectional view of segments, where each segment is a string which may contain percent-escapes. The view does not retain ownership of the elements and instead references the original character buffer. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. The view is modifiable; calling non-const members causes changes to the referenced url. [,cpp] ---- url u( "/path/to/file.txt" ); segments_encoded_ref ps = u.encoded_segments(); ---- The strings returned when iterators are dereferenced have type xref:boost-urls-pct_string_view[pct_string_view] and may contain percent-escapes. Reserved characters in inputs are automatically escaped. Escapes in inputs are preserved. Exceptions are thrown on invalid inputs. === Changes to the underlying character buffer can invalidate iterators which reference it. Modifications made through the container invalidate some or all iterators: * xref:boost-urls-segments_encoded_ref-push_back[push_back] : Only `end()`. * xref:boost-urls-segments_encoded_ref-assign-0e[assign] , xref:boost-urls-segments_encoded_ref-clear[clear] , xref:boost-urls-segments_encoded_ref-operator_assign-02c[operator=] : All elements. * xref:boost-urls-segments_encoded_ref-erase-006[erase] : Erased elements and all elements after (including `end()`). * xref:boost-urls-segments_encoded_ref-insert-04[insert] : All elements at or after the insertion point (including `end()`). * xref:boost-urls-segments_encoded_ref-replace-07[replace] : Modified elements and all elements after (including `end()`). === See Also xref:boost-urls-segments_encoded_view[segments_encoded_view] , xref:boost-urls-segments_view[segments_view] , xref:boost-urls-segments_ref[segments_ref] . [#boost-urls-segments_encoded_ref-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::segments_encoded_ref Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr segments_encoded_ref(xref:boost-urls-segments_encoded_ref[segments_encoded_ref] const& other) = default; ---- === Description After construction, both views reference the same url. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the url extends until it is no longer referenced. [,cpp] ---- &this->url() == &other.url(); ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The other view. |=== [#boost-urls-segments_encoded_ref-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref]& xref:boost-urls-segments_encoded_ref-operator_assign-02c[pass:[operator=]](xref:boost-urls-segments_encoded_ref[segments_encoded_ref] const& other); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref]& xref:boost-urls-segments_encoded_ref-operator_assign-02e[pass:[operator=]](xref:boost-urls-segments_encoded_view[segments_encoded_view] const& other); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref]& xref:boost-urls-segments_encoded_ref-operator_assign-08[pass:[operator=]](std::initializer_list init); ---- === Description The existing contents are replaced by a copy of the other segments. All iterators are invalidated. [NOTE] None of the character buffers referenced by `other` may overlap the buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. @{ === Exceptions |=== | Name | Thrown on | `The` | list contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *other* | The segments to assign. | *init* | The list of segments to assign. |=== [#boost-urls-segments_encoded_ref-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::operator segments_encoded_view Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator xref:boost-urls-segments_encoded_view[segments_encoded_view]() const noexcept; ---- === See Also xref:boost-urls-segments_encoded_view[segments_encoded_view] . [#boost-urls-segments_encoded_ref-url] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::url Return the referenced url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& url() const noexcept; ---- === Description This function returns the url referenced by the view. [,cpp] ---- url u( "/path/to/file.txt" ); assert( &u.encoded_segments().url() == &u ); ---- === Throws nothing. [#boost-urls-segments_encoded_ref-clear] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::clear Clear the contents of the container === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void clear() noexcept; ---- === Description All iterators are invalidated. [,cpp] ---- this->url().set_encoded_path( "" ); ---- [,cpp] ---- this->empty() == true ---- === Linear in `this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Throws nothing. [#boost-urls-segments_encoded_ref-assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::assign Assign segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- void xref:boost-urls-segments_encoded_ref-assign-0e[pass:[assign]](std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template void xref:boost-urls-segments_encoded_ref-assign-0b[pass:[assign]]( FwdIt first, FwdIt last); ---- === Description The existing contents are replaced by a copy of the contents of the initializer list. Reserved characters in the list are automatically escaped. Escapes in the list are preserved. All iterators are invalidated. [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. [,cpp] ---- url u; u.segments().assign( {"path", "to", "file.txt"} ); ---- === Linear in `init.size() + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | list contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *init* | The list of segments to assign. | *first,* | last The range of segments to assign. |=== [#boost-urls-segments_encoded_ref-insert] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::insert Insert segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-insert-04[pass:[insert]]( xref:boost-urls-segments_encoded_base-iterator[iterator] before, xref:boost-urls-pct_string_view[pct_string_view] s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-insert-0d[pass:[insert]]( xref:boost-urls-segments_encoded_base-iterator[iterator] before, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-insert-07[pass:[insert]]( xref:boost-urls-segments_encoded_base-iterator[iterator] before, FwdIt first, FwdIt last); ---- === Description This function inserts a segment before the specified position. Reserved characters in the segment are automatically escaped. Escapes in the segment are preserved. All iterators that are equal to `before` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | segment contains an invalid percent-encoding. |=== === Return Value An iterator to the inserted segment. === Parameters |=== | Name | Description | *before* | An iterator before which the segment is inserted. This may be equal to `end()`. | *s* | The segment to insert. | *init* | The list of segments to insert. | *first,* | last The range of segments to insert. |=== [#boost-urls-segments_encoded_ref-erase] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::erase Erase segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-erase-006[pass:[erase]](xref:boost-urls-segments_encoded_base-iterator[iterator] pos) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-erase-00a[pass:[erase]]( xref:boost-urls-segments_encoded_base-iterator[iterator] first, xref:boost-urls-segments_encoded_base-iterator[iterator] last) noexcept; ---- === Description This function removes a segment. All iterators that are equal to `pos` or come after are invalidated. === Linear in `this->url().encoded_resource().size()`. === Throws nothing. === Return Value An iterator to one past the removed segment. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *first,* | last The range of segments to erase. |=== [#boost-urls-segments_encoded_ref-replace] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::replace Replace segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-replace-07[pass:[replace]]( xref:boost-urls-segments_encoded_base-iterator[iterator] pos, xref:boost-urls-pct_string_view[pct_string_view] s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-replace-06[pass:[replace]]( xref:boost-urls-segments_encoded_base-iterator[iterator] from, xref:boost-urls-segments_encoded_base-iterator[iterator] to, xref:boost-urls-pct_string_view[pct_string_view] s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-replace-08[pass:[replace]]( xref:boost-urls-segments_encoded_base-iterator[iterator] from, xref:boost-urls-segments_encoded_base-iterator[iterator] to, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_encoded_base-iterator[iterator] xref:boost-urls-segments_encoded_ref-replace-0f[pass:[replace]]( xref:boost-urls-segments_encoded_base-iterator[iterator] from, xref:boost-urls-segments_encoded_base-iterator[iterator] to, FwdIt first, FwdIt last); ---- === Description This function replaces the segment at the specified position. Reserved characters in the string are automatically escaped. Escapes in the string are preserved. All iterators that are equal to `pos` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent-encoding. |=== === Return Value An iterator to the replaced segment. === Parameters |=== | Name | Description | *pos* | An iterator to the segment. | *s* | The string to assign. | *from,* | to The range of segments to replace. | *init* | The list of segments to assign. | *first,* | last The range of segments to assign. |=== [#boost-urls-segments_encoded_ref-push_back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::push_back Append a segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void push_back(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function appends a segment to the end of the path. Reserved characters in the string are automatically escaped. Escapes in the string are preserved. All end iterators are invalidated. [,cpp] ---- this->back() == s ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The segment to append. |=== [#boost-urls-segments_encoded_ref-pop_back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::pop_back Remove the last segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void pop_back() noexcept; ---- === Description This function removes the last segment from the container. Iterators to the last segment as well as all end iterators are invalidated. [,cpp] ---- not this->empty() ---- === Throws nothing. [#boost-urls-segments_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::segments_base Common functionality for containers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class segments_base; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-segments_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-segments_base-iterator[`iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-segments_base-size_type[`size_type`] ¦ An unsigned integer type used to represent size. ¦xref:boost-urls-segments_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-back[`back`] ¦ Return the last segment ¦xref:boost-urls-segments_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-segments_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-segments_base-empty[`empty`] ¦ Return true if there are no segments ¦xref:boost-urls-segments_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-segments_base-front[`front`] ¦ Return the first segment ¦xref:boost-urls-segments_base-is_absolute[`is_absolute`] ¦ Returns true if this references an absolute path. ¦xref:boost-urls-segments_base-size[`size`] ¦ Return the number of segments |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description This base class is used by the library to provide common member functions for containers. This cannot be instantiated directly; Instead, use one of the containers or functions: * xref:boost-urls-segments_ref[segments_ref] * xref:boost-urls-segments_view[segments_view] * xref:boost-urls-segments_encoded_ref[segments_encoded_ref] * xref:boost-urls-segments_encoded_view[segments_encoded_view] [#boost-urls-segments_base-iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::iterator A Bidirectional iterator to a path segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class iterator; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-iterator-difference_type[`difference_type`] ¦ ¦xref:boost-urls-segments_base-iterator-iterator_category[`iterator_category`] ¦ ¦xref:boost-urls-segments_base-iterator-pointer[`pointer`] ¦ ¦xref:boost-urls-segments_base-iterator-reference[`reference`] ¦ ¦xref:boost-urls-segments_base-iterator-value_type[`value_type`] ¦ |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-iterator-2constructor[`iterator`] [.small]#[constructor]# ¦ ¦xref:boost-urls-segments_base-iterator-operator_not_eq[`operator!=`] ¦ ¦xref:boost-urls-segments_base-iterator-operator_star[`operator*`] ¦ ¦xref:boost-urls-segments_base-iterator-operator_inc[`operator++`] ¦ ¦xref:boost-urls-segments_base-iterator-operator_dec[`operator--`] ¦ ¦xref:boost-urls-segments_base-iterator-operator_ptr[`operator->`] ¦ ¦xref:boost-urls-segments_base-iterator-operator_assign[`operator=`] ¦ ¦xref:boost-urls-segments_base-iterator-operator_eq[`operator==`] ¦ |=== === Description Objects of this type allow iteration through the segments in the path. Any percent-escapes in returned strings are decoded first. The values returned are read-only; changes to segments must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced belong to the iterator and become invalidated when that particular iterator is incremented, decremented, or destroyed. [#boost-urls-segments_base-iterator-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::value_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = xref:boost-urls-segments_base[segments_base]::xref:boost-urls-segments_base-value_type[value_type]; ---- [#boost-urls-segments_base-iterator-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = xref:boost-urls-segments_base[segments_base]::xref:boost-urls-segments_base-reference[reference]; ---- [#boost-urls-segments_base-iterator-pointer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::pointer === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using pointer = xref:boost-urls-segments_base-iterator-reference[reference]; ---- [#boost-urls-segments_base-iterator-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::difference_type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = xref:boost-urls-segments_base[segments_base]::xref:boost-urls-segments_base-difference_type[difference_type]; ---- [#boost-urls-segments_base-iterator-iterator_category] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::iterator_category === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using iterator_category = std::bidirectional_iterator_tag; ---- [#boost-urls-segments_base-iterator-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::iterator === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_base-iterator-2constructor-0a[pass:[iterator]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_base-iterator-2constructor-00[pass:[iterator]](xref:boost-urls-segments_base-iterator[iterator] const&) = default; ---- [#boost-urls-segments_base-iterator-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_base-iterator[iterator]& operator=(xref:boost-urls-segments_base-iterator[iterator] const&) noexcept = default; ---- [#boost-urls-segments_base-iterator-operator_star] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator* === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator-reference[reference] operator*() const; ---- [#boost-urls-segments_base-iterator-operator_ptr] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator-> === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator-pointer[pointer] operator->() const = delete; ---- [#boost-urls-segments_base-iterator-operator_inc] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator++ === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator]& xref:boost-urls-segments_base-iterator-operator_inc-08[pass:[operator++]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_base-iterator-operator_inc-07[pass:[operator++]](int) noexcept; ---- [#boost-urls-segments_base-iterator-operator_dec] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator-- === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator]& xref:boost-urls-segments_base-iterator-operator_dec-0f[pass:[operator--]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_base-iterator-operator_dec-0d[pass:[operator--]](int) noexcept; ---- [#boost-urls-segments_base-iterator-operator_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator== === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==(xref:boost-urls-segments_base-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-segments_base-iterator-operator_not_eq] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator!= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=(xref:boost-urls-segments_base-iterator[iterator] const& other) const noexcept; ---- [#boost-urls-segments_base-const_iterator] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::const_iterator A Bidirectional iterator to a path segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_iterator = xref:boost-urls-segments_base-iterator[iterator]; ---- === Description Objects of this type allow iteration through the segments in the path. Any percent-escapes in returned strings are decoded first. The values returned are read-only; changes to segments must be made through the container instead, if the container supports modification. The strings produced when iterators are dereferenced belong to the iterator and become invalidated when that particular iterator is incremented, decremented, or destroyed. [#boost-urls-segments_base-value_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::value_type The value type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using value_type = std::string; ---- === Description Values of this type represent a segment where unique ownership is retained by making a copy. [,cpp] ---- segments_base::value_type ps( url_view( "/path/to/file.txt" ).segments().back() ); ---- [#boost-urls-segments_base-reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using reference = std::string; ---- === Description This is the type of value returned when iterators of the view are dereferenced. [#boost-urls-segments_base-const_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::const_reference The reference type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using const_reference = std::string; ---- === Description This is the type of value returned when iterators of the view are dereferenced. [#boost-urls-segments_base-size_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::size_type An unsigned integer type used to represent size. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using size_type = std::size_t; ---- [#boost-urls-segments_base-difference_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::difference_type A signed integer type used to represent differences. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- [#boost-urls-segments_base-max_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::max_size Return the maximum number of characters possible === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t max_size() noexcept; ---- === Description This represents the largest number of characters that are possible in a path, not including any null terminator. === Throws nothing. [#boost-urls-segments_base-buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::buffer Return the referenced character buffer. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] buffer() const noexcept; ---- === Description This function returns the character buffer referenced by the view. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "/path/to/file.txt" ).segments().buffer() == "/path/to/file.txt" ); ---- === Constant. === Throws nothing. [#boost-urls-segments_base-is_absolute] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::is_absolute Returns true if this references an absolute path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_absolute() const noexcept; ---- === Description Absolute paths always start with a forward slash ('/'). [,cpp] ---- assert( url_view( "/path/to/file.txt" ).segments().is_absolute() == true ); ---- === Constant. === Throws nothing. [#boost-urls-segments_base-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::empty Return true if there are no segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description [,cpp] ---- assert( ! url_view( "/index.htm" ).segments().empty() ); ---- === Constant. === Throws nothing. [#boost-urls-segments_base-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::size Return the number of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t size() const noexcept; ---- === Description [,cpp] ---- assert( url_view( "/path/to/file.txt" ).segments().size() == 3 ); ---- === Constant. === Throws nothing. [#boost-urls-segments_base-front] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::front Return the first segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,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 '/' separators. Any percent-escapes in the string are decoded first. [,cpp] ---- this->empty() == false ---- [,cpp] ---- return *begin(); ---- [,cpp] ---- assert( url_view( "/path/to/file.txt" ).segments().front() == "path" ); ---- === Linear in `this->front().size()`. === Calls to allocate may throw. [#boost-urls-segments_base-back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::back Return the last segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::string back() const noexcept; ---- === Description [,cpp] ---- this->empty() == false ---- [,cpp] ---- assert( url_view( "/path/to/file.txt" ).segments().back() == "file.txt" ); ---- [,cpp] ---- this->empty() == false ---- [,cpp] ---- return *--end(); ---- === Linear in `this->back().size()`. === Calls to allocate may throw. [#boost-urls-segments_base-begin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::begin Return an iterator to the beginning === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] begin() const noexcept; ---- === Description === Linear in `this->front().size()` or constant if `this->empty()`. === Throws nothing. [#boost-urls-segments_base-end] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::end Return an iterator to the end === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] end() const noexcept; ---- === Description === Constant. === Throws nothing. [#boost-urls-segments_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::segments_view A view representing path segments in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class segments_view : public xref:boost-urls-segments_base[segments_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-segments_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-segments_base-iterator[`iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-segments_base-size_type[`size_type`] ¦ An unsigned integer type used to represent size. ¦xref:boost-urls-segments_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-back[`back`] ¦ Return the last segment ¦xref:boost-urls-segments_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-segments_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-segments_base-empty[`empty`] ¦ Return true if there are no segments ¦xref:boost-urls-segments_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-segments_base-front[`front`] ¦ Return the first segment ¦xref:boost-urls-segments_base-is_absolute[`is_absolute`] ¦ Returns true if this references an absolute path. ¦xref:boost-urls-segments_view-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-segments_view-2constructor[`segments_view`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-segments_base-size[`size`] ¦ Return the number of segments |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description Objects of this type are used to interpret the path as a bidirectional view of segment strings. The view does not retain ownership of the elements and instead references the original character buffer. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,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. === Changes to the underlying character buffer can invalidate iterators which reference it. === See Also xref:boost-urls-segments_encoded_view[segments_encoded_view] , xref:boost-urls-segments_encoded_ref[segments_encoded_ref] , xref:boost-urls-segments_ref[segments_ref] . [#boost-urls-segments_view-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_view[pass:[segments_view]]::segments_view Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_view-2constructor-0c[pass:[segments_view]]() = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_view-2constructor-0d[pass:[segments_view]](xref:boost-urls-segments_view[segments_view] const& other) = default; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_view-2constructor-0e[pass:[segments_view]](core::string_view s); ---- === Description Default-constructed segments have zero elements. [,cpp] ---- segments_view ps; ---- [,cpp] ---- return segments_view( "" ); ---- === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid path. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-segments_view-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_view[pass:[segments_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-segments_view[segments_view]& operator=(xref:boost-urls-segments_view[segments_view] const& other) = default; ---- === Description After assignment, both views reference the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant === Throws nothing [#boost-urls-segments_ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::segments_ref A view representing path segments in a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class segments_ref : public xref:boost-urls-segments_base[segments_base]; ---- === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-const_iterator[`const_iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_base-const_reference[`const_reference`] ¦ The reference type ¦xref:boost-urls-segments_base-difference_type[`difference_type`] ¦ A signed integer type used to represent differences. ¦xref:boost-urls-segments_base-iterator[`iterator`] ¦ A Bidirectional iterator to a path segment ¦xref:boost-urls-segments_base-reference[`reference`] ¦ The reference type ¦xref:boost-urls-segments_base-size_type[`size_type`] ¦ An unsigned integer type used to represent size. ¦xref:boost-urls-segments_base-value_type[`value_type`] ¦ The value type |=== === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_ref-assign[`assign`] ¦ Assign segments ¦xref:boost-urls-segments_base-back[`back`] ¦ Return the last segment ¦xref:boost-urls-segments_base-begin[`begin`] ¦ Return an iterator to the beginning ¦xref:boost-urls-segments_base-buffer[`buffer`] ¦ Return the referenced character buffer. ¦xref:boost-urls-segments_ref-clear[`clear`] ¦ Clear the contents of the container ¦xref:boost-urls-segments_base-empty[`empty`] ¦ Return true if there are no segments ¦xref:boost-urls-segments_base-end[`end`] ¦ Return an iterator to the end ¦xref:boost-urls-segments_ref-erase[`erase`] ¦ Erase segments ¦xref:boost-urls-segments_base-front[`front`] ¦ Return the first segment ¦xref:boost-urls-segments_ref-insert[`insert`] ¦ Insert segments ¦xref:boost-urls-segments_base-is_absolute[`is_absolute`] ¦ Returns true if this references an absolute path. ¦xref:boost-urls-segments_ref-2conversion[`operator segments_view`] ¦ Conversion ¦xref:boost-urls-segments_ref-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-segments_ref-pop_back[`pop_back`] ¦ Remove the last segment ¦xref:boost-urls-segments_ref-push_back[`push_back`] ¦ Append a segment ¦xref:boost-urls-segments_ref-replace[`replace`] ¦ Replace segments ¦xref:boost-urls-segments_ref-2constructor[`segments_ref`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-segments_base-size[`size`] ¦ Return the number of segments ¦xref:boost-urls-segments_ref-url[`url`] ¦ Return the referenced url |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-segments_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Description Objects of this type are used to interpret the path as a bidirectional view of segments, where each segment is a string with percent escapes automatically decoded. The view does not retain ownership of the elements and instead references the original character buffer. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. The view is modifiable; calling non-const members causes changes to the referenced url. [,cpp] ---- url u( "/path/to/file.txt" ); segments_ref ps = u.segments(); ---- Percent escapes in strings returned when dereferencing iterators are automatically decoded. Reserved characters in strings supplied to modifier functions are automatically percent-escaped. === Changes to the underlying character buffer can invalidate iterators which reference it. Modifications made through the container invalidate some or all iterators: * xref:boost-urls-segments_ref-push_back[push_back] : Only `end()`. * xref:boost-urls-segments_ref-assign-08[assign] , xref:boost-urls-segments_ref-clear[clear] , xref:boost-urls-segments_ref-operator_assign-0d[operator=] : All elements. * xref:boost-urls-segments_ref-erase-0af2[erase] : Erased elements and all elements after (including `end()`). * xref:boost-urls-segments_ref-insert-05[insert] : All elements at or after the insertion point (including `end()`). * xref:boost-urls-segments_ref-replace-05[replace] : Modified elements and all elements after (including `end()`). === See Also xref:boost-urls-segments_encoded_ref[segments_encoded_ref] , xref:boost-urls-segments_encoded_view[segments_encoded_view] , xref:boost-urls-segments_view[segments_view] . [#boost-urls-segments_ref-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::segments_ref Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr segments_ref(xref:boost-urls-segments_ref[segments_ref] const& other) = default; ---- === Description After construction, both views reference the same url. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the url extends until it is no longer referenced. [,cpp] ---- &this->url() == &other.url(); ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The other view. |=== [#boost-urls-segments_ref-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_ref[segments_ref]& xref:boost-urls-segments_ref-operator_assign-0d[pass:[operator=]](xref:boost-urls-segments_ref[segments_ref] const& other); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_ref[segments_ref]& xref:boost-urls-segments_ref-operator_assign-08[pass:[operator=]](xref:boost-urls-segments_view[segments_view] const& other); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_ref[segments_ref]& xref:boost-urls-segments_ref-operator_assign-0f[pass:[operator=]](std::initializer_list init); ---- === Description The existing contents are replaced by a copy of the other segments. All iterators are invalidated. [NOTE] None of the character buffers referenced by `other` may overlap the buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. @{ === Parameters |=== | Name | Description | *other* | The segments to assign. | *init* | The list of segments to assign. |=== [#boost-urls-segments_ref-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::operator segments_view Conversion === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator xref:boost-urls-segments_view[segments_view]() const noexcept; ---- === See Also xref:boost-urls-segments_view[segments_view] . [#boost-urls-segments_ref-url] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::url Return the referenced url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_base[url_base]& url() const noexcept; ---- === Description This function returns the url referenced by the view. [,cpp] ---- url u( "/path/to/file.txt" ); assert( &u.segments().url() == &u ); ---- === Throws nothing. [#boost-urls-segments_ref-clear] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::clear Clear the contents of the container === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void clear() noexcept; ---- === Description All iterators are invalidated. [,cpp] ---- this->url().set_encoded_path( "" ); ---- [,cpp] ---- this->empty() == true ---- === Linear in `this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Throws nothing. [#boost-urls-segments_ref-assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::assign Assign segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- void xref:boost-urls-segments_ref-assign-08[pass:[assign]](std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template void xref:boost-urls-segments_ref-assign-0d[pass:[assign]]( FwdIt first, FwdIt last); ---- === Description The existing contents are replaced by a copy of the contents of the initializer list. Reserved characters in the list are automatically escaped. All iterators are invalidated. [NOTE] None of the character buffers referenced by `init` may overlap the character buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- url u; u.segments().assign( { "path", "to", "file.txt" } ); ---- === Linear in `init.size() + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *init* | The list of segments to assign. | *first,* | last The range of segments to assign. |=== [#boost-urls-segments_ref-insert] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::insert Insert segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-insert-05[pass:[insert]]( xref:boost-urls-segments_base-iterator[iterator] before, core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-insert-09[pass:[insert]]( xref:boost-urls-segments_base-iterator[iterator] before, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-insert-07[pass:[insert]]( xref:boost-urls-segments_base-iterator[iterator] before, FwdIt first, FwdIt last); ---- === Description This function inserts a segment before the specified position. Reserved characters in the segment are automatically escaped. All iterators that are equal to `before` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the inserted segment. === Parameters |=== | Name | Description | *before* | An iterator before which the segment is inserted. This may be equal to `end()`. | *s* | The segment to insert. | *init* | The list of segments to insert. | *first,* | last The range of segments to insert. |=== [#boost-urls-segments_ref-erase] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::erase Erase segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-erase-0af2[pass:[erase]](xref:boost-urls-segments_base-iterator[iterator] pos) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-erase-0af5[pass:[erase]]( xref:boost-urls-segments_base-iterator[iterator] first, xref:boost-urls-segments_base-iterator[iterator] last) noexcept; ---- === Description This function removes a segment. All iterators that are equal to `pos` or come after are invalidated. === Linear in `this->url().encoded_resource().size()`. === Throws nothing. === Return Value An iterator to one past the removed segment. === Parameters |=== | Name | Description | *pos* | An iterator to the segment. | *first,* | last The range of segments to erase. |=== [#boost-urls-segments_ref-replace] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::replace Replace segments === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-replace-05[pass:[replace]]( xref:boost-urls-segments_base-iterator[iterator] pos, core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-replace-04[pass:[replace]]( xref:boost-urls-segments_base-iterator[iterator] from, xref:boost-urls-segments_base-iterator[iterator] to, core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-replace-02[pass:[replace]]( xref:boost-urls-segments_base-iterator[iterator] from, xref:boost-urls-segments_base-iterator[iterator] to, std::initializer_list init); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_base-iterator[iterator] xref:boost-urls-segments_ref-replace-07[pass:[replace]]( xref:boost-urls-segments_base-iterator[iterator] from, xref:boost-urls-segments_base-iterator[iterator] to, FwdIt first, FwdIt last); ---- === Description This function replaces the segment at the specified position. Reserved characters in the string are automatically escaped. All iterators that are equal to `pos` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the replaced segment. === Parameters |=== | Name | Description | *pos* | An iterator to the segment. | *s* | The string to assign. | *from,* | to The range of segments to replace. | *init* | The list of segments to assign. | *first,* | last The range of segments to assign. |=== [#boost-urls-segments_ref-push_back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::push_back Append a segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void push_back(core::string_view s); ---- === Description This function appends a segment to the end of the path. Reserved characters in the string are automatically escaped. All end iterators are invalidated. [,cpp] ---- this->back() == s ---- === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *s* | The segment to append. |=== [#boost-urls-segments_ref-pop_back] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::pop_back Remove the last segment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void pop_back() noexcept; ---- === Description This function removes the last segment from the container. Iterators to the last segment as well as all end iterators are invalidated. [,cpp] ---- not this->empty() ---- === Throws nothing. [#boost-urls-parse_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_path Parse a string and return an encoded segment view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_path(core::string_view s) noexcept; ---- === Description This function parses the string and returns the corresponding path object if the string is valid, otherwise returns an error. [,cpp] ---- path = [ "/" ] segment *( "/" segment ) ---- === No-throw guarantee. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] Parse a string and return an encoded segment view This function parses the string and returns the corresponding path object if the string is valid, otherwise returns an error. [,cpp] ---- path = [ "/" ] segment *( "/" segment ) ---- === No-throw guarantee. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Return Value A valid view on success, otherwise an error code. === Parameters |=== | Name | Description | *s* | The string to parse | *s* | The string to parse |=== === See Also xref:boost-urls-segments_encoded_view[segments_encoded_view] . xref:boost-urls-segments_encoded_view[segments_encoded_view] . [#boost-urls-url_view_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::url_view_base Common functionality for containers === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class url_view_base; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-authority[`authority`] ¦ Return the authority ¦xref:boost-urls-url_view_base-buffer[`buffer`] ¦ Return the url string ¦xref:boost-urls-url_view_base-compare[`compare`] ¦ Return the result of comparing this with another url ¦xref:boost-urls-url_view_base-data[`data`] ¦ Return a pointer to the url's character buffer ¦xref:boost-urls-url_view_base-empty[`empty`] ¦ Return true if the url is empty ¦xref:boost-urls-url_view_base-encoded_authority[`encoded_authority`] ¦ Return the authority. ¦xref:boost-urls-url_view_base-encoded_fragment[`encoded_fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-encoded_host[`encoded_host`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_address[`encoded_host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_and_port[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost-urls-url_view_base-encoded_host_name[`encoded_host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-encoded_origin[`encoded_origin`] ¦ Return the origin ¦xref:boost-urls-url_view_base-encoded_params[`encoded_params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-encoded_password[`encoded_password`] ¦ Return the password ¦xref:boost-urls-url_view_base-encoded_path[`encoded_path`] ¦ Return the path ¦xref:boost-urls-url_view_base-encoded_query[`encoded_query`] ¦ Return the query ¦xref:boost-urls-url_view_base-encoded_resource[`encoded_resource`] ¦ Return the resource ¦xref:boost-urls-url_view_base-encoded_segments[`encoded_segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-encoded_target[`encoded_target`] ¦ Return the target ¦xref:boost-urls-url_view_base-encoded_user[`encoded_user`] ¦ Return the user ¦xref:boost-urls-url_view_base-encoded_userinfo[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-encoded_zone_id[`encoded_zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url_view_base-fragment[`fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-has_authority[`has_authority`] ¦ Return true if an authority is present ¦xref:boost-urls-url_view_base-has_fragment[`has_fragment`] ¦ Return true if a fragment is present ¦xref:boost-urls-url_view_base-has_password[`has_password`] ¦ Return true if a password is present ¦xref:boost-urls-url_view_base-has_port[`has_port`] ¦ Return true if a port is present ¦xref:boost-urls-url_view_base-has_query[`has_query`] ¦ Return true if a query is present ¦xref:boost-urls-url_view_base-has_scheme[`has_scheme`] ¦ Return true a scheme is present ¦xref:boost-urls-url_view_base-has_userinfo[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost-urls-url_view_base-host[`host`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_address[`host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_ipv4_address[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost-urls-url_view_base-host_ipv6_address[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost-urls-url_view_base-host_ipvfuture[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost-urls-url_view_base-host_name[`host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-host_type[`host_type`] ¦ Return the host type ¦xref:boost-urls-url_view_base-is_path_absolute[`is_path_absolute`] ¦ Return true if the path is absolute ¦xref:boost-urls-url_view_base-2conversion[`operator core::string_view`] ¦ Return the URL as a core::string_view ¦xref:boost-urls-url_view_base-params[`params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-password[`password`] ¦ Return the password ¦xref:boost-urls-url_view_base-path[`path`] ¦ Return the path ¦xref:boost-urls-url_view_base-persist[`persist`] ¦ Return a shared, persistent copy of the url ¦xref:boost-urls-url_view_base-port[`port`] ¦ Return the port ¦xref:boost-urls-url_view_base-port_number[`port_number`] ¦ Return the port ¦xref:boost-urls-url_view_base-query[`query`] ¦ Return the query ¦xref:boost-urls-url_view_base-scheme[`scheme`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-scheme_id[`scheme_id`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-segments[`segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-size[`size`] ¦ Return the number of characters in the url ¦xref:boost-urls-url_view_base-user[`user`] ¦ Return the user ¦xref:boost-urls-url_view_base-userinfo[`userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-zone_id[`zone_id`] ¦ Return the IPv6 Zone ID |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-08friend-02[`operator!=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-05[`operator<`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-0f[`operator<<`] ¦ Format the url to the output stream ¦xref:boost-urls-url_view_base-08friend-04[`operator<=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-07c[`operator==`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-073[`operator>`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-06[`operator>=`] ¦ Return the result of comparing two URLs |=== === Description This base class is used by the library to provide common member functions for containers. This cannot be instantiated directly; Instead, use one of the containers or functions: * xref:boost-urls-url[url] * xref:boost-urls-url_view[url_view] * xref:boost-urls-static_url[static_url] * xref:boost-urls-parse_absolute_uri[parse_absolute_uri] * xref:boost-urls-parse_origin_form[parse_origin_form] * xref:boost-urls-parse_relative_ref[parse_relative_ref] * xref:boost-urls-parse_uri[parse_uri] * xref:boost-urls-parse_uri_reference[parse_uri_reference] [#boost-urls-url_view_base-max_size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::max_size Return the maximum number of characters possible === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr static std::size_t max_size() noexcept; ---- === Description This represents the largest number of characters that are theoretically possible to represent in a url, not including any null terminator. In practice the actual possible size may be lower than this number. === Constant. === Throws nothing. [#boost-urls-url_view_base-size] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::size Return the number of characters in the url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t size() const noexcept; ---- === Description This function returns the number of characters in the url's encoded string, not including any null terminator, if present. [,cpp] ---- assert( url_view( "file:///Program%20Files" ).size() == 23 ); ---- === Constant. === Throws nothing. [#boost-urls-url_view_base-empty] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::empty Return true if the url is empty === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool empty() const noexcept; ---- === Description The empty string matches the _relative-ref_ grammar. [,cpp] ---- assert( url_view( "" ).empty() ); ---- === Constant. === Throws nothing. [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4.2. Relative Reference (rfc3986)] [#boost-urls-url_view_base-data] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::data Return a pointer to the url's character buffer === Synopsis Declared in header `` [source,cpp,subs="verbatim,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-terminated. === Constant. === Throws nothing. [#boost-urls-url_view_base-buffer] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::buffer Return the url string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view buffer() const noexcept; ---- === Description This function returns the entire url, which may contain percent escapes. [,cpp] ---- assert( url_view( "http://www.example.com" ).buffer() == "http://www.example.com" ); ---- === Constant. === Throws nothing. [#boost-urls-url_view_base-2conversion] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::operator basic_string_view Return the URL as a core::string_view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- operator core::string_view() const noexcept; ---- === Description === Constant. === Throws nothing. [#boost-urls-url_view_base-persist] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::persist Return a shared, persistent copy of the url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::shared_ptr persist() const; ---- === Description This function returns a read-only copy of the url, with shared lifetime. The returned value owns (persists) the underlying string. 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. [,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. } ---- === Linear in `this->size()`. === Calls to allocate may throw. [#boost-urls-url_view_base-has_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::has_scheme Return true a scheme is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_scheme() const noexcept; ---- === Description This function returns true if this contains a scheme. [,cpp] ---- assert( url_view( "http://www.example.com" ).has_scheme() ); ---- === Constant. === Throws nothing. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] absolute-URI = scheme ":" hier-part [ "?" query ] scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3.1. Scheme (rfc3986)] === See Also xref:boost-urls-url_view_base-scheme[scheme] , xref:boost-urls-url_view_base-scheme_id[scheme_id] . [#boost-urls-url_view_base-scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::scheme Return the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view scheme() const noexcept; ---- === Description This function returns the scheme if it exists, without a trailing colon (':'). Otherwise it returns an empty string. Note that schemes are case-insensitive, and the canonical form is lowercased. [,cpp] ---- assert( url_view( "http://www.example.com" ).scheme() == "http" ); ---- === Throws nothing. [,cpp] ---- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] absolute-URI = scheme ":" hier-part [ "?" query ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3.1. Scheme (rfc3986)] === See Also xref:boost-urls-url_view_base-has_scheme[has_scheme] , xref:boost-urls-url_view_base-scheme_id[scheme_id] . [#boost-urls-url_view_base-scheme_id] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::scheme_id Return the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls[urls]::xref:boost-urls-scheme[scheme] scheme_id() const noexcept; ---- === Description This function returns a value which depends on the scheme in the url: * If the scheme is a well-known scheme, corresponding value from the enumeration xref:boost-urls-scheme[urls::scheme] is returned. * If a scheme is present but is not a well-known scheme, the value returned is xref:boost-urls-scheme-unknown[urls::scheme::unknown] . * Otherwise, if the scheme is absent the value returned is xref:boost-urls-scheme-none[urls::scheme::none] . [,cpp] ---- assert( url_view( "wss://www.example.com/crypto.cgi" ).scheme_id() == scheme::wss ); ---- === Constant. === Throws nothing. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] absolute-URI = scheme ":" hier-part [ "?" query ] scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[3.1. Scheme (rfc3986)] === See Also xref:boost-urls-url_view_base-has_scheme[has_scheme] , xref:boost-urls-url_view_base-scheme[scheme] . [#boost-urls-url_view_base-has_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::has_authority Return true if an authority is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_authority() const noexcept; ---- === Description This function returns true if the url contains an authority. The presence of an authority is denoted by a double slash ("//") at the beginning or after the scheme. [,cpp] ---- assert( url_view( "http://www.example.com/index.htm" ).has_authority() ); ---- === Constant. === Throws nothing. [,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...) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] === See Also xref:boost-urls-url_view_base-authority[authority] , xref:boost-urls-url_view_base-encoded_authority[encoded_authority] . [#boost-urls-url_view_base-authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::authority Return the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-authority_view[authority_view] authority() const noexcept; ---- === Description This function returns the authority as an xref:boost-urls-authority_view[authority_view] . [,cpp] ---- authority_view a = url_view( "https://www.example.com:8080/index.htm" ).authority(); ---- === Constant. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_authority[encoded_authority] , xref:boost-urls-url_view_base-has_authority[has_authority] . [#boost-urls-url_view_base-encoded_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_authority Return the authority. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_authority() const noexcept; ---- === Description If present, this function returns a string representing the authority (which may be empty). Otherwise it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "file://Network%20Drive/My%2DFiles" ).encoded_authority() == "Network%20Drive" ); ---- === Constant. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] === See Also xref:boost-urls-url_view_base-authority[authority] , xref:boost-urls-url_view_base-has_authority[has_authority] . [#boost-urls-url_view_base-has_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::has_userinfo Return true if a userinfo is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_userinfo() const noexcept; ---- === Description This function returns true if this contains a userinfo. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_userinfo() ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_view_base-has_password[has_password] , xref:boost-urls-url_view_base-encoded_password[encoded_password] , xref:boost-urls-url_view_base-encoded_user[encoded_user] , xref:boost-urls-url_view_base-encoded_userinfo[encoded_userinfo] , xref:boost-urls-url_view_base-password[password] , xref:boost-urls-url_view_base-user[user] , xref:boost-urls-url_view_base-userinfo[userinfo] . [#boost-urls-url_view_base-has_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::has_password Return true if a password is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_password() const noexcept; ---- === Description This function returns true if the userinfo is present and contains a password. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).has_password() ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_view_base-has_userinfo[has_userinfo] , xref:boost-urls-url_view_base-encoded_password[encoded_password] , xref:boost-urls-url_view_base-encoded_user[encoded_user] , xref:boost-urls-url_view_base-encoded_userinfo[encoded_userinfo] , xref:boost-urls-url_view_base-password[password] , xref:boost-urls-url_view_base-user[user] , xref:boost-urls-url_view_base-userinfo[userinfo] . [#boost-urls-url_view_base-userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::userinfo Return the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type userinfo(StringToken&& token) const; ---- === Description If present, this function returns a string representing the userinfo (which may be empty). Otherwise it returns an empty string. Any percent-escapes in the string are decoded first. [NOTE] This function uses the string token return type customization. Depending on the token passed, the return type and behavior of the function can be different. See xref:boost-urls-string_token-return_string[string_token::return_string] for more information. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).userinfo() == "jane-doe:pass" ); ---- === Linear in `this->userinfo().size()`. === Calls to allocate may throw. [,cpp] ---- userinfo = user [ ":" [ password ] ] authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === Return Value When called with no arguments, a value of type `std::string` is returned. Otherwise, the return type and meaning depends on the string token passed to the function. === See Also xref:boost-urls-url_view_base-has_password[has_password] , xref:boost-urls-url_view_base-has_userinfo[has_userinfo] , xref:boost-urls-url_view_base-encoded_password[encoded_password] , xref:boost-urls-url_view_base-encoded_user[encoded_user] , xref:boost-urls-url_view_base-encoded_userinfo[encoded_userinfo] , xref:boost-urls-url_view_base-password[password] , xref:boost-urls-url_view_base-user[user] . [#boost-urls-url_view_base-encoded_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_userinfo Return the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_userinfo() const noexcept; ---- === Description If present, this function returns a string representing the userinfo (which may be empty). Otherwise it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_userinfo() == "jane%2Ddoe:pass" ); ---- === Constant. === Throws nothing [,cpp] ---- userinfo = user [ ":" [ password ] ] authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_view_base-has_password[has_password] , xref:boost-urls-url_view_base-has_userinfo[has_userinfo] , xref:boost-urls-url_view_base-encoded_password[encoded_password] , xref:boost-urls-url_view_base-encoded_user[encoded_user] , xref:boost-urls-url_view_base-password[password] , xref:boost-urls-url_view_base-user[user] , xref:boost-urls-url_view_base-userinfo[userinfo] . [#boost-urls-url_view_base-user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::user Return the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type user(StringToken&& token) const; ---- === Description If present, this function returns a string representing the user (which may be empty). Otherwise it returns an empty string. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).user() == "jane-doe" ); ---- === Linear in `this->user().size()`. === Calls to allocate may throw. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_view_base-has_password[has_password] , xref:boost-urls-url_view_base-has_userinfo[has_userinfo] , xref:boost-urls-url_view_base-encoded_password[encoded_password] , xref:boost-urls-url_view_base-encoded_user[encoded_user] , xref:boost-urls-url_view_base-encoded_userinfo[encoded_userinfo] , xref:boost-urls-url_view_base-password[password] , xref:boost-urls-url_view_base-userinfo[userinfo] . [#boost-urls-url_view_base-encoded_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_user Return the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_user() const noexcept; ---- === Description If present, this function returns a string representing the user (which may be empty). Otherwise it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_user() == "jane%2Ddoe" ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_view_base-has_password[has_password] , xref:boost-urls-url_view_base-has_userinfo[has_userinfo] , xref:boost-urls-url_view_base-encoded_password[encoded_password] , xref:boost-urls-url_view_base-encoded_userinfo[encoded_userinfo] , xref:boost-urls-url_view_base-password[password] , xref:boost-urls-url_view_base-user[user] , xref:boost-urls-url_view_base-userinfo[userinfo] . [#boost-urls-url_view_base-password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::password Return the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type password(StringToken&& token) const; ---- === Description If present, this function returns a string representing the password (which may be an empty string). Otherwise it returns an empty string. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).password() == "pass" ); ---- === Linear in `this->password().size()`. === Calls to allocate may throw. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_view_base-has_password[has_password] , xref:boost-urls-url_view_base-has_userinfo[has_userinfo] , xref:boost-urls-url_view_base-encoded_password[encoded_password] , xref:boost-urls-url_view_base-encoded_user[encoded_user] , xref:boost-urls-url_view_base-encoded_userinfo[encoded_userinfo] , xref:boost-urls-url_view_base-user[user] , xref:boost-urls-url_view_base-userinfo[userinfo] . [#boost-urls-url_view_base-encoded_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_password Return the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_password() const noexcept; ---- === Description This function returns the password portion of the userinfo as a percent-encoded string. [,cpp] ---- assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_password() == "pass" ); ---- === Constant. === Throws nothing. [,cpp] ---- userinfo = user [ ":" [ password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_view_base-has_password[has_password] , xref:boost-urls-url_view_base-has_userinfo[has_userinfo] , xref:boost-urls-url_view_base-encoded_user[encoded_user] , xref:boost-urls-url_view_base-encoded_userinfo[encoded_userinfo] , xref:boost-urls-url_view_base-password[password] , xref:boost-urls-url_view_base-user[user] , xref:boost-urls-url_view_base-userinfo[userinfo] . [#boost-urls-url_view_base-host_type] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::host_type Return the host type === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls[urls]::xref:boost-urls-host_type[host_type] host_type() const noexcept; ---- === Description This function returns one of the following constants representing the type of host present. * xref:boost-urls-host_type-ipv4[host_type::ipv4] * xref:boost-urls-host_type-ipv6[host_type::ipv6] * xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] * xref:boost-urls-host_type-name[host_type::name] * xref:boost-urls-host_type-none[host_type::none] When xref:boost-urls-url_view_base-has_authority[has_authority] is false, the host type is xref:boost-urls-host_type-none[host_type::none] . [,cpp] ---- assert( url_view( "https://192.168.0.1/local.htm" ).host_type() == host_type::ipv4 ); ---- === Constant. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::host Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type host(StringToken&& token) const; ---- === Description This function returns the host portion of the authority as a string, or the empty string if there is no authority. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).host() == "www-root.example.com" ); ---- === Linear in `this->host().size()`. === Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-encoded_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_host Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_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. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host() == "www%2droot.example.com" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::host_address Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type host_address(StringToken&& token) const; ---- === Description The value returned by this function depends on the type of host returned from the function xref:boost-urls-url_view_base-host_type[host_type] . * If the type is xref:boost-urls-host_type-ipv4[host_type::ipv4] , then the IPv4 address string is returned. * If the type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , then the IPv6 address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] , then the IPvFuture address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-name[host_type::name] , then the host name string is returned. Any percent-escapes in the string are decoded first. * If the type is xref:boost-urls-host_type-none[host_type::none] , then an empty string is returned. [,cpp] ---- assert( url_view( "https://[1::6:c0a8:1]/" ).host_address() == "1::6:c0a8:1" ); ---- === Linear in `this->host_address().size()`. === Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-encoded_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_host_address Return the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_host_address() const noexcept; ---- === Description The value returned by this function depends on the type of host returned from the function xref:boost-urls-url_view_base-host_type[host_type] . * If the type is xref:boost-urls-host_type-ipv4[host_type::ipv4] , then the IPv4 address string is returned. * If the type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , then the IPv6 address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] , then the IPvFuture address string is returned, without any enclosing brackets. * If the type is xref:boost-urls-host_type-name[host_type::name] , then the host name string is returned. Any percent-escapes in the string are decoded first. * If the type is xref:boost-urls-host_type-none[host_type::none] , then an empty string is returned. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host_address() == "www%2droot.example.com" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-host_ipv4_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::host_ipv4_address Return the host IPv4 address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv4_address[ipv4_address] host_ipv4_address() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] , this function returns the address as a value of type xref:boost-urls-ipv4_address[ipv4_address] . Otherwise, if the host type is not an IPv4 address, it returns a default-constructed value which is equal to the unspecified address "0.0.0.0". [,cpp] ---- assert( url_view( "http://127.0.0.1/index.htm?user=win95" ).host_ipv4_address() == ipv4_address( "127.0.0.1" ) ); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-host_ipv6_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::host_ipv6_address Return the host IPv6 address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-ipv6_address[ipv6_address] host_ipv6_address() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , this function returns the address as a value of type xref:boost-urls-ipv6_address[ipv6_address] . Otherwise, if the host type is not an IPv6 address, it returns a default-constructed value which is equal to the unspecified address "0:0:0:0:0:0:0:0". [,cpp] ---- assert( url_view( "ftp://[::1]/" ).host_ipv6_address() == ipv6_address( "::1" ) ); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-host_ipvfuture] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::host_ipvfuture Return the host IPvFuture address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view host_ipvfuture() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] , this function returns the address as a string. Otherwise, if the host type is not an IPvFuture address, it returns an empty string. [,cpp] ---- assert( url_view( "http://[v1fe.d:9]/index.htm" ).host_ipvfuture() == "v1fe.d:9" ); ---- === Constant. === Throws nothing. [,cpp] ---- IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::host_name Return the host name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type host_name(StringToken&& token) const; ---- === Description If the host type is xref:boost-urls-host_type-name[host_type::name] , this function returns the name as a string. Otherwise an empty string is returned. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).host_name() == "www-root.example.com" ); ---- === Linear in `this->host_name().size()`. === Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-encoded_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_host_name Return the host name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_host_name() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-name[host_type::name] , this function returns the name as a string. Otherwise, if the host type is not an name, it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host_name() == "www%2droot.example.com" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [#boost-urls-url_view_base-zone_id] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::zone_id Return the IPv6 Zone ID === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type zone_id(StringToken&& token) const; ---- === Description If the host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , this function returns the Zone ID as a string. Otherwise an empty string is returned. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "http://[fe80::1%25eth0]/" ).zone_id() == "eth0" ); ---- === Linear in `this->encoded_zone_id().size()`. === Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture ) "]" ZoneID = 1*( unreserved / pct-encoded ) IPv6addrz = IPv6address "%25" ZoneID ---- * link:https://datatracker.ietf.org/doc/html/rfc6874[Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers] [#boost-urls-url_view_base-encoded_zone_id] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_zone_id Return the IPv6 Zone ID === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_zone_id() const noexcept; ---- === Description If the host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] , this function returns the Zone ID as a string. Otherwise an empty string is returned. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://[fe80::1%25eth0]/" ).encoded_zone_id() == "eth0" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture ) "]" ZoneID = 1*( unreserved / pct-encoded ) IPv6addrz = IPv6address "%25" ZoneID ---- * link:https://datatracker.ietf.org/doc/html/rfc6874[Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers] [#boost-urls-url_view_base-has_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::has_port Return true if a port is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_port() const noexcept; ---- === Description This function returns true if an authority is present and contains a port. [,cpp] ---- assert( url_view( "wss://www.example.com:443" ).has_port() ); ---- === Constant. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_host_and_port[encoded_host_and_port] , xref:boost-urls-url_view_base-port[port] , xref:boost-urls-url_view_base-port_number[port_number] . [#boost-urls-url_view_base-port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::port Return the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view port() const noexcept; ---- === Description If present, this function returns a string representing the port (which may be empty). Otherwise it returns an empty string. [,cpp] ---- assert( url_view( "http://localhost.com:8080" ).port() == "8080" ); ---- === Constant. === Throws nothing. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_host_and_port[encoded_host_and_port] , xref:boost-urls-url_view_base-has_port[has_port] , xref:boost-urls-url_view_base-port_number[port_number] . [#boost-urls-url_view_base-port_number] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::port_number Return the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::uint16_t port_number() const noexcept; ---- === Description If a port is present and the numerical value is representable, it is returned as an unsigned integer. Otherwise, the number zero is returned. [,cpp] ---- assert( url_view( "http://localhost.com:8080" ).port_number() == 8080 ); ---- === Constant. === Throws nothing. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_host_and_port[encoded_host_and_port] , xref:boost-urls-url_view_base-has_port[has_port] , xref:boost-urls-url_view_base-port[port] . [#boost-urls-url_view_base-is_path_absolute] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::is_path_absolute Return true if the path is absolute === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool is_path_absolute() const noexcept; ---- === Description This function returns true if the path begins with a forward slash ('/'). [,cpp] ---- assert( url_view( "/path/to/file.txt" ).is_path_absolute() ); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_path[encoded_path] , xref:boost-urls-url_view_base-encoded_segments[encoded_segments] . xref:boost-urls-url_view_base-path[path] , xref:boost-urls-url_view_base-segments[segments] . [#boost-urls-url_view_base-path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::path Return the path === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type path(StringToken&& token) const; ---- === Description This function returns the path as a string. The path may be empty. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "file:///Program%20Files/Games/config.ini" ).path() == "/Program Files/Games/config.ini" ); ---- === Linear in `this->path().size()`. === Calls to allocate may throw. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_view_base-is_path_absolute[is_path_absolute] , xref:boost-urls-url_view_base-encoded_path[encoded_path] , xref:boost-urls-url_view_base-encoded_segments[encoded_segments] . xref:boost-urls-url_view_base-segments[segments] . [#boost-urls-url_view_base-encoded_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_path Return the path === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_path() const noexcept; ---- === Description This function returns the path as a string. The path may be empty. Any percent-escapes in the string are decoded first. [,cpp] ---- assert( url_view( "file:///Program%20Files/Games/config.ini" ).encoded_path() == "/Program%20Files/Games/config.ini" ); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_view_base-is_path_absolute[is_path_absolute] , xref:boost-urls-url_view_base-encoded_segments[encoded_segments] . xref:boost-urls-url_view_base-path[path] , xref:boost-urls-url_view_base-segments[segments] . [#boost-urls-url_view_base-segments] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::segments Return the path as a container of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_view[segments_view] segments() const noexcept; ---- === Description This function returns a bidirectional view of strings over the path. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. [,cpp] ---- segments_view sv = url_view( "/path/to/file.txt" ).segments(); ---- === Constant. === Throws nothing. [,cpp] ---- path = [ "/" ] segment *( "/" segment ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_view_base-is_path_absolute[is_path_absolute] , xref:boost-urls-url_view_base-encoded_path[encoded_path] , xref:boost-urls-url_view_base-encoded_segments[encoded_segments] . xref:boost-urls-url_view_base-path[path] , xref:boost-urls-segments_view[segments_view] . [#boost-urls-url_view_base-encoded_segments] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_segments Return the path as a container of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_view[segments_encoded_view] encoded_segments() const noexcept; ---- === Description This function returns a bidirectional view of strings over the path. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. [,cpp] ---- segments_encoded_view sv = url_view( "/path/to/file.txt" ).encoded_segments(); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_view_base-is_path_absolute[is_path_absolute] , xref:boost-urls-url_view_base-encoded_path[encoded_path] , xref:boost-urls-url_view_base-path[path] , xref:boost-urls-url_view_base-segments[segments] , xref:boost-urls-segments_encoded_view[segments_encoded_view] . [#boost-urls-url_view_base-has_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::has_query Return true if a query is present === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_query() const noexcept; ---- === Description This function returns true if this contains a query. An empty query is distinct from having no query. [,cpp] ---- assert( url_view( "/sql?id=42&col=name&page-size=20" ).has_query() ); ---- === Constant. === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type query(StringToken&& token) const; ---- === Description If this contains a query, it is returned as a string (which may be empty). Otherwise, an empty string is returned. Any percent-escapes in the string are decoded first. When plus signs appear in the query portion of the url, they are converted to spaces automatically upon decoding. This behavior can be changed by setting decode options. [,cpp] ---- assert( url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).query() == "id=42&name=jane-doe&page size=20" ); ---- === Linear in `this->query().size()`. === Calls to allocate may throw. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_query() const noexcept; ---- === Description If this contains a query, it is returned as a string (which may be empty). Otherwise, an empty string is returned. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_query() == "id=42&name=jane%2Ddoe&page+size=20" ); ---- === Constant. === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li 3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_view[params_encoded_view] encoded_params() const noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. [,cpp] ---- params_encoded_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params(); ---- === Constant. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool has_fragment() const noexcept; ---- === Description This function returns true if the url contains a fragment. An empty fragment is distinct from no fragment. [,cpp] ---- assert( url_view( "http://www.example.com/index.htm#anchor" ).has_fragment() ); ---- === Constant. === Throws nothing. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_fragment[encoded_fragment] , xref:boost-urls-url_view_base-fragment[fragment] . [#boost-urls-url_view_base-fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::fragment Return the fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template StringToken::result_type fragment(StringToken&& token) const; ---- === Description This function calculates the fragment of the url, with percent escapes decoded and without the leading pound sign ('#') whose presence indicates that the url contains a fragment. This function accepts an optional _StringToken_ parameter which controls the return type and behavior of the function: * When called with no arguments, the return type of the function is `std::string`. Otherwise * When called with a string token, the behavior and return type of the function depends on the type of string token being passed. [,cpp] ---- assert( url_view( "http://www.example.com/index.htm#a%2D1" ).fragment() == "a-1" ); ---- === Linear in `this->fragment().size()`. === Calls to allocate may throw. String tokens may throw exceptions. [,cpp] ---- fragment = *( pchar / "/" / "?" ) fragment-part = [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment (rfc3986)] === Parameters |=== | Name | Description | *token* | An optional string token to use. If this parameter is omitted, the function returns a new `std::string`. |=== === See Also xref:boost-urls-url_view_base-encoded_fragment[encoded_fragment] , xref:boost-urls-url_view_base-has_fragment[has_fragment] . [#boost-urls-url_view_base-encoded_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_fragment Return the fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_fragment() const noexcept; ---- === Description This function returns the fragment as a string with percent-escapes. Ownership is not transferred; the string returned references the underlying character buffer, which must remain valid or else undefined behavior occurs. [,cpp] ---- assert( url_view( "http://www.example.com/index.htm#a%2D1" ).encoded_fragment() == "a%2D1" ); ---- === Constant. === Throws nothing. [,cpp] ---- fragment = *( pchar / "/" / "?" ) pchar = unreserved / pct-encoded / sub-delims / ":" / "@" ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment (rfc3986)] === See Also xref:boost-urls-url_view_base-fragment[fragment] , xref:boost-urls-url_view_base-has_fragment[has_fragment] . [#boost-urls-url_view_base-encoded_host_and_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_host_and_port Return the host and port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_host_and_port() const noexcept; ---- === Description If an authority is present, this function returns the host and optional port as a string, which may be empty. Otherwise it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://www.example.com:8080/index.htm" ).encoded_host_and_port() == "www.example.com:8080" ); ---- === Constant. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost-urls-url_view_base-has_port[has_port] , xref:boost-urls-url_view_base-port[port] , xref:boost-urls-url_view_base-port_number[port_number] . [#boost-urls-url_view_base-encoded_origin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_origin Return the origin === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_origin() const noexcept; ---- === Description If an authority is present, this function returns the scheme and authority portion of the url. Otherwise, an empty string is returned. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://www.example.com:8080/index.htm?text=none#h1" ).encoded_origin() == "http://www.example.com:8080" ); ---- === Constant. === Throws nothing. === See Also xref:boost-urls-url_view_base-encoded_resource[encoded_resource] , xref:boost-urls-url_view_base-encoded_target[encoded_target] . [#boost-urls-url_view_base-encoded_resource] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_resource Return the resource === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_resource() const noexcept; ---- === Description This function returns the resource, which is the portion of the url that includes only the path, query, and fragment. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://www.example.com/index.html?query#frag" ).encoded_resource() == "/index.html?query#frag" ); ---- === Constant. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_origin[encoded_origin] , xref:boost-urls-url_view_base-encoded_target[encoded_target] . [#boost-urls-url_view_base-encoded_target] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::encoded_target Return the target === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-pct_string_view[pct_string_view] encoded_target() const noexcept; ---- === Description This function returns the target, which is the portion of the url that includes only the path and query. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "http://www.example.com/index.html?query#frag" ).encoded_target() == "/index.html?query" ); ---- === Constant. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] === See Also xref:boost-urls-url_view_base-encoded_origin[encoded_origin] , xref:boost-urls-url_view_base-encoded_resource[encoded_resource] . [#boost-urls-url_view_base-compare] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::compare Return the result of comparing this with another url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- int compare(xref:boost-urls-url_view_base[url_view_base] const& other) const noexcept; ---- === Description This function compares two URLs according to Syntax-Based comparison algorithm. === Linear in `min( u0.size(), u1.size() )` === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value -1 if `*this < other`, 0 if `this == other`, and 1 if `this > other`. [#boost-urls-url_view_base-08friend-07c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator==( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.a.com/index.htm" ); assert( u0 == u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() == b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_view_base-08friend-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator!=( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.b.com/index.htm" ); assert( u0 != u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() != b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_view_base-08friend-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator< Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator<( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.b.com/index.htm" ); assert( u0 < u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() < b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_view_base-08friend-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<= Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator<=( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.b.com/index.htm" ); url_view u1( "http://www.b.com/index.htm" ); assert( u0 <= u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() <= b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_view_base-08friend-073] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator> Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator>( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.b.com/index.htm" ); url_view u1( "http://www.a.com/index.htm" ); assert( u0 > u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() > b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_view_base-08friend-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator>= Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend bool operator>=( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.a.com/index.htm" ); assert( u0 >= u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() >= b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url_view_base-08friend-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the url to the output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend std::ostream& operator<<( std::ostream& os, xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description This function serializes the url to the specified output stream. Any percent-escapes are emitted as-is; no decoding is performed. [,cpp] ---- url_view u( "http://www.example.com/index.htm" ); std::stringstream ss; ss << u; assert( ss.str() == "http://www.example.com/index.htm" ); ---- [,cpp] ---- return os << u.buffer(); ---- === Linear in `u.buffer().size()` === Basic guarantee. [#boost-urls-resolve] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::resolve Resolve a URL reference against a base URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result resolve( xref:boost-urls-url_view_base[url_view_base] const& base, xref:boost-urls-url_view_base[url_view_base] const& ref, xref:boost-urls-url_base[url_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. The base URL must satisfy the _URI_ grammar. In other words, it must contain a scheme. Relative references are only usable when in the context of a base absolute URI. This process of resolving a relative _reference_ within the context of a _base_ URI is defined in detail in rfc3986 (see below). The resolution process works as if the relative reference is appended to the base URI and the result is normalized. Given the input base URL, this function resolves the relative reference as if performing the following steps: * Ensure the base URI has at least a scheme * Normalizing the reference path * Merge base and reference paths * Normalize the merged path This function places the result of the resolution into `dest`, which can be any of the url containers that inherit from xref:boost-urls-url_base[url_base] . If an error occurs, the contents of `dest` is unspecified and `ec` is set. [NOTE] Abnormal hrefs where the number of ".." segments exceeds the number of segments in the base path are handled by including the unmatched ".." segments in the result, as described in link:https://www.rfc-editor.org/errata/eid4547[Errata 4547] . [,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" ); ---- [,cpp] ---- absolute-URI = scheme ":" hier-part [ "?" query ] ---- === Basic guarantee. Calls to allocate may throw. === 5. Reference Resolution (rfc3986) Resolve a URL reference against a base URL 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. The base URL must satisfy the _URI_ grammar. In other words, it must contain a scheme. Relative references are only usable when in the context of a base absolute URI. This process of resolving a relative _reference_ within the context of a _base_ URI is defined in detail in rfc3986 (see below). The resolution process works as if the relative reference is appended to the base URI and the result is normalized. Given the input base URL, this function resolves the relative reference as if performing the following steps: * Ensure the base URI has at least a scheme * Normalizing the reference path * Merge base and reference paths * Normalize the merged path This function places the result of the resolution into `dest`, which can be any of the url containers that inherit from xref:boost-urls-url_base[url_base] . If an error occurs, the contents of `dest` is unspecified and `ec` is set. [NOTE] Abnormal hrefs where the number of ".." segments exceeds the number of segments in the base path are handled by including the unmatched ".." segments in the result, as described in link:https://www.rfc-editor.org/errata/eid4547[Errata 4547] . [,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" ); ---- [,cpp] ---- absolute-URI = scheme ":" hier-part [ "?" query ] ---- === Basic guarantee. Calls to allocate may throw. === 5. Reference Resolution (rfc3986) === Return Value An empty result upon success, otherwise an error code if `!base.has_scheme()`. === Parameters |=== | Name | Description | *base* | The base URL to resolve against. | *ref* | The URL reference to resolve. | *dest* | The container where the result is written, upon success. | *base* | The base URL to resolve against. | *ref* | The URL reference to resolve. | *dest* | The container where the result is written, upon success. |=== === See Also xref:boost-urls-url[url] , xref:boost-urls-url_view[url_view] . xref:boost-urls-url[url] , xref:boost-urls-url_view[url_view] . [#boost-urls-url] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::url A modifiable container for a URL. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class url : public xref:boost-urls-url_base[url_base]; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-authority[`authority`] ¦ Return the authority ¦xref:boost-urls-url_view_base-buffer[`buffer`] ¦ Return the url string ¦xref:boost-urls-url_base-c_str[`c_str`] ¦ Return the url as a null-terminated string ¦xref:boost-urls-url_base-capacity[`capacity`] ¦ Return the number of characters that can be stored without reallocating ¦xref:boost-urls-url_base-clear[`clear`] ¦ Clear the contents while preserving the capacity ¦xref:boost-urls-url_view_base-compare[`compare`] ¦ Return the result of comparing this with another url ¦xref:boost-urls-url_view_base-data[`data`] ¦ Return a pointer to the url's character buffer ¦xref:boost-urls-url_view_base-empty[`empty`] ¦ Return true if the url is empty ¦xref:boost-urls-url_view_base-encoded_authority[`encoded_authority`] ¦ Return the authority. ¦xref:boost-urls-url_view_base-encoded_fragment[`encoded_fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-encoded_host[`encoded_host`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_address[`encoded_host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_and_port[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost-urls-url_view_base-encoded_host_name[`encoded_host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-encoded_origin[`encoded_origin`] ¦ Return the origin ¦xref:boost-urls-url_view_base-encoded_params[`encoded_params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-encoded_password[`encoded_password`] ¦ Return the password ¦xref:boost-urls-url_view_base-encoded_path[`encoded_path`] ¦ Return the path ¦xref:boost-urls-url_view_base-encoded_query[`encoded_query`] ¦ Return the query ¦xref:boost-urls-url_view_base-encoded_resource[`encoded_resource`] ¦ Return the resource ¦xref:boost-urls-url_view_base-encoded_segments[`encoded_segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-encoded_target[`encoded_target`] ¦ Return the target ¦xref:boost-urls-url_view_base-encoded_user[`encoded_user`] ¦ Return the user ¦xref:boost-urls-url_view_base-encoded_userinfo[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-encoded_zone_id[`encoded_zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url_view_base-fragment[`fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-has_authority[`has_authority`] ¦ Return true if an authority is present ¦xref:boost-urls-url_view_base-has_fragment[`has_fragment`] ¦ Return true if a fragment is present ¦xref:boost-urls-url_view_base-has_password[`has_password`] ¦ Return true if a password is present ¦xref:boost-urls-url_view_base-has_port[`has_port`] ¦ Return true if a port is present ¦xref:boost-urls-url_view_base-has_query[`has_query`] ¦ Return true if a query is present ¦xref:boost-urls-url_view_base-has_scheme[`has_scheme`] ¦ Return true a scheme is present ¦xref:boost-urls-url_view_base-has_userinfo[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost-urls-url_view_base-host[`host`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_address[`host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_ipv4_address[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost-urls-url_view_base-host_ipv6_address[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost-urls-url_view_base-host_ipvfuture[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost-urls-url_view_base-host_name[`host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-host_type[`host_type`] ¦ Return the host type ¦xref:boost-urls-url_view_base-is_path_absolute[`is_path_absolute`] ¦ Return true if the path is absolute ¦xref:boost-urls-url_base-normalize[`normalize`] ¦ Normalize the URL components ¦xref:boost-urls-url_base-normalize_authority[`normalize_authority`] ¦ Normalize the URL authority ¦xref:boost-urls-url_base-normalize_fragment[`normalize_fragment`] ¦ Normalize the URL fragment ¦xref:boost-urls-url_base-normalize_path[`normalize_path`] ¦ Normalize the URL path ¦xref:boost-urls-url_base-normalize_query[`normalize_query`] ¦ Normalize the URL query ¦xref:boost-urls-url_base-normalize_scheme[`normalize_scheme`] ¦ Normalize the URL scheme ¦xref:boost-urls-url_view_base-2conversion[`operator core::string_view`] ¦ Return the URL as a core::string_view ¦xref:boost-urls-url-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-url_view_base-params[`params`] ¦ Return the query as a container of parameters xref:boost-urls-url_view_base-params-05[url_view_base::params] ¦xref:boost-urls-url_view_base-password[`password`] ¦ Return the password ¦xref:boost-urls-url_view_base-path[`path`] ¦ Return the path ¦xref:boost-urls-url_view_base-persist[`persist`] ¦ Return a shared, persistent copy of the url ¦xref:boost-urls-url_view_base-port[`port`] ¦ Return the port ¦xref:boost-urls-url_view_base-port_number[`port_number`] ¦ Return the port ¦xref:boost-urls-url_view_base-query[`query`] ¦ Return the query ¦xref:boost-urls-url_base-remove_authority[`remove_authority`] ¦ Remove the authority ¦xref:boost-urls-url_base-remove_fragment[`remove_fragment`] ¦ Remove the fragment ¦xref:boost-urls-url_base-remove_origin[`remove_origin`] ¦ Remove the origin component ¦xref:boost-urls-url_base-remove_password[`remove_password`] ¦ Remove the password ¦xref:boost-urls-url_base-remove_port[`remove_port`] ¦ Remove the port ¦xref:boost-urls-url_base-remove_query[`remove_query`] ¦ Remove the query ¦xref:boost-urls-url_base-remove_scheme[`remove_scheme`] ¦ Remove the scheme ¦xref:boost-urls-url_base-remove_userinfo[`remove_userinfo`] ¦ Remove the userinfo ¦xref:boost-urls-url_base-reserve[`reserve`] ¦ Adjust the capacity without changing the size ¦xref:boost-urls-url_base-resolve[`resolve`] ¦ Resolve a URL reference against this base URL ¦xref:boost-urls-url_view_base-scheme[`scheme`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-scheme_id[`scheme_id`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-segments[`segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_base-set_encoded_authority[`set_encoded_authority`] ¦ Set the authority ¦xref:boost-urls-url_base-set_encoded_fragment[`set_encoded_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_encoded_host[`set_encoded_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_encoded_host_address[`set_encoded_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_encoded_host_name[`set_encoded_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_encoded_params[`set_encoded_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_encoded_password[`set_encoded_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_encoded_path[`set_encoded_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_encoded_query[`set_encoded_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_encoded_user[`set_encoded_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_encoded_userinfo[`set_encoded_userinfo`] ¦ Set the userinfo. ¦xref:boost-urls-url_base-set_fragment[`set_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_host[`set_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_host_address[`set_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv4[`set_host_ipv4`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv6[`set_host_ipv6`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipvfuture[`set_host_ipvfuture`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_name[`set_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_params[`set_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_password[`set_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_path[`set_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_path_absolute[`set_path_absolute`] ¦ Set if the path is absolute ¦xref:boost-urls-url_base-set_port[`set_port`] ¦ Set the port ¦xref:boost-urls-url_base-set_port_number[`set_port_number`] ¦ Set the port ¦xref:boost-urls-url_base-set_query[`set_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_scheme[`set_scheme`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_scheme_id[`set_scheme_id`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_user[`set_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_userinfo[`set_userinfo`] ¦ Set the userinfo ¦xref:boost-urls-url_view_base-size[`size`] ¦ Return the number of characters in the url ¦xref:boost-urls-url-swap[`swap`] ¦ Swap the contents. ¦xref:boost-urls-url-2constructor[`url`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-url_view_base-user[`user`] ¦ Return the user ¦xref:boost-urls-url_view_base-userinfo[`userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-zone_id[`zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url-2destructor[`~url`] [.small]#[destructor]# ¦ Destructor |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-08friend-02[`operator!=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-05[`operator<`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-0f[`operator<<`] ¦ Format the url to the output stream ¦xref:boost-urls-url_view_base-08friend-04[`operator<=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-07c[`operator==`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-073[`operator>`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-06[`operator>=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_base-08friend[`resolve`] ¦ Resolve a URL reference against a base URL ¦xref:boost-urls-url-08friend[`swap`] ¦ Swap |=== === Description This container owns a url, represented by a null-terminated character buffer which is managed by performing dymamic memory allocations as needed. The contents may be inspected and modified, and the implementation maintains a useful invariant: changes to the url always leave it in a valid state. * Functions marked `noexcept` provide the no-throw guarantee, otherwise: * Functions which throw offer the strong exception safety guarantee. [,cpp] ---- URI-reference = URI / relative-ref URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] absolute-URI = scheme ":" hier-part [ "?" query ] ---- * link:https://tools.ietf.org/html/rfc3986[Uniform Resource Identifier (URI): Generic Syntax (rfc3986)] === See Also xref:boost-urls-parse_absolute_uri[parse_absolute_uri] , xref:boost-urls-parse_relative_ref[parse_relative_ref] , xref:boost-urls-parse_uri[parse_uri] , xref:boost-urls-parse_uri_reference[parse_uri_reference] , xref:boost-urls-url_base-resolve[resolve] . [#boost-urls-url-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::~url Destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual ~url(); ---- === Description Any params, segments, iterators, or views which reference this object are invalidated. The underlying character buffer is destroyed, invalidating all references to it. [#boost-urls-url-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::url Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url-2constructor-0f0[pass:[url]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-url-2constructor-002[pass:[url]](core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url-2constructor-01[pass:[url]](xref:boost-urls-url[url]&& u) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url-2constructor-001[pass:[url]](xref:boost-urls-url_view_base[url_view_base] const& u); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url-2constructor-0f7[pass:[url]](xref:boost-urls-url[url] const& u); ---- === Description Default constructed urls contain a zero-length string. This matches the grammar for a relative-ref with an empty path and no query or fragment. [,cpp] ---- url u; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- === 4.2. Relative Reference (rfc3986) === Exceptions |=== | Name | Thrown on | `The` | input does not contain a valid url. | ``u.size()` | > max_size()`. |=== === Parameters |=== | Name | Description | *s* | The string to parse. | *u* | The url to move from. |=== [#boost-urls-url-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& xref:boost-urls-url-operator_assign-09[pass:[operator=]](xref:boost-urls-url[url]&& u) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& xref:boost-urls-url-operator_assign-0b[pass:[operator=]](xref:boost-urls-url_view_base[url_view_base] const& u); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& xref:boost-urls-url-operator_assign-06[pass:[operator=]](xref:boost-urls-url[url] const& u); ---- === Description The contents of `u` are transferred to `this`, including the underlying character buffer. The previous contents of `this` are destroyed. After assignment, the moved-from object is as if default constructed. [,cpp] ---- u.empty() == true ---- === Constant. === Throws nothing. === Exceptions |=== | Name | Thrown on | ``u.size()` | > max_size()`. |=== === Parameters |=== | Name | Description | *u* | The url to assign from. |=== [#boost-urls-url-swap] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::swap Swap the contents. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void swap(xref:boost-urls-url[url]& other) noexcept; ---- === Description Exchanges the contents of this url with another url. All views, iterators and references remain valid. If `this == &other`, this function call has no effect. [,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" ); ---- === Constant === Throws nothing. === Parameters |=== | Name | Description | *other* | The object to swap with |=== [#boost-urls-url-08friend] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::swap Swap === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- friend void swap( xref:boost-urls-url[url]& v0, xref:boost-urls-url[url]& v1) noexcept; ---- === Description Exchanges the contents of `v0` with another `v1`. All views, iterators and references remain valid. If `&v0 ==&v1`, this function call has no effect. [,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" ); ---- [,cpp] ---- v0.swap( v1 ); ---- === Constant === Throws nothing === See Also xref:boost-urls-url-swap[url::swap] [#boost-urls-url-set_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_scheme Set the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_scheme(core::string_view s); ---- === Description The scheme is set to the specified string, which must contain a valid scheme without any trailing colon (':'). Note that schemes are case-insensitive, and the canonical form is lowercased. [,cpp] ---- assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid scheme. |=== === Parameters |=== | Name | Description | *s* | The scheme to set. |=== === See Also xref:boost-urls-url_base-remove_scheme[remove_scheme] . [#boost-urls-url-set_scheme_id] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_scheme_id Set the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_scheme_id(xref:boost-urls[urls]::xref:boost-urls-scheme[scheme] id); ---- === Description This function sets the scheme to the specified known xref:boost-urls-scheme[urls::scheme] id, which may not be xref:boost-urls-scheme-unknown[scheme::unknown] or else an exception is thrown. If the id is xref:boost-urls-scheme-none[scheme::none] , this function behaves as if xref:boost-urls-url_base-remove_scheme[remove_scheme] were called. [,cpp] ---- assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" ); ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | scheme is invalid. |=== === Parameters |=== | Name | Description | *id* | The scheme to set. |=== [#boost-urls-url-remove_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_scheme Remove the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_scheme(); ---- === Description This function removes the scheme if it is present. [,cpp] ---- assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" ); ---- [,cpp] ---- this->has_scheme() == false && this->scheme_id() == scheme::none ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === See Also xref:boost-urls-url_base-set_scheme[set_scheme] . [#boost-urls-url-set_encoded_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_authority Set the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_authority(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the authority to the specified string. The string may contain percent-escapes. [,cpp] ---- assert( url().set_encoded_authority( "My%20Computer" ).has_authority() ); ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) host = IP-literal / IPv4address / reg-name port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[ 3.2. Authority (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The authority string to set. |=== === See Also xref:boost-urls-url_base-remove_authority[remove_authority] . [#boost-urls-url-remove_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_authority Remove the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_authority(); ---- === Description This function removes the authority, which includes the userinfo, host, and a port if present. [,cpp] ---- assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" ); ---- [,cpp] ---- this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) host = IP-literal / IPv4address / reg-name port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[ 3.2. Authority (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_authority[set_encoded_authority] . [#boost-urls-url-set_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_userinfo Set the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_userinfo(core::string_view s); ---- === Description The userinfo is set to the given string, which may contain percent-escapes. Any special or reserved characters in the string are automatically percent-encoded. The effects on the user and password depend on the presence of a colon (':') in the string: * 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. In this case xref:boost-urls-url_view_base-has_password[has_password] returns true. Otherwise, * If there is no colon, the user is set to the string. The function xref:boost-urls-url_view_base-has_password[has_password] returns false. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_userinfo[remove_userinfo] , xref:boost-urls-url_base-set_encoded_userinfo[set_encoded_userinfo] . [#boost-urls-url-set_encoded_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_userinfo Set the userinfo. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_userinfo(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description The userinfo is set to the given string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The effects on the user and password depend on the presence of a colon (':') in the string: * 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. In this case xref:boost-urls-url_view_base-has_password[has_password] returns true. Otherwise, * If there is no colon, the user is set to the string. The function xref:boost-urls-url_view_base-has_password[has_password] returns false. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_userinfo[remove_userinfo] , xref:boost-urls-url_base-set_userinfo[set_userinfo] . [#boost-urls-url-remove_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_userinfo Remove the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_userinfo() noexcept; ---- === Description This function removes the userinfo if present, without removing any authority. [,cpp] ---- assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false ); ---- [,cpp] ---- this->has_userinfo() == false && this->encoded_userinfo().empty == true ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_userinfo[set_encoded_userinfo] , xref:boost-urls-url_base-set_userinfo[set_userinfo] . [#boost-urls-url-set_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_user Set the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_user(core::string_view s); ---- === Description This function sets the user part of the userinfo to the string. Any special or reserved characters in the string are automatically percent-encoded. [,cpp] ---- assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" ); ---- [,cpp] ---- this->has_authority() == true && this->has_userinfo() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_password[set_password] . [#boost-urls-url-set_encoded_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_user Set the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_user(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the user part of the userinfo the the string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" ); ---- [,cpp] ---- this->has_authority() == true && this->has_userinfo() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_password[set_password] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url-set_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_password Set the password. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_password(core::string_view s); ---- === Description This function sets the password in the userinfo to the string. Reserved characters in the string are percent-escaped in the result. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- [,cpp] ---- this->has_password() == true && this->password() == s ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. This string may contain any characters, including nulls. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url-set_encoded_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_password Set the password. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_password(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the password in the userinfo to the string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- [,cpp] ---- this->has_password() == true ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. This string may contain any characters, including nulls. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url-remove_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_password Remove the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_password() noexcept; ---- === Description This function removes the password from the userinfo if a password exists. If there is no userinfo or no authority, the call has no effect. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" ); ---- [,cpp] ---- this->has_password() == false && this->encoded_password().empty() == true ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_password[set_password] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-url-set_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_host Set the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_host(core::string_view s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_encoded_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_host Set the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_host(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string. This string can contain percent escapes, or can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_host_address Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_host_address(core::string_view s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `s.size()`. === Strong guarantee. Calls to allocate may throw. [,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 / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_encoded_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_host_address Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_host_address(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string. This string can contain percent escapes, or can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,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 / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_host_ipv4] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_host_ipv4 Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_host_ipv4(xref:boost-urls-ipv4_address[ipv4_address] const& addr); ---- === Description The host is set to the specified IPv4 address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . [,cpp] ---- assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" ); ---- === Linear in `this->size()`. [,cpp] ---- this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4 ---- === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *addr* | The address to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_host_ipv6] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_host_ipv6 Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_host_ipv6(xref:boost-urls-ipv6_address[ipv6_address] const& addr); ---- === Description The host is set to the specified IPv6 address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . [,cpp] ---- assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6 ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *addr* | The address to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_host_ipvfuture] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_host_ipvfuture Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_host_ipvfuture(core::string_view s); ---- === Description The host is set to the specified IPvFuture string. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . [,cpp] ---- assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" ); ---- === Linear in `this->size() + s.size()`. [,cpp] ---- this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_host_name Set the host to a name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_host_name(core::string_view s); ---- === Description The host is set to the specified string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . [,cpp] ---- assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] . [#boost-urls-url-set_encoded_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_host_name Set the host to a name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_host_name(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description The host is set to the specified string, which may contain percent-escapes and can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . [,cpp] ---- assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-url-set_port_number] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_port_number Set the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_port_number(std::uint16_t n); ---- === Description The port is set to the specified integer. [,cpp] ---- assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" ); ---- [,cpp] ---- this->has_authority() == true && this->has_port() == true && this->port_number() == n ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === Parameters |=== | Name | Description | *n* | The port number to set. |=== === See Also xref:boost-urls-url_base-remove_port[remove_port] , xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-url-set_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_port Set the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_port(core::string_view s); ---- === Description This port is set to the string, which must contain only digits or be empty. An empty port string is distinct from having no port. [,cpp] ---- assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" ); ---- [,cpp] ---- this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n) ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | does not contain a valid port. |=== === Parameters |=== | Name | Description | *s* | The port string to set. |=== === See Also xref:boost-urls-url_base-remove_port[remove_port] , xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-url-remove_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_port Remove the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_port() noexcept; ---- === Description If a port exists, it is removed. The rest of the authority is unchanged. [,cpp] ---- assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" ); ---- [,cpp] ---- this->has_port() == false && this->port_number() == 0 && this->port() == "" ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === See Also xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-url-set_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_path Set the path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_path(core::string_view s); ---- === Description This function sets the path to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. [NOTE] The library may adjust the final result to ensure that no other parts of the url is semantically affected. [NOTE] This function does not encode '/' chars, which are unreserved for paths but reserved for path segments. If a path segment should include encoded '/'s to differentiate it from path separators, the functions xref:boost-urls-url_base-set_encoded_path[set_encoded_path] or xref:boost-urls-url_base-segments-04[segments] should be used instead. [,cpp] ---- url u( "http://www.example.com" ); u.set_path( "path/to/file.txt" ); assert( u.path() == "/path/to/file.txt" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-segments-04[segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url-set_encoded_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_path Set the path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_path(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the path to the string, which may contain percent-escapes and can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [NOTE] The library may adjust the final result to ensure that no other parts of the url is semantically affected. [,cpp] ---- url u( "http://www.example.com" ); u.set_encoded_path( "path/to/file.txt" ); assert( u.encoded_path() == "/path/to/file.txt" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-segments-04[segments] , xref:boost-urls-url_base-set_path[set_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url-set_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_query Set the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_query(core::string_view s); ---- === Description This sets the query to the string, which can be empty. An empty query is distinct from having no query. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true && this->query() == s ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] . [#boost-urls-url-set_encoded_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_query Set the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_query(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This sets the query to the string, which may contain percent-escapes and can be empty. An empty query is distinct from having no query. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true && this->query() == decode_view( s ); ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url-set_params] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_params Set the query params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_params( std::initializer_list ps, xref:boost-urls-encoding_opts[encoding_opts] opts = = {}); ---- === Description This sets the query params to the list of param_view, which can be empty. An empty list of params is distinct from having no params. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true ---- === Strong guarantee. Calls to allocate may throw. === Linear. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_params(std::initializer_list ps); ---- === Description This sets the query params to the elements in the list, which may contain percent-escapes and can be empty. An empty list of params is distinct from having no query. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_params( {"id", "42"} ).encoded_query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true ---- === Linear. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Exceptions |=== | Name | Thrown on | `some` | element in `ps` contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *ps* | The params to set. |=== === See Also xref:boost-urls-url_base-set_params[set_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url-remove_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_query Remove the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_query() noexcept; ---- === Description If a query is present, it is removed. An empty query is distinct from having no query. [,cpp] ---- assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" ); ---- [,cpp] ---- this->has_query() == false && this->params().empty() ---- === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url-remove_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_fragment Remove the fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_fragment() noexcept; ---- === Description This function removes the fragment. An empty fragment is distinct from having no fragment. [,cpp] ---- assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" ); ---- [,cpp] ---- this->has_fragment() == false && this->encoded_fragment() == "" ---- === Constant. === Throws nothing. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_encoded_fragment[set_encoded_fragment] , xref:boost-urls-url_base-set_fragment[set_fragment] . [#boost-urls-url-set_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_fragment Set the fragment. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_fragment(core::string_view s); ---- === Description This function sets the fragment to the specified string, which may be empty. An empty fragment is distinct from having no fragment. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" ); ---- [,cpp] ---- this->has_fragment() == true && this->fragment() == s ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_encoded_fragment[set_encoded_fragment] . [#boost-urls-url-set_encoded_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::set_encoded_fragment Set the fragment. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& set_encoded_fragment(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the fragment to the specified string, which may contain percent-escapes and which may be empty. An empty fragment is distinct from having no fragment. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" ); ---- [,cpp] ---- this->has_fragment() == true && this->fragment() == decode_view( s ) ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_fragment[set_fragment] . [#boost-urls-url-remove_origin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::remove_origin Remove the origin component === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& remove_origin(); ---- === Description This function removes the origin, which consists of the scheme and authority. [,cpp] ---- assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" ); ---- [,cpp] ---- this->scheme_id() == scheme::none && this->has_authority() == false ---- === Linear in `this->size()`. === Throws nothing. [#boost-urls-url-normalize] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::normalize Normalize the URL components === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& normalize(); ---- === Description Applies Syntax-based normalization to all components of the URL. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url-normalize_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::normalize_scheme Normalize the URL scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& normalize_scheme(); ---- === Description Applies Syntax-based normalization to the URL scheme. The scheme is normalized to lowercase. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url-normalize_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::normalize_authority Normalize the URL authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& normalize_authority(); ---- === Description Applies Syntax-based normalization to the URL authority. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url-normalize_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::normalize_path Normalize the URL path === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& normalize_path(); ---- === Description Applies Syntax-based normalization to the URL path. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. Redundant path-segments are removed. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url-normalize_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::normalize_query Normalize the URL query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& normalize_query(); ---- === Description Applies Syntax-based normalization to the URL query. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-url-normalize_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::normalize_fragment Normalize the URL fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& normalize_fragment(); ---- === Description Applies Syntax-based normalization to the URL fragment. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-swap] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::swap Swap === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void swap( xref:boost-urls-url[url]& v0, xref:boost-urls-url[url]& v1) noexcept; ---- === Description Exchanges the contents of `v0` with another `v1`. All views, iterators and references remain valid. If `&v0 ==&v1`, this function call has no effect. [,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" ); ---- [,cpp] ---- v0.swap( v1 ); ---- === Constant === Throws nothing === Parameters |=== | Name | Description | *v0,* | v1 The objects to swap |=== === See Also xref:boost-urls-url-swap[url::swap] [#boost-urls-see_below] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::see_below === Types [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-see_below-format_arg[`format_arg`] ¦ |=== [#boost-urls-see_below-format_arg] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-see_below[pass:[see_below]]::format_arg === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using format_arg = detail::format_arg; ---- [#boost-urls-format] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::format Format arguments into a URL === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-url[url] xref:boost-urls-format-05[pass:[format]]( core::string_view fmt, Args&&... args); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url] xref:boost-urls-format-02[pass:[format]]( core::string_view fmt, std::initializer_list args); ---- === Description Format arguments according to the format URL string into a xref:boost-urls-url[url] . The rules for a format URL string are the same as for a `std::format_string`, where replacement fields are delimited by curly braces. The URL components to which replacement fields belong are identified before replacement is applied and any invalid characters for that formatted argument are percent-escaped. Hence, the delimiters between URL components, such as `:`, `//`, `?`, and `#`, should be included in the URL format string. Likewise, a format string with a single `"{}"` is interpreted as a path and any replacement characters invalid in this component will be encoded to form a valid URL. [,cpp] ---- assert(format("{}", "Hello world!").buffer() == "Hello%20world%21"); ---- === All replacement fields must be valid and the resulting URL should be valid after arguments are formatted into the URL. 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-encoding of arbitrary characters. [,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 ---- * link:https://fmt.dev/latest/syntax.html[Format String Syntax] === Exceptions |=== | Name | Thrown on | ``fmt`` | contains an invalid format string and the result contains an invalid URL after replacements are applied. |=== === Return Value A URL holding the formatted result. === Parameters |=== | Name | Description | *fmt* | The format URL string. | *args* | Arguments to be formatted. |=== === See Also xref:boost-urls-format_to-0b[format_to] . [#boost-urls-format_to] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::format_to Format arguments into a URL === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- template void xref:boost-urls-format_to-02[pass:[format_to]]( xref:boost-urls-url_base[url_base]& u, core::string_view fmt, Args&&... args); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- void xref:boost-urls-format_to-0b[pass:[format_to]]( xref:boost-urls-url_base[url_base]& u, core::string_view fmt, std::initializer_list args); ---- === Description Format arguments according to the format URL string into a xref:boost-urls-url_base[url_base] . The rules for a format URL string are the same as for a `std::format_string`, where replacement fields are delimited by curly braces. The URL components to which replacement fields belong are identified before replacement is applied and any invalid characters for that formatted argument are percent-escaped. Hence, the delimiters between URL components, such as `:`, `//`, `?`, and `#`, should be included in the URL format string. Likewise, a format string with a single `"{}"` is interpreted as a path and any replacement characters invalid in this component will be encoded to form a valid URL. [,cpp] ---- static_url<30> u; format(u, "{}", "Hello world!"); assert(u.buffer() == "Hello%20world%21"); ---- === All replacement fields must be valid and the resulting URL should be valid after arguments are formatted into the URL. 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-encoding of arbitrary characters. === Strong guarantee. [,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 ---- * link:https://fmt.dev/latest/syntax.html[Format String Syntax] === Exceptions |=== | Name | Thrown on | ``fmt`` | contains an invalid format string and `u` contains an invalid URL after replacements are applied. |=== === Parameters |=== | Name | Description | *u* | An object that derives from xref:boost-urls-url_base[url_base] . | *fmt* | The format URL string. | *args* | Arguments to be formatted. |=== === See Also xref:boost-urls-format-02[format] . [#boost-urls-arg] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::arg Designate a named argument for a replacement field === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template pass:q[_implementation-defined_] arg( core::string_view name, T const& arg); ---- === Description Construct a named argument for a format URL string that contains named replacement fields. 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. [,cpp] ---- assert(format("user/{id}", arg("id", 1)).buffer() == "user/1"); ---- === Return Value An temporary object with reference semantics for a named argument === Parameters |=== | Name | Description | *name* | The argument name | *arg* | The argument value |=== === See Also xref:boost-urls-format-02[format] , xref:boost-urls-format_to-0b[format_to] . [#boost-urls-parse_absolute_uri] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_absolute_uri Return a reference to a parsed URL string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_absolute_uri(core::string_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. Ownership of the string is not transferred; the caller is responsible for ensuring that the lifetime of the character buffer extends until the view is no longer being accessed. [,cpp] ---- system::result< url_view > rv = parse_absolute_uri( "http://example.com/index.htm?id=1" ); ---- [,cpp] ---- absolute-URI = scheme ":" hier-part [ "?" query ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.3[4.3. Absolute URI (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s.size()` | > url_view::max_size` |=== === Return Value A result containing a value or an error === Parameters |=== | Name | Description | *s* | The string to parse |=== === See Also xref:boost-urls-parse_origin_form[parse_origin_form] , xref:boost-urls-parse_relative_ref[parse_relative_ref] , xref:boost-urls-parse_uri[parse_uri] , xref:boost-urls-parse_uri_reference[parse_uri_reference] , xref:boost-urls-url_view[url_view] . [#boost-urls-parse_origin_form] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_origin_form Return a reference to a parsed URL string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_origin_form(core::string_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. Ownership of the string is not transferred; the caller is responsible for ensuring that the lifetime of the character buffer extends until the view is no longer being accessed. [,cpp] ---- system::result< url_view > = parse_origin_form( "/index.htm?layout=mobile" ); ---- [,cpp] ---- origin-form = absolute-path [ "?" query ] absolute-path = 1*( "/" segment ) ---- * link:https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1[5.3.1. origin-form (rfc7230)] === Exceptions |=== | Name | Thrown on | ``s.size()` | > url_view::max_size` |=== === Return Value A result containing a value or an error === Parameters |=== | Name | Description | *s* | The string to parse |=== === See Also xref:boost-urls-parse_absolute_uri[parse_absolute_uri] , xref:boost-urls-parse_relative_ref[parse_relative_ref] , xref:boost-urls-parse_uri[parse_uri] , xref:boost-urls-parse_uri_reference[parse_uri_reference] , xref:boost-urls-url_view[url_view] . [#boost-urls-parse_relative_ref] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_relative_ref Return a reference to a parsed URL string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_relative_ref(core::string_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. Ownership of the string is not transferred; the caller is responsible for ensuring that the lifetime of the character buffer extends until the view is no longer being accessed. [,cpp] ---- system::result< url_view > = parse_relative_ref( "images/dot.gif?v=hide#a" ); ---- [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-abempty / path-empty ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4.2. Relative Reference (rfc3986)] * link:https://www.rfc-editor.org/errata/eid5428[Errata ID: 5428 (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s.size()` | > url_view::max_size` |=== === Return Value A result containing a value or an error === Parameters |=== | Name | Description | *s* | The string to parse |=== === See Also xref:boost-urls-parse_absolute_uri[parse_absolute_uri] , xref:boost-urls-parse_origin_form[parse_origin_form] , xref:boost-urls-parse_uri[parse_uri] , xref:boost-urls-parse_uri_reference[parse_uri_reference] , xref:boost-urls-url_view[url_view] . [#boost-urls-parse_uri] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_uri Return a reference to a parsed URL string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_uri(core::string_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. Ownership of the string is not transferred; the caller is responsible for ensuring that the lifetime of the character buffer extends until the view is no longer being accessed. [,cpp] ---- system::result< url_view > = parse_uri( "https://www.example.com/index.htm?id=guest#s1" ); ---- [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3[3. Syntax Components (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s.size()` | > url_view::max_size` |=== === Return Value A result containing a value or an error === Parameters |=== | Name | Description | *s* | The string to parse |=== === See Also xref:boost-urls-parse_absolute_uri[parse_absolute_uri] , xref:boost-urls-parse_origin_form[parse_origin_form] , xref:boost-urls-parse_relative_ref[parse_relative_ref] , xref:boost-urls-parse_uri_reference[parse_uri_reference] , xref:boost-urls-url_view[url_view] . [#boost-urls-parse_uri_reference] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::parse_uri_reference Return a reference to a parsed URL string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- system::result parse_uri_reference(core::string_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. Ownership of the string is not transferred; the caller is responsible for ensuring that the lifetime of the character buffer extends until the view is no longer being accessed. [,cpp] ---- system::result< url_view > = parse_uri_reference( "ws://echo.example.com/?name=boost#demo" ); ---- [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4.1. URI Reference (rfc3986)] * link:https://www.rfc-editor.org/errata/eid5428[Errata ID: 5428 (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s.size()` | > url_view::max_size` |=== === Return Value A result containing a value or an error === Parameters |=== | Name | Description | *s* | The string to parse |=== === See Also xref:boost-urls-parse_absolute_uri[parse_absolute_uri] , xref:boost-urls-parse_origin_form[parse_origin_form] , xref:boost-urls-parse_relative_ref[parse_relative_ref] , xref:boost-urls-parse_uri[parse_uri] , xref:boost-urls-url_view[url_view] . [#boost-urls-static_url] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::static_url A modifiable container for a URL. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template class static_url : public xref:boost-urls-static_url_base[static_url_base]; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-authority[`authority`] ¦ Return the authority ¦xref:boost-urls-url_view_base-buffer[`buffer`] ¦ Return the url string ¦xref:boost-urls-url_base-c_str[`c_str`] ¦ Return the url as a null-terminated string ¦xref:boost-urls-url_base-capacity[`capacity`] ¦ Return the number of characters that can be stored without reallocating ¦xref:boost-urls-url_base-clear[`clear`] ¦ Clear the contents while preserving the capacity ¦xref:boost-urls-url_view_base-compare[`compare`] ¦ Return the result of comparing this with another url ¦xref:boost-urls-url_view_base-data[`data`] ¦ Return a pointer to the url's character buffer ¦xref:boost-urls-url_view_base-empty[`empty`] ¦ Return true if the url is empty ¦xref:boost-urls-url_view_base-encoded_authority[`encoded_authority`] ¦ Return the authority. ¦xref:boost-urls-url_view_base-encoded_fragment[`encoded_fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-encoded_host[`encoded_host`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_address[`encoded_host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_and_port[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost-urls-url_view_base-encoded_host_name[`encoded_host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-encoded_origin[`encoded_origin`] ¦ Return the origin ¦xref:boost-urls-url_view_base-encoded_params[`encoded_params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-encoded_password[`encoded_password`] ¦ Return the password ¦xref:boost-urls-url_view_base-encoded_path[`encoded_path`] ¦ Return the path ¦xref:boost-urls-url_view_base-encoded_query[`encoded_query`] ¦ Return the query ¦xref:boost-urls-url_view_base-encoded_resource[`encoded_resource`] ¦ Return the resource ¦xref:boost-urls-url_view_base-encoded_segments[`encoded_segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-encoded_target[`encoded_target`] ¦ Return the target ¦xref:boost-urls-url_view_base-encoded_user[`encoded_user`] ¦ Return the user ¦xref:boost-urls-url_view_base-encoded_userinfo[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-encoded_zone_id[`encoded_zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url_view_base-fragment[`fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-has_authority[`has_authority`] ¦ Return true if an authority is present ¦xref:boost-urls-url_view_base-has_fragment[`has_fragment`] ¦ Return true if a fragment is present ¦xref:boost-urls-url_view_base-has_password[`has_password`] ¦ Return true if a password is present ¦xref:boost-urls-url_view_base-has_port[`has_port`] ¦ Return true if a port is present ¦xref:boost-urls-url_view_base-has_query[`has_query`] ¦ Return true if a query is present ¦xref:boost-urls-url_view_base-has_scheme[`has_scheme`] ¦ Return true a scheme is present ¦xref:boost-urls-url_view_base-has_userinfo[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost-urls-url_view_base-host[`host`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_address[`host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_ipv4_address[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost-urls-url_view_base-host_ipv6_address[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost-urls-url_view_base-host_ipvfuture[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost-urls-url_view_base-host_name[`host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-host_type[`host_type`] ¦ Return the host type ¦xref:boost-urls-url_view_base-is_path_absolute[`is_path_absolute`] ¦ Return true if the path is absolute ¦xref:boost-urls-url_base-normalize[`normalize`] ¦ Normalize the URL components ¦xref:boost-urls-url_base-normalize_authority[`normalize_authority`] ¦ Normalize the URL authority ¦xref:boost-urls-url_base-normalize_fragment[`normalize_fragment`] ¦ Normalize the URL fragment ¦xref:boost-urls-url_base-normalize_path[`normalize_path`] ¦ Normalize the URL path ¦xref:boost-urls-url_base-normalize_query[`normalize_query`] ¦ Normalize the URL query ¦xref:boost-urls-url_base-normalize_scheme[`normalize_scheme`] ¦ Normalize the URL scheme ¦xref:boost-urls-url_view_base-2conversion[`operator core::string_view`] ¦ Return the URL as a core::string_view ¦xref:boost-urls-static_url-operator_assign[`operator=`] ¦ Assignment ¦xref:boost-urls-url_view_base-params[`params`] ¦ Return the query as a container of parameters xref:boost-urls-url_view_base-params-05[url_view_base::params] ¦xref:boost-urls-url_view_base-password[`password`] ¦ Return the password ¦xref:boost-urls-url_view_base-path[`path`] ¦ Return the path ¦xref:boost-urls-url_view_base-persist[`persist`] ¦ Return a shared, persistent copy of the url ¦xref:boost-urls-url_view_base-port[`port`] ¦ Return the port ¦xref:boost-urls-url_view_base-port_number[`port_number`] ¦ Return the port ¦xref:boost-urls-url_view_base-query[`query`] ¦ Return the query ¦xref:boost-urls-url_base-remove_authority[`remove_authority`] ¦ Remove the authority ¦xref:boost-urls-url_base-remove_fragment[`remove_fragment`] ¦ Remove the fragment ¦xref:boost-urls-url_base-remove_origin[`remove_origin`] ¦ Remove the origin component ¦xref:boost-urls-url_base-remove_password[`remove_password`] ¦ Remove the password ¦xref:boost-urls-url_base-remove_port[`remove_port`] ¦ Remove the port ¦xref:boost-urls-url_base-remove_query[`remove_query`] ¦ Remove the query ¦xref:boost-urls-url_base-remove_scheme[`remove_scheme`] ¦ Remove the scheme ¦xref:boost-urls-url_base-remove_userinfo[`remove_userinfo`] ¦ Remove the userinfo ¦xref:boost-urls-url_base-reserve[`reserve`] ¦ Adjust the capacity without changing the size ¦xref:boost-urls-url_base-resolve[`resolve`] ¦ Resolve a URL reference against this base URL ¦xref:boost-urls-url_view_base-scheme[`scheme`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-scheme_id[`scheme_id`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-segments[`segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_base-set_encoded_authority[`set_encoded_authority`] ¦ Set the authority ¦xref:boost-urls-url_base-set_encoded_fragment[`set_encoded_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_encoded_host[`set_encoded_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_encoded_host_address[`set_encoded_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_encoded_host_name[`set_encoded_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_encoded_params[`set_encoded_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_encoded_password[`set_encoded_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_encoded_path[`set_encoded_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_encoded_query[`set_encoded_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_encoded_user[`set_encoded_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_encoded_userinfo[`set_encoded_userinfo`] ¦ Set the userinfo. ¦xref:boost-urls-url_base-set_fragment[`set_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_host[`set_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_host_address[`set_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv4[`set_host_ipv4`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv6[`set_host_ipv6`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipvfuture[`set_host_ipvfuture`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_name[`set_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_params[`set_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_password[`set_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_path[`set_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_path_absolute[`set_path_absolute`] ¦ Set if the path is absolute ¦xref:boost-urls-url_base-set_port[`set_port`] ¦ Set the port ¦xref:boost-urls-url_base-set_port_number[`set_port_number`] ¦ Set the port ¦xref:boost-urls-url_base-set_query[`set_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_scheme[`set_scheme`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_scheme_id[`set_scheme_id`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_user[`set_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_userinfo[`set_userinfo`] ¦ Set the userinfo ¦xref:boost-urls-url_view_base-size[`size`] ¦ Return the number of characters in the url ¦xref:boost-urls-static_url-2constructor[`static_url`] [.small]#[constructor]# ¦ Constructor ¦xref:boost-urls-url_view_base-user[`user`] ¦ Return the user ¦xref:boost-urls-url_view_base-userinfo[`userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-zone_id[`zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-static_url-2destructor[`~static_url`] [.small]#[destructor]# ¦ Destructor |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-08friend-02[`operator!=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-05[`operator<`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-0f[`operator<<`] ¦ Format the url to the output stream ¦xref:boost-urls-url_view_base-08friend-04[`operator<=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-07c[`operator==`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-073[`operator>`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-06[`operator>=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_base-08friend[`resolve`] ¦ Resolve a URL reference against a base URL |=== === Description This container owns a url, represented by an inline, null-terminated character buffer with fixed capacity. The contents may be inspected and modified, and the implementation maintains a useful invariant: changes to the url always leave it in a valid state. [,cpp] ---- static_url< 1024 > u( "https://www.example.com" ); ---- [,cpp] ---- this->capacity() == Capacity + 1 ---- === See Also xref:boost-urls-url[url] , xref:boost-urls-url_view[url_view] . [#boost-urls-static_url-2destructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::~static_url Destructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- virtual ~static_url() = default; ---- === Description Any params, segments, iterators, or views which reference this object are invalidated. The underlying character buffer is destroyed, invalidating all references to it. [#boost-urls-static_url-2constructor] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::static_url Constructor === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url-2constructor-098[pass:[static_url]]() noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit xref:boost-urls-static_url-2constructor-08[pass:[static_url]](core::string_view s); ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url-2constructor-09f[pass:[static_url]](xref:boost-urls-static_url[static_url] const& u) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url-2constructor-0b[pass:[static_url]](xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description Default constructed urls contain a zero-length string. This matches the grammar for a relative-ref with an empty path and no query or fragment. [,cpp] ---- static_url< 1024 > u; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- === 4.2. Relative Reference (rfc3986) === Exceptions |=== | Name | Thrown on | `The` | input does not contain a valid url. | `Capacity` | would be exceeded. |=== === Parameters |=== | Name | Description | *s* | The string to parse. | *u* | The url to copy. |=== [#boost-urls-static_url-operator_assign] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::operator= Assignment === Synopsis [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& xref:boost-urls-static_url-operator_assign-06[pass:[operator=]](xref:boost-urls-static_url[static_url] const& u) noexcept; ---- [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& xref:boost-urls-static_url-operator_assign-0c[pass:[operator=]](xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description The contents of `u` are copied and the previous contents of `this` are discarded. Capacity remains unchanged. [,cpp] ---- this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data() ---- === Linear in `u.size()`. === Throws nothing. === Exceptions |=== | Name | Thrown on | `Capacity` | would be exceeded. |=== === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-static_url-set_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_scheme Set the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_scheme(core::string_view s); ---- === Description The scheme is set to the specified string, which must contain a valid scheme without any trailing colon (':'). Note that schemes are case-insensitive, and the canonical form is lowercased. [,cpp] ---- assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid scheme. |=== === Parameters |=== | Name | Description | *s* | The scheme to set. |=== === See Also xref:boost-urls-url_base-remove_scheme[remove_scheme] . [#boost-urls-static_url-set_scheme_id] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_scheme_id Set the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_scheme_id(xref:boost-urls[urls]::xref:boost-urls-scheme[scheme] id); ---- === Description This function sets the scheme to the specified known xref:boost-urls-scheme[urls::scheme] id, which may not be xref:boost-urls-scheme-unknown[scheme::unknown] or else an exception is thrown. If the id is xref:boost-urls-scheme-none[scheme::none] , this function behaves as if xref:boost-urls-url_base-remove_scheme[remove_scheme] were called. [,cpp] ---- assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" ); ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | scheme is invalid. |=== === Parameters |=== | Name | Description | *id* | The scheme to set. |=== [#boost-urls-static_url-remove_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::remove_scheme Remove the scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_scheme(); ---- === Description This function removes the scheme if it is present. [,cpp] ---- assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" ); ---- [,cpp] ---- this->has_scheme() == false && this->scheme_id() == scheme::none ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.1[ 3.1. Scheme (rfc3986)] === See Also xref:boost-urls-url_base-set_scheme[set_scheme] . [#boost-urls-static_url-set_encoded_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_authority Set the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_authority(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the authority to the specified string. The string may contain percent-escapes. [,cpp] ---- assert( url().set_encoded_authority( "My%20Computer" ).has_authority() ); ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) host = IP-literal / IPv4address / reg-name port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[ 3.2. Authority (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The authority string to set. |=== === See Also xref:boost-urls-url_base-remove_authority[remove_authority] . [#boost-urls-static_url-remove_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::remove_authority Remove the authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_authority(); ---- === Description This function removes the authority, which includes the userinfo, host, and a port if present. [,cpp] ---- assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" ); ---- [,cpp] ---- this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) host = IP-literal / IPv4address / reg-name port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[ 3.2. Authority (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_authority[set_encoded_authority] . [#boost-urls-static_url-set_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_userinfo Set the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_userinfo(core::string_view s); ---- === Description The userinfo is set to the given string, which may contain percent-escapes. Any special or reserved characters in the string are automatically percent-encoded. The effects on the user and password depend on the presence of a colon (':') in the string: * 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. In this case xref:boost-urls-url_view_base-has_password[has_password] returns true. Otherwise, * If there is no colon, the user is set to the string. The function xref:boost-urls-url_view_base-has_password[has_password] returns false. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_userinfo[remove_userinfo] , xref:boost-urls-url_base-set_encoded_userinfo[set_encoded_userinfo] . [#boost-urls-static_url-set_encoded_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_userinfo Set the userinfo. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_userinfo(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description The userinfo is set to the given string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The effects on the user and password depend on the presence of a colon (':') in the string: * 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. In this case xref:boost-urls-url_view_base-has_password[has_password] returns true. Otherwise, * If there is no colon, the user is set to the string. The function xref:boost-urls-url_view_base-has_password[has_password] returns false. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_userinfo[remove_userinfo] , xref:boost-urls-url_base-set_userinfo[set_userinfo] . [#boost-urls-static_url-remove_userinfo] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::remove_userinfo Remove the userinfo === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_userinfo() noexcept; ---- === Description This function removes the userinfo if present, without removing any authority. [,cpp] ---- assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false ); ---- [,cpp] ---- this->has_userinfo() == false && this->encoded_userinfo().empty == true ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_userinfo[set_encoded_userinfo] , xref:boost-urls-url_base-set_userinfo[set_userinfo] . [#boost-urls-static_url-set_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_user Set the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_user(core::string_view s); ---- === Description This function sets the user part of the userinfo to the string. Any special or reserved characters in the string are automatically percent-encoded. [,cpp] ---- assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" ); ---- [,cpp] ---- this->has_authority() == true && this->has_userinfo() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_password[set_password] . [#boost-urls-static_url-set_encoded_user] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_user Set the user === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_user(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the user part of the userinfo the the string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" ); ---- [,cpp] ---- this->has_authority() == true && this->has_userinfo() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_password[set_password] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-static_url-set_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_password Set the password. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_password(core::string_view s); ---- === Description This function sets the password in the userinfo to the string. Reserved characters in the string are percent-escaped in the result. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- [,cpp] ---- this->has_password() == true && this->password() == s ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. This string may contain any characters, including nulls. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-static_url-set_encoded_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_password Set the password. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_password(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the password in the userinfo to the string, which may contain percent-escapes. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- [,cpp] ---- this->has_password() == true ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. This string may contain any characters, including nulls. |=== === See Also xref:boost-urls-url_base-remove_password[remove_password] , xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-static_url-remove_password] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::remove_password Remove the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_password() noexcept; ---- === Description This function removes the password from the userinfo if a password exists. If there is no userinfo or no authority, the call has no effect. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" ); ---- [,cpp] ---- this->has_password() == false && this->encoded_password().empty() == true ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === See Also xref:boost-urls-url_base-set_encoded_password[set_encoded_password] , xref:boost-urls-url_base-set_encoded_user[set_encoded_user] , xref:boost-urls-url_base-set_password[set_password] , xref:boost-urls-url_base-set_user[set_user] . [#boost-urls-static_url-set_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_host Set the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_host(core::string_view s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_encoded_host] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_host Set the host === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_host(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture address enclosed in square brackets, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string. This string can contain percent escapes, or can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_host_address Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_host_address(core::string_view s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `s.size()`. === Strong guarantee. Calls to allocate may throw. [,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 / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_encoded_host_address] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_host_address Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_host_address(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description Depending on the contents of the passed string, this function sets the host: * If the string is a valid IPv4 address, then the host is set to the address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . * If the string is a valid IPv6 address, then the host is set to that address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . * If the string is a valid IPvFuture, then the host is set to that address. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . * Otherwise, the host name is set to the string. This string can contain percent escapes, or can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . In all cases, when this function returns, the URL contains an authority. [,cpp] ---- assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" ); ---- [,cpp] ---- this->has_authority() == true ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,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 / "-" / ".") ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_host_ipv4] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_host_ipv4 Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_host_ipv4(xref:boost-urls-ipv4_address[ipv4_address] const& addr); ---- === Description The host is set to the specified IPv4 address. The host type is xref:boost-urls-host_type-ipv4[host_type::ipv4] . [,cpp] ---- assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" ); ---- === Linear in `this->size()`. [,cpp] ---- this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4 ---- === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *addr* | The address to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_host_ipv6] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_host_ipv6 Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_host_ipv6(xref:boost-urls-ipv6_address[ipv6_address] const& addr); ---- === Description The host is set to the specified IPv6 address. The host type is xref:boost-urls-host_type-ipv6[host_type::ipv6] . [,cpp] ---- assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6 ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *addr* | The address to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_host_ipvfuture] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_host_ipvfuture Set the host to an address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_host_ipvfuture(core::string_view s); ---- === Description The host is set to the specified IPvFuture string. The host type is xref:boost-urls-host_type-ipvfuture[host_type::ipvfuture] . [,cpp] ---- assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" ); ---- === Linear in `this->size() + s.size()`. [,cpp] ---- this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_host_name Set the host to a name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_host_name(core::string_view s); ---- === Description The host is set to the specified string, which may be empty. Reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . [,cpp] ---- assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_encoded_host_name[set_encoded_host_name] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] . [#boost-urls-static_url-set_encoded_host_name] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_host_name Set the host to a name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_host_name(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description The host is set to the specified string, which may contain percent-escapes and can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. The host type is xref:boost-urls-host_type-name[host_type::name] . [,cpp] ---- assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" ); ---- [,cpp] ---- this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[ 3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-set_encoded_host[set_encoded_host] , xref:boost-urls-url_base-set_encoded_host_address[set_encoded_host_address] , xref:boost-urls-url_base-set_host[set_host] , xref:boost-urls-url_base-set_host_address[set_host_address] , xref:boost-urls-url_base-set_host_ipv4[set_host_ipv4] , xref:boost-urls-url_base-set_host_ipv6[set_host_ipv6] , xref:boost-urls-url_base-set_host_ipvfuture[set_host_ipvfuture] , xref:boost-urls-url_base-set_host_name[set_host_name] . [#boost-urls-static_url-set_port_number] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_port_number Set the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_port_number(std::uint16_t n); ---- === Description The port is set to the specified integer. [,cpp] ---- assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" ); ---- [,cpp] ---- this->has_authority() == true && this->has_port() == true && this->port_number() == n ---- === Linear in `this->size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === Parameters |=== | Name | Description | *n* | The port number to set. |=== === See Also xref:boost-urls-url_base-remove_port[remove_port] , xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-static_url-set_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_port Set the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_port(core::string_view s); ---- === Description This port is set to the string, which must contain only digits or be empty. An empty port string is distinct from having no port. [,cpp] ---- assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" ); ---- [,cpp] ---- this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n) ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | does not contain a valid port. |=== === Parameters |=== | Name | Description | *s* | The port string to set. |=== === See Also xref:boost-urls-url_base-remove_port[remove_port] , xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-static_url-remove_port] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::remove_port Remove the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_port() noexcept; ---- === Description If a port exists, it is removed. The rest of the authority is unchanged. [,cpp] ---- assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" ); ---- [,cpp] ---- this->has_port() == false && this->port_number() == 0 && this->port() == "" ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[ 3.2.3. Port (rfc3986)] === See Also xref:boost-urls-url_base-set_port[set_port] . [#boost-urls-static_url-set_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_path Set the path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_path(core::string_view s); ---- === Description This function sets the path to the string, which may be empty. Reserved characters in the string are percent-escaped in the result. [NOTE] The library may adjust the final result to ensure that no other parts of the url is semantically affected. [NOTE] This function does not encode '/' chars, which are unreserved for paths but reserved for path segments. If a path segment should include encoded '/'s to differentiate it from path separators, the functions xref:boost-urls-url_base-set_encoded_path[set_encoded_path] or xref:boost-urls-url_base-segments-04[segments] should be used instead. [,cpp] ---- url u( "http://www.example.com" ); u.set_path( "path/to/file.txt" ); assert( u.path() == "/path/to/file.txt" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-segments-04[segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-static_url-set_encoded_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_path Set the path. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_path(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the path to the string, which may contain percent-escapes and can be empty. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [NOTE] The library may adjust the final result to ensure that no other parts of the url is semantically affected. [,cpp] ---- url u( "http://www.example.com" ); u.set_encoded_path( "path/to/file.txt" ); assert( u.encoded_path() == "/path/to/file.txt" ); ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-segments-04[segments] , xref:boost-urls-url_base-set_path[set_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-static_url-set_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_query Set the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_query(core::string_view s); ---- === Description This sets the query to the string, which can be empty. An empty query is distinct from having no query. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true && this->query() == s ---- === Strong guarantee. Calls to allocate may throw. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] . [#boost-urls-static_url-set_encoded_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_query Set the query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_query(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This sets the query to the string, which may contain percent-escapes and can be empty. An empty query is distinct from having no query. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true && this->query() == decode_view( s ); ---- === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-static_url-set_params] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_params Set the query params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_params( std::initializer_list ps, xref:boost-urls-encoding_opts[encoding_opts] opts = = {}); ---- === Description This sets the query params to the list of param_view, which can be empty. An empty list of params is distinct from having no params. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" ); ---- [,cpp] ---- this->has_query() == true ---- === Strong guarantee. Calls to allocate may throw. === Linear. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_query() noexcept; ---- === Description If a query is present, it is removed. An empty query is distinct from having no query. [,cpp] ---- assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" ); ---- [,cpp] ---- this->has_query() == false && this->params().empty() ---- === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-static_url-remove_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::remove_fragment Remove the fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_fragment() noexcept; ---- === Description This function removes the fragment. An empty fragment is distinct from having no fragment. [,cpp] ---- assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" ); ---- [,cpp] ---- this->has_fragment() == false && this->encoded_fragment() == "" ---- === Constant. === Throws nothing. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_encoded_fragment[set_encoded_fragment] , xref:boost-urls-url_base-set_fragment[set_fragment] . [#boost-urls-static_url-set_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_fragment Set the fragment. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_fragment(core::string_view s); ---- === Description This function sets the fragment to the specified string, which may be empty. An empty fragment is distinct from having no fragment. Reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" ); ---- [,cpp] ---- this->has_fragment() == true && this->fragment() == s ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_encoded_fragment[set_encoded_fragment] . [#boost-urls-static_url-set_encoded_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::set_encoded_fragment Set the fragment. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& set_encoded_fragment(xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function sets the fragment to the specified string, which may contain percent-escapes and which may be empty. An empty fragment is distinct from having no fragment. Escapes in the string are preserved, and reserved characters in the string are percent-escaped in the result. [,cpp] ---- assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" ); ---- [,cpp] ---- this->has_fragment() == true && this->fragment() == decode_view( s ) ---- === Linear in `this->size() + s.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- fragment = *( pchar / "/" / "?" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.5[3.5. Fragment] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *s* | The string to set. |=== === See Also xref:boost-urls-url_base-remove_fragment[remove_fragment] , xref:boost-urls-url_base-set_fragment[set_fragment] . [#boost-urls-static_url-remove_origin] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::remove_origin Remove the origin component === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& remove_origin(); ---- === Description This function removes the origin, which consists of the scheme and authority. [,cpp] ---- assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" ); ---- [,cpp] ---- this->scheme_id() == scheme::none && this->has_authority() == false ---- === Linear in `this->size()`. === Throws nothing. [#boost-urls-static_url-normalize] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::normalize Normalize the URL components === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& normalize(); ---- === Description Applies Syntax-based normalization to all components of the URL. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-static_url-normalize_scheme] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::normalize_scheme Normalize the URL scheme === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& normalize_scheme(); ---- === Description Applies Syntax-based normalization to the URL scheme. The scheme is normalized to lowercase. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-static_url-normalize_authority] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::normalize_authority Normalize the URL authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& normalize_authority(); ---- === Description Applies Syntax-based normalization to the URL authority. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-static_url-normalize_path] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::normalize_path Normalize the URL path === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& normalize_path(); ---- === Description Applies Syntax-based normalization to the URL path. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. Redundant path-segments are removed. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-static_url-normalize_query] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::normalize_query Normalize the URL query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& normalize_query(); ---- === Description Applies Syntax-based normalization to the URL query. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-static_url-normalize_fragment] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::normalize_fragment Normalize the URL fragment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& normalize_fragment(); ---- === Description Applies Syntax-based normalization to the URL fragment. Percent-encoding triplets are normalized to uppercase letters. Percent-encoded octets that correspond to unreserved characters are decoded. === Strong guarantee. Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] [#boost-urls-static_url_base] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::static_url_base Common implementation for all static URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- class static_url_base : public xref:boost-urls-url_base[url_base]; ---- === Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-authority[`authority`] ¦ Return the authority ¦xref:boost-urls-url_view_base-buffer[`buffer`] ¦ Return the url string ¦xref:boost-urls-url_base-c_str[`c_str`] ¦ Return the url as a null-terminated string ¦xref:boost-urls-url_base-capacity[`capacity`] ¦ Return the number of characters that can be stored without reallocating ¦xref:boost-urls-url_base-clear[`clear`] ¦ Clear the contents while preserving the capacity ¦xref:boost-urls-url_view_base-compare[`compare`] ¦ Return the result of comparing this with another url ¦xref:boost-urls-url_view_base-data[`data`] ¦ Return a pointer to the url's character buffer ¦xref:boost-urls-url_view_base-empty[`empty`] ¦ Return true if the url is empty ¦xref:boost-urls-url_view_base-encoded_authority[`encoded_authority`] ¦ Return the authority. ¦xref:boost-urls-url_view_base-encoded_fragment[`encoded_fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-encoded_host[`encoded_host`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_address[`encoded_host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-encoded_host_and_port[`encoded_host_and_port`] ¦ Return the host and port ¦xref:boost-urls-url_view_base-encoded_host_name[`encoded_host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-encoded_origin[`encoded_origin`] ¦ Return the origin ¦xref:boost-urls-url_view_base-encoded_params[`encoded_params`] ¦ Return the query as a container of parameters ¦xref:boost-urls-url_view_base-encoded_password[`encoded_password`] ¦ Return the password ¦xref:boost-urls-url_view_base-encoded_path[`encoded_path`] ¦ Return the path ¦xref:boost-urls-url_view_base-encoded_query[`encoded_query`] ¦ Return the query ¦xref:boost-urls-url_view_base-encoded_resource[`encoded_resource`] ¦ Return the resource ¦xref:boost-urls-url_view_base-encoded_segments[`encoded_segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_view_base-encoded_target[`encoded_target`] ¦ Return the target ¦xref:boost-urls-url_view_base-encoded_user[`encoded_user`] ¦ Return the user ¦xref:boost-urls-url_view_base-encoded_userinfo[`encoded_userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-encoded_zone_id[`encoded_zone_id`] ¦ Return the IPv6 Zone ID ¦xref:boost-urls-url_view_base-fragment[`fragment`] ¦ Return the fragment ¦xref:boost-urls-url_view_base-has_authority[`has_authority`] ¦ Return true if an authority is present ¦xref:boost-urls-url_view_base-has_fragment[`has_fragment`] ¦ Return true if a fragment is present ¦xref:boost-urls-url_view_base-has_password[`has_password`] ¦ Return true if a password is present ¦xref:boost-urls-url_view_base-has_port[`has_port`] ¦ Return true if a port is present ¦xref:boost-urls-url_view_base-has_query[`has_query`] ¦ Return true if a query is present ¦xref:boost-urls-url_view_base-has_scheme[`has_scheme`] ¦ Return true a scheme is present ¦xref:boost-urls-url_view_base-has_userinfo[`has_userinfo`] ¦ Return true if a userinfo is present ¦xref:boost-urls-url_view_base-host[`host`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_address[`host_address`] ¦ Return the host ¦xref:boost-urls-url_view_base-host_ipv4_address[`host_ipv4_address`] ¦ Return the host IPv4 address ¦xref:boost-urls-url_view_base-host_ipv6_address[`host_ipv6_address`] ¦ Return the host IPv6 address ¦xref:boost-urls-url_view_base-host_ipvfuture[`host_ipvfuture`] ¦ Return the host IPvFuture address ¦xref:boost-urls-url_view_base-host_name[`host_name`] ¦ Return the host name ¦xref:boost-urls-url_view_base-host_type[`host_type`] ¦ Return the host type ¦xref:boost-urls-url_view_base-is_path_absolute[`is_path_absolute`] ¦ Return true if the path is absolute ¦xref:boost-urls-url_base-normalize[`normalize`] ¦ Normalize the URL components ¦xref:boost-urls-url_base-normalize_authority[`normalize_authority`] ¦ Normalize the URL authority ¦xref:boost-urls-url_base-normalize_fragment[`normalize_fragment`] ¦ Normalize the URL fragment ¦xref:boost-urls-url_base-normalize_path[`normalize_path`] ¦ Normalize the URL path ¦xref:boost-urls-url_base-normalize_query[`normalize_query`] ¦ Normalize the URL query ¦xref:boost-urls-url_base-normalize_scheme[`normalize_scheme`] ¦ Normalize the URL scheme ¦xref:boost-urls-url_view_base-2conversion[`operator core::string_view`] ¦ Return the URL as a core::string_view ¦xref:boost-urls-url_view_base-params[`params`] ¦ Return the query as a container of parameters xref:boost-urls-url_view_base-params-05[url_view_base::params] ¦xref:boost-urls-url_view_base-password[`password`] ¦ Return the password ¦xref:boost-urls-url_view_base-path[`path`] ¦ Return the path ¦xref:boost-urls-url_view_base-persist[`persist`] ¦ Return a shared, persistent copy of the url ¦xref:boost-urls-url_view_base-port[`port`] ¦ Return the port ¦xref:boost-urls-url_view_base-port_number[`port_number`] ¦ Return the port ¦xref:boost-urls-url_view_base-query[`query`] ¦ Return the query ¦xref:boost-urls-url_base-remove_authority[`remove_authority`] ¦ Remove the authority ¦xref:boost-urls-url_base-remove_fragment[`remove_fragment`] ¦ Remove the fragment ¦xref:boost-urls-url_base-remove_origin[`remove_origin`] ¦ Remove the origin component ¦xref:boost-urls-url_base-remove_password[`remove_password`] ¦ Remove the password ¦xref:boost-urls-url_base-remove_port[`remove_port`] ¦ Remove the port ¦xref:boost-urls-url_base-remove_query[`remove_query`] ¦ Remove the query ¦xref:boost-urls-url_base-remove_scheme[`remove_scheme`] ¦ Remove the scheme ¦xref:boost-urls-url_base-remove_userinfo[`remove_userinfo`] ¦ Remove the userinfo ¦xref:boost-urls-url_base-reserve[`reserve`] ¦ Adjust the capacity without changing the size ¦xref:boost-urls-url_base-resolve[`resolve`] ¦ Resolve a URL reference against this base URL ¦xref:boost-urls-url_view_base-scheme[`scheme`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-scheme_id[`scheme_id`] ¦ Return the scheme ¦xref:boost-urls-url_view_base-segments[`segments`] ¦ Return the path as a container of segments ¦xref:boost-urls-url_base-set_encoded_authority[`set_encoded_authority`] ¦ Set the authority ¦xref:boost-urls-url_base-set_encoded_fragment[`set_encoded_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_encoded_host[`set_encoded_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_encoded_host_address[`set_encoded_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_encoded_host_name[`set_encoded_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_encoded_params[`set_encoded_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_encoded_password[`set_encoded_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_encoded_path[`set_encoded_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_encoded_query[`set_encoded_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_encoded_user[`set_encoded_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_encoded_userinfo[`set_encoded_userinfo`] ¦ Set the userinfo. ¦xref:boost-urls-url_base-set_fragment[`set_fragment`] ¦ Set the fragment. ¦xref:boost-urls-url_base-set_host[`set_host`] ¦ Set the host ¦xref:boost-urls-url_base-set_host_address[`set_host_address`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv4[`set_host_ipv4`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipv6[`set_host_ipv6`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_ipvfuture[`set_host_ipvfuture`] ¦ Set the host to an address ¦xref:boost-urls-url_base-set_host_name[`set_host_name`] ¦ Set the host to a name ¦xref:boost-urls-url_base-set_params[`set_params`] ¦ Set the query params ¦xref:boost-urls-url_base-set_password[`set_password`] ¦ Set the password. ¦xref:boost-urls-url_base-set_path[`set_path`] ¦ Set the path. ¦xref:boost-urls-url_base-set_path_absolute[`set_path_absolute`] ¦ Set if the path is absolute ¦xref:boost-urls-url_base-set_port[`set_port`] ¦ Set the port ¦xref:boost-urls-url_base-set_port_number[`set_port_number`] ¦ Set the port ¦xref:boost-urls-url_base-set_query[`set_query`] ¦ Set the query ¦xref:boost-urls-url_base-set_scheme[`set_scheme`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_scheme_id[`set_scheme_id`] ¦ Set the scheme ¦xref:boost-urls-url_base-set_user[`set_user`] ¦ Set the user ¦xref:boost-urls-url_base-set_userinfo[`set_userinfo`] ¦ Set the userinfo ¦xref:boost-urls-url_view_base-size[`size`] ¦ Return the number of characters in the url ¦xref:boost-urls-url_view_base-user[`user`] ¦ Return the user ¦xref:boost-urls-url_view_base-userinfo[`userinfo`] ¦ Return the userinfo ¦xref:boost-urls-url_view_base-zone_id[`zone_id`] ¦ Return the IPv6 Zone ID |=== === Static Member Functions [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-max_size[`max_size`] ¦ Return the maximum number of characters possible |=== === Friends [cols=2,separator=¦] |=== ¦Name ¦Description ¦xref:boost-urls-url_view_base-08friend-02[`operator!=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-05[`operator<`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-0f[`operator<<`] ¦ Format the url to the output stream ¦xref:boost-urls-url_view_base-08friend-04[`operator<=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-07c[`operator==`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-073[`operator>`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_view_base-08friend-06[`operator>=`] ¦ Return the result of comparing two URLs ¦xref:boost-urls-url_base-08friend[`resolve`] ¦ Resolve a URL reference against a base URL |=== === Description This base class is used by the library to provide common functionality for static URLs. Users should not use this class directly. Instead, construct an instance of one of the containers or call a parsing function. * xref:boost-urls-url[url] * xref:boost-urls-url_view[url_view] * xref:boost-urls-static_url[static_url] * xref:boost-urls-parse_absolute_uri[parse_absolute_uri] * xref:boost-urls-parse_origin_form[parse_origin_form] * xref:boost-urls-parse_relative_ref[parse_relative_ref] * xref:boost-urls-parse_uri[parse_uri] * xref:boost-urls-parse_uri_reference[parse_uri_reference] [#boost-urls-string_view] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::string_view The type of string_view used by the library === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using string_view = xref:boost[boost]::core::string_view; ---- === Description String views are used to pass character buffers into or out of functions. Ownership of the underlying character buffer is not transferred; the caller is responsible for ensuring that the lifetime of character buffer extends until it is no longer referenced. [WARNING] This alias is no longer supported and should not be used in new code. Please use `core::string_view` instead. This alias is included for backwards compatibility with earlier versions of the library. However, it will be removed in future releases, and using it in new code is not recommended. Please use the updated version instead to ensure compatibility with future versions of the library. [#boost-urls-absolute_uri_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::absolute_uri_rule Rule for absolute-URI === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] absolute_uri_rule = {}; ---- === Description [,cpp] ---- using value_type = url_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< url_view > rv = grammar::parse( "http://example.com/index.htm?id=1", absolute_uri_rule ); ---- [,cpp] ---- absolute-URI = scheme ":" hier-part [ "?" query ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.3[4.3. Absolute URI (rfc3986)] === See Also xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-parse_absolute_uri[parse_absolute_uri] , xref:boost-urls-url_view[url_view] . [#boost-urls-authority_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::authority_rule Rule for authority === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] authority_rule = {}; ---- === Description [,cpp] ---- using value_type = authority_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< authority_view > rv = grammar::parse( "user:pass@example.com:8080", authority_rule ); ---- [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] === See Also xref:boost-urls-authority_view[authority_view] , xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-parse_authority[parse_authority] . [#boost-urls-gen_delim_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::gen_delim_chars The gen-delims character set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar[grammar]::xref:boost-urls-grammar-lut_chars[lut_chars] const gen_delim_chars = ":/?#[]@"; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[grammar::find_if] and xref:boost-urls-grammar-find_if_not[grammar::find_if_not] . [,cpp] ---- system::result< decode_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( gen_delim_chars ) ); ---- [,cpp] ---- gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.2[2.2. Reserved Characters (rfc3986)] === See Also xref:boost-urls-grammar-find_if[grammar::find_if] , xref:boost-urls-grammar-find_if_not[grammar::find_if_not] , xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-pct_encoded_rule[pct_encoded_rule] . [#boost-urls-ipv4_address_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::ipv4_address_rule Rule for an IP version 4 style address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] ipv4_address_rule = {}; ---- === Description [,cpp] ---- using value_type = ipv4_address; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< ipv4_address > rv = grammar::parse( "192.168.0.1", ipv4_address_rule ); ---- [,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 ---- * link:https://en.wikipedia.org/wiki/IPv4[IPv4 (Wikipedia)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] === See Also xref:boost-urls-ipv4_address[ipv4_address] , xref:boost-urls-parse_ipv4_address[parse_ipv4_address] , xref:boost-urls-grammar-parse-02[grammar::parse] . [#boost-urls-ipv6_address_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::ipv6_address_rule Rule for An IP version 6 style address === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] ipv6_address_rule = {}; ---- === Description [,cpp] ---- using value_type = ipv6_address; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< ipv6_address > rv = grammar::parse( "2001:0db8:85a3:0000:0000:8a2e:0370:7334", ipv6_address_rule ); ---- [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc4291[IP Version 6 Addressing Architecture (rfc4291)] * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] === See Also xref:boost-urls-ipv6_address[ipv6_address] , xref:boost-urls-parse_ipv6_address[parse_ipv6_address] , xref:boost-urls-grammar-parse-02[grammar::parse] . [#boost-urls-origin_form_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::origin_form_rule Rule for origin-form === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr origin_form_rule_t const origin_form_rule = {}; ---- === Description This appears in the HTTP/1 request-line grammar. [,cpp] ---- using value_type = url_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< url_view > rv = grammar::parse( "/index.htm?layout=mobile", origin_form_rule ); ---- [,cpp] ---- origin-form = absolute-path [ "?" query ] absolute-path = 1*( "/" segment ) ---- * link:https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1[5.3.1. origin-form (rfc7230)] === See Also xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-parse_origin_form[parse_origin_form] , xref:boost-urls-url_view[url_view] . [#boost-urls-sub_delim_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::sub_delim_chars The sub-delims character set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar[grammar]::xref:boost-urls-grammar-lut_chars[lut_chars] const sub_delim_chars = "!$&()*+,;=\x27"; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[grammar::find_if] and xref:boost-urls-grammar-find_if_not[grammar::find_if_not] . [,cpp] ---- system::result< decode_view > = grammar::parse( "Program%20Files", pct_encoded_rule( sub_delim_chars ) ); ---- [,cpp] ---- sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.2[2.2. Reserved Characters (rfc3986)] === See Also xref:boost-urls-grammar-find_if[grammar::find_if] , xref:boost-urls-grammar-find_if_not[grammar::find_if_not] , xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-pct_encoded_rule[pct_encoded_rule] . [#boost-urls-unreserved_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::unreserved_chars The unreserved character set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar[grammar]::xref:boost-urls-grammar-lut_chars[lut_chars] const unreserved_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789" "-._~"; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[grammar::find_if] and xref:boost-urls-grammar-find_if_not[grammar::find_if_not] . [,cpp] ---- system::result< decode_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( unreserved_chars ) ); ---- [,cpp] ---- unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.3[2.3. Unreserved Characters (rfc3986)] === See Also xref:boost-urls-grammar-find_if[grammar::find_if] , xref:boost-urls-grammar-find_if_not[grammar::find_if_not] , xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-pct_encoded_rule[pct_encoded_rule] . [#boost-urls-pchars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::pchars The path character set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr auto const pchars = unreserved_chars + sub_delim_chars + ':' + '@'; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[grammar::find_if] and xref:boost-urls-grammar-find_if_not[grammar::find_if_not] . [,cpp] ---- system::result< decode_view > rv = grammar::parse( "Program%20Files", pchars ); ---- [,cpp] ---- pchar = unreserved / pct-encoded / sub-delims / ":" / "@" ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-grammar-find_if[grammar::find_if] , xref:boost-urls-grammar-find_if_not[grammar::find_if_not] , xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-pct_encoded_rule[pct_encoded_rule] . [#boost-urls-pct_encoded_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::pct_encoded_rule Rule for a string with percent-encoded escapes === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] pct_encoded_rule(CharSet const& cs) noexcept; ---- === Description This function returns a rule which matches a percent-encoded string, permitting characters in the string which are also in the specified character set to be used unescaped. [,cpp] ---- using value_type = pct_string_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- // pchar = unreserved / pct-encoded / sub-delims / ":" / "@" system::result< pct_string_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( pchars ) ); ---- [,cpp] ---- pct-encoded = "%" HEXDIG HEXDIG ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[ 2.1. Percent-Encoding (rfc3986)] === Parameters |=== | Name | Description | *cs* | The character set indicating which characters are allowed without escapes. Any character which is not in this set must be escaped, or else parsing returns an error. |=== === See Also xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-pchars[pchars] , xref:boost-urls-pct_string_view[pct_string_view] . [#boost-urls-query_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::query_rule Rule for query === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] query_rule = {}; ---- === Description [,cpp] ---- using value_type = params_encoded_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< params_encoded_view > rv = grammar::parse( "format=web&id=42&compact", query_rule ); ---- [,cpp] ---- query = *( pchar / "/" / "?" ) query-params = [ query-param ] *( "&" query-param ) query-param = key [ "=" value ] key = *qpchar value = *( qpchar / "=" ) qpchar = unreserved / pct-encoded / "!" / "$" / "'" / "(" / ")" / "*" / "+" / "," / ";" / ":" / "@" / "/" / "?" ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] === See Also xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-params_encoded_view[params_encoded_view] . [#boost-urls-relative_ref_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::relative_ref_rule Rule for relative-ref === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] relative_ref_rule = {}; ---- === Description [,cpp] ---- using value_type = url_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< url_view > rv = grammar::parse( "images/dot.gif?v=hide#a", relative_ref_rule ); ---- [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4.2. Relative Reference (rfc3986)] === See Also xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-parse_relative_ref[parse_relative_ref] , xref:boost-urls-url_view[url_view] . [#boost-urls-reserved_chars] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::reserved_chars The reserved character set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr auto const reserved_chars = ~unreserved_chars; ---- === Description === Character sets are used with rules and the functions xref:boost-urls-grammar-find_if[grammar::find_if] and xref:boost-urls-grammar-find_if_not[grammar::find_if_not] . [,cpp] ---- system::result< decode_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( reserved_chars ) ); ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.3[2.3. Unreserved Characters (rfc3986)] === See Also xref:boost-urls-grammar-find_if[grammar::find_if] , xref:boost-urls-grammar-find_if_not[grammar::find_if_not] , xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-pct_encoded_rule[pct_encoded_rule] . [#boost-urls-uri_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::uri_rule Rule for URI === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] uri_rule = {}; ---- === Description [,cpp] ---- using value_type = url_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< url_view > rv = grammar::parse( "https://www.example.com/index.htm?id=guest#s1", uri_rule ); ---- [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3[3. Syntax Components (rfc3986)] === See Also xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-parse_uri[parse_uri] , xref:boost-urls-url_view[url_view] . [#boost-urls-uri_reference_rule] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::uri_reference_rule Rule for URI-reference === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] uri_reference_rule = {}; ---- === Description [,cpp] ---- using value_type = url_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[grammar::parse] . [,cpp] ---- system::result< url_view > rv = grammar::parse( "ws://echo.example.com/?name=boost#demo", uri_reference_rule ); ---- [,cpp] ---- URI-reference = URI / relative-ref URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3[3. Syntax Components (rfc3986)] === See Also xref:boost-urls-grammar-parse-02[grammar::parse] , xref:boost-urls-parse_uri_reference[parse_uri_reference] , xref:boost-urls-url_view[url_view] . [#boost-url] == xref:boost[pass:[boost]]::url === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using xref:boost-urls[urls]::url; ---- === Introduced Symbols |=== | Name | url |=== [#boost-url_view] == xref:boost[pass:[boost]]::url_view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- using xref:boost-urls[urls]::url_view; ---- === Introduced Symbols |=== | Name | url_view |=== [#boost-urls-grammar-see_below-aligned_storage_impl-addr-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-aligned_storage_impl[pass:[aligned_storage_impl]]::addr === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void* addr() noexcept; ---- [#boost-urls-grammar-see_below-aligned_storage_impl-addr-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-see_below[pass:[see_below]]::xref:boost-urls-grammar-see_below-aligned_storage_impl[pass:[aligned_storage_impl]]::addr === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void const* addr() const noexcept; ---- [#boost-urls-grammar-ref-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ref Return a reference to a character set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] ref(CharSet const& cs) noexcept; ---- === Description This function returns a character set which references the specified object. This is used to reduce the number of bytes of storage (`sizeof`) required by a combinator when it stores a copy of the object. Ownership of the object is not transferred; the caller is responsible for ensuring the lifetime of the object is extended until it is no longer referenced. For best results, `ref` should only be used with compile-time constants. [#boost-urls-grammar-ref-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ref Return a reference to a rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] ref(Rule const& r) noexcept; ---- === Description This function returns a rule which references the specified object. This is used to reduce the number of bytes of storage (`sizeof`) required by a combinator when it stores a copy of the object. Ownership of the object is not transferred; the caller is responsible for ensuring the lifetime of the object is extended until it is no longer referenced. For best results, `ref` should only be used with compile-time constants. === Parameters |=== | Name | Description | *r* | The rule to use |=== [#boost-urls-grammar-ci_is_equal-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_is_equal Return true if s0 equals s1 using case-insensitive comparison === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class String0, class String1> bool ci_is_equal( String0 const& s0, String1 const& s1); ---- === Description The function is defined only for strings containing low-ASCII characters. [,cpp] ---- assert( ci_is_equal( "Boost", "boost" ) ); ---- === See Also xref:boost-urls-grammar-ci_compare[ci_compare] , xref:boost-urls-grammar-ci_is_less[ci_is_less] . [#boost-urls-grammar-ci_is_equal-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::ci_is_equal Return true if s0 equals s1 using case-insensitive comparison === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool ci_is_equal( core::string_view s0, core::string_view s1) noexcept; ---- === Description The function is defined only for strings containing low-ASCII characters. [,cpp] ---- assert( ci_is_equal( "Boost", "boost" ) ); ---- === See Also xref:boost-urls-grammar-ci_compare[ci_compare] , xref:boost-urls-grammar-ci_is_less[ci_is_less] . [#boost-urls-grammar-delim_rule-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::delim_rule Match a character literal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pass:q[_implementation-defined_] delim_rule(char ch) noexcept; ---- === Description This matches the specified character. The value is a reference to the character in the underlying buffer, expressed as a `core::string_view`. The function xref:boost-urls-grammar-squelch[squelch] may be used to turn this into `void` instead. If there is no more input, the error code xref:boost-urls-grammar-error-need_more[error::need_more] is returned. [,cpp] ---- using value_type = core::string_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- system::result< core::string_view > rv = parse( ".", delim_rule('.') ); ---- [,cpp] ---- char = %00-FF ---- === Parameters |=== | Name | Description | *ch* | The character to match |=== === See Also xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-squelch[squelch] . [#boost-urls-grammar-delim_rule-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::delim_rule Match a single character from a character set === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] delim_rule(CharSet const& cs) noexcept; ---- === Description This matches exactly one character which belongs to the specified character set. The value is a reference to the character in the underlying buffer, expressed as a `core::string_view`. The function xref:boost-urls-grammar-squelch[squelch] may be used to turn this into `void` instead. If there is no more input, the error code xref:boost-urls-grammar-error-need_more[error::need_more] is returned. [,cpp] ---- using value_type = core::string_view; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- system::result< core::string_view > rv = parse( "X", delim_rule( alpha_chars ) ); ---- === Parameters |=== | Name | Description | *cs* | The character set to use. |=== === See Also xref:boost-urls-grammar-alpha_chars[alpha_chars] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-squelch[squelch] . [#boost-urls-grammar-lut_chars-operator_call-0fe] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::operator() Return true if ch is in the character set. === Synopsis Declared in header `` [source,cpp,subs="verbatim,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. === Constant. === Throws nothing. === Parameters |=== | Name | Description | *ch* | The character to test. |=== [#boost-urls-grammar-lut_chars-operator_call-0f6] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::operator() Return true if ch is in the character set. === Synopsis Declared in header `` [source,cpp,subs="verbatim,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. === Constant. === Throws nothing. === Parameters |=== | Name | Description | *ch* | The character to test. |=== [#boost-urls-grammar-parse-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::parse Parse a character buffer using a rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template system::result parse( char const*& it, char const* end, Rule const& r); ---- === Return Value The parsed value upon success, otherwise an error. === Parameters |=== | Name | Description | *it* | A pointer to the start. The caller's variable is changed to reflect the amount of input consumed. | *end* | A pointer to the end. | *r* | The rule to use |=== [#boost-urls-grammar-parse-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::parse Parse a character buffer using a rule === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template system::result parse( core::string_view s, Rule const& r); ---- === Description This function parses a complete string into the specified sequence of rules. If the string is not completely consumed, an error is returned instead. === Return Value The parsed value upon success, otherwise an error. === Parameters |=== | Name | Description | *s* | The input string | *r* | The rule to use |=== [#boost-urls-grammar-lut_chars-2constructor-079] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::lut_chars Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr lut_chars(char ch) noexcept; ---- === Description This function constructs a character set which has as a single member, the character `ch`. [,cpp] ---- constexpr lut_chars asterisk( '*' ); ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *ch* | A character. |=== [#boost-urls-grammar-lut_chars-2constructor-074] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::lut_chars Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr lut_chars(char const* s) noexcept; ---- === Description This function constructs a character set which has as members, all of the characters present in the null-terminated string `s`. [,cpp] ---- constexpr lut_chars digits = "0123456789"; ---- === Linear in `::strlen(s)`, or constant if `s` is a constant expression. === Throws nothing. === Parameters |=== | Name | Description | *s* | A null-terminated string. |=== [#boost-urls-grammar-lut_chars-2constructor-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-lut_chars[pass:[lut_chars]]::lut_chars === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class Pred, class = void> constexpr lut_chars(Pred const& pred) noexcept; ---- [#boost-urls-grammar-range-iterator-2constructor-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- iterator() = default; ---- [#boost-urls-grammar-range-iterator-2constructor-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- iterator(xref:boost-urls-grammar-range-iterator[iterator] const&) = default; ---- [#boost-urls-grammar-range-iterator-operator_inc-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator[iterator]& operator++() noexcept; ---- [#boost-urls-grammar-range-iterator-operator_inc-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::xref:boost-urls-grammar-range-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range-iterator[iterator] operator++(int) noexcept; ---- [#boost-urls-grammar-range-2constructor-01e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::range Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- range() noexcept; ---- === Description Default-constructed ranges have zero elements. === Throws nothing. [#boost-urls-grammar-range-2constructor-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::range Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- range(xref:boost-urls-grammar-range[range]&& other) noexcept; ---- === Description The new range references the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. The moved-from object becomes as if default-constructed. === Throws nothing. [#boost-urls-grammar-range-2constructor-01b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::range Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- range(xref:boost-urls-grammar-range[range] const& other) noexcept; ---- === Description The copy references the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. === Throws nothing. [#boost-urls-grammar-range-operator_assign-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range[range]& operator=(xref:boost-urls-grammar-range[range]&& other) noexcept; ---- === Description After the move, this references the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. The moved-from object becomes as if default-constructed. === Throws nothing. [#boost-urls-grammar-range-operator_assign-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-range[pass:[range]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-range[range]& operator=(xref:boost-urls-grammar-range[range] const& other) noexcept; ---- === Description The copy references the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. === Throws nothing. [#boost-urls-grammar-recycled_ptr-operator_assign-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr[recycled_ptr]& operator=(xref:boost-urls-grammar-recycled_ptr[recycled_ptr]&& other) noexcept; ---- === Description If `other` references an object, ownership is transferred including a reference to the recycle bin. After the move, the moved-from object is empty. [,cpp] ---- this->release() ---- [,cpp] ---- &this->bin() == &other->bin() ---- === Throws nothing. === Parameters |=== | Name | Description | *other* | The pointer to move from |=== [#boost-urls-grammar-recycled_ptr-operator_assign-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-grammar-recycled_ptr[recycled_ptr]& operator=(xref:boost-urls-grammar-recycled_ptr[recycled_ptr] const& other) noexcept; ---- === Description If `other` references an object, this acquires shared ownership and references the same recycle bin as `other`. The previous object if any is released. [,cpp] ---- this->release() ---- [,cpp] ---- &this->bin() == &other->bin() && this->get() == other.get() ---- === Throws nothing. === Parameters |=== | Name | Description | *other* | The pointer to copy from |=== [#boost-urls-grammar-recycled_ptr-2constructor-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::recycled_ptr Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit recycled_ptr(xref:boost-urls-grammar-recycled[recycled]& 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. The object is in an unknown but valid state. [,cpp] ---- static recycled< std::string > bin; recycled_ptr< std::string > ps( bin ); // Put the string into a known state ps->clear(); ---- [,cpp] ---- &this->bin() == &bin && ! this->empty() ---- === Parameters |=== | Name | Description | *bin* | The recycle bin to use |=== === See Also xref:boost-urls-grammar-recycled[recycled] . [#boost-urls-grammar-recycled_ptr-2constructor-0ac] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::recycled_ptr Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- recycled_ptr( xref:boost-urls-grammar-recycled[recycled]& bin, std::nullptr_t) noexcept; ---- === Description After construction, this is empty and refers to the specified recycle bin. [,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(); ---- [,cpp] ---- &this->bin() == &bin && this->empty() ---- === Throws nothing. === Parameters |=== | Name | Description | *bin* | The recycle bin to use |=== === See Also xref:boost-urls-grammar-recycled_ptr-acquire[acquire] , xref:boost-urls-grammar-recycled[recycled] , xref:boost-urls-grammar-recycled_ptr-release[release] . [#boost-urls-grammar-recycled_ptr-2constructor-056] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::recycled_ptr Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- recycled_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. The object is in an unknown but valid state. [,cpp] ---- recycled_ptr< std::string > ps; // Put the string into a known state ps->clear(); ---- [,cpp] ---- &this->bin() != nullptr && ! this->empty() ---- === See Also xref:boost-urls-grammar-recycled[recycled] . [#boost-urls-grammar-recycled_ptr-2constructor-05e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::recycled_ptr Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- recycled_ptr(std::nullptr_t) noexcept; ---- === Description After construction, this is empty and refers to a global recycle bin. [,cpp] ---- recycled_ptr< std::string > ps( nullptr ); // Acquire a string and put it into a known state ps->acquire(); ps->clear(); ---- [,cpp] ---- &this->bin() != nullptr && this->empty() ---- === Throws nothing. === See Also xref:boost-urls-grammar-recycled_ptr-acquire[acquire] , xref:boost-urls-grammar-recycled[recycled] , xref:boost-urls-grammar-recycled_ptr-release[release] . [#boost-urls-grammar-recycled_ptr-2constructor-0ab] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::recycled_ptr Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- recycled_ptr(xref:boost-urls-grammar-recycled_ptr[recycled_ptr] const& other) noexcept; ---- === Description If `other` references an object, the newly constructed pointer acquires shared ownership. Otherwise this is empty. The new pointer references the same recycle bin as `other`. [,cpp] ---- &this->bin() == &other->bin() && this->get() == other.get() ---- === Throws nothing. === Parameters |=== | Name | Description | *other* | The pointer to copy |=== [#boost-urls-grammar-recycled_ptr-2constructor-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-recycled_ptr[pass:[recycled_ptr]]::recycled_ptr Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- recycled_ptr(xref:boost-urls-grammar-recycled_ptr[recycled_ptr]&& other) noexcept; ---- === Description If `other` references an object, ownership is transferred including a reference to the recycle bin. After the move, the moved-from object is empty. [,cpp] ---- &this->bin() == &other->bin() && ! this->empty() && other.empty() ---- === Throws nothing. === Parameters |=== | Name | Description | *other* | The pointer to move from |=== [#boost-urls-grammar-range_rule-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::range_rule Match a repeating number of elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template constexpr pass:q[_implementation-defined_] range_rule( Rule const& next, std::size_t N = 0, std::size_t M = std::size_t(-1)) noexcept; ---- === Description Elements are matched using the passed rule. Normally when the rule returns an error, the range ends and the input is rewound to one past the last character that matched successfully. However, if the rule returns the special value xref:boost-urls-grammar-error-end_of_range[error::end_of_range] , the input is not rewound. This allows for rules which consume input without producing elements in the range. For example, to relax the grammar for a comma-delimited list by allowing extra commas in between elements. [,cpp] ---- using value_type = range< typename Rule::value_type >; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,cpp] ---- // range = 1*( ";" token ) system::result< range > rv = parse( ";alpha;xray;charlie", range_rule( tuple_rule( squelch( delim_rule( ';' ) ), token_rule( alpha_chars ) ), 1 ) ); ---- [,cpp] ---- range = *next ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[3.6. Variable Repetition (rfc5234)] === Parameters |=== | Name | Description | *next* | The rule to use for matching each element. The range extends until this rule returns an error. | *N* | The minimum number of elements for the range to be valid. If omitted, this defaults to zero. | *M* | The maximum number of elements for the range to be valid. If omitted, this defaults to unlimited. |=== === See Also xref:boost-urls-grammar-alpha_chars[alpha_chars] , xref:boost-urls-grammar-delim_rule-0a[delim_rule] , xref:boost-urls-grammar-error-end_of_range[error::end_of_range] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-range[range] , xref:boost-urls-grammar-tuple_rule[tuple_rule] , xref:boost-urls-grammar-squelch[squelch] . [#boost-urls-grammar-range_rule-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::range_rule Match a repeating number of elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class Rule1, class Rule2> constexpr pass:q[_implementation-defined_] range_rule( Rule1 const& first, Rule2 const& next, std::size_t N = 0, std::size_t M = std::size_t(-1)) noexcept; ---- === Description Two rules are used for match. The rule `first` is used for matching the first element, while the `next` rule is used to match every subsequent element. Normally when the rule returns an error, the range ends and the input is rewound to one past the last character that matched successfully. However, if the rule returns the special value xref:boost-urls-grammar-error-end_of_range[error::end_of_range] , the input is not rewound. This allows for rules which consume input without producing elements in the range. For example, to relax the grammar for a comma-delimited list by allowing extra commas in between elements. [,cpp] ---- using value_type = range< typename Rule::value_type >; ---- === Rules are used with the function xref:boost-urls-grammar-parse-02[parse] . [,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 ) ) ) ); ---- [,cpp] ---- range = <1>*<1>first / first *next ---- * link:https://datatracker.ietf.org/doc/html/rfc5234#section-3.6[3.6. Variable Repetition (rfc5234)] === Parameters |=== | Name | Description | *first* | The rule to use for matching the first element. If this rule returns an error, the range is empty. | *next* | The rule to use for matching each subsequent element. The range extends until this rule returns an error. | *N* | The minimum number of elements for the range to be valid. If omitted, this defaults to zero. | *M* | The maximum number of elements for the range to be valid. If omitted, this defaults to unlimited. |=== === See Also xref:boost-urls-grammar-alpha_chars[alpha_chars] , xref:boost-urls-grammar-delim_rule-0a[delim_rule] , xref:boost-urls-grammar-error-end_of_range[error::end_of_range] , xref:boost-urls-grammar-parse-02[parse] , xref:boost-urls-grammar-range[range] , xref:boost-urls-grammar-tuple_rule[tuple_rule] , xref:boost-urls-grammar-squelch[squelch] . [#boost-urls-grammar-string_view_base-starts_with-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::starts_with Return true if a matching prefix exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool starts_with(core::string_view x) const noexcept; ---- === Description See `core::string_view::starts_with` [#boost-urls-grammar-string_view_base-starts_with-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::starts_with Return true if a matching prefix exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool starts_with(char x) const noexcept; ---- === Description See `core::string_view::starts_with` [#boost-urls-grammar-string_view_base-starts_with-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::starts_with Return true if a matching prefix exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool starts_with(char const* x) const noexcept; ---- === Description See `core::string_view::starts_with` [#boost-urls-grammar-string_view_base-ends_with-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::ends_with Return true if a matching suffix exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool ends_with(core::string_view x) const noexcept; ---- === Description See `core::string_view::ends_with` [#boost-urls-grammar-string_view_base-ends_with-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::ends_with Return true if a matching suffix exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool ends_with(char x) const noexcept; ---- === Description See `core::string_view::ends_with` [#boost-urls-grammar-string_view_base-ends_with-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::ends_with Return true if a matching suffix exists === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool ends_with(char const* x) const noexcept; ---- === Description See `core::string_view::ends_with` [#boost-urls-grammar-string_view_base-find-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find` [#boost-urls-grammar-string_view_base-find-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find` [#boost-urls-grammar-string_view_base-find-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- === Description See `core::string_view::find` [#boost-urls-grammar-string_view_base-find-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find` [#boost-urls-grammar-string_view_base-compare-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int compare(core::string_view str) const noexcept; ---- === Description See `core::string_view::compare` [#boost-urls-grammar-string_view_base-compare-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int compare( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, core::string_view str) const; ---- === Description See `core::string_view::compare` [#boost-urls-grammar-string_view_base-compare-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int compare( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos2, xref:boost-urls-grammar-string_view_base-size_type[size_type] n2) const; ---- === Description See `core::string_view::compare` [#boost-urls-grammar-string_view_base-compare-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int compare(char const* s) const noexcept; ---- === Description See `core::string_view::compare` [#boost-urls-grammar-string_view_base-compare-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int compare( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, char const* s) const; ---- === Description See `core::string_view::compare` [#boost-urls-grammar-string_view_base-compare-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr int compare( xref:boost-urls-grammar-string_view_base-size_type[size_type] pos1, xref:boost-urls-grammar-string_view_base-size_type[size_type] n1, char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] n2) const; ---- === Description See `core::string_view::compare` [#boost-urls-grammar-string_view_base-rfind-0ed] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::rfind Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] rfind( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::rfind` [#boost-urls-grammar-string_view_base-rfind-0eb] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::rfind Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] rfind( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::rfind` [#boost-urls-grammar-string_view_base-rfind-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::rfind Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] rfind( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- === Description See `core::string_view::rfind` [#boost-urls-grammar-string_view_base-rfind-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::rfind Return the position of matching characters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] rfind( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::rfind` [#boost-urls-grammar-string_view_base-find_last_of-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_of Return the position of the last match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_of( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_of` [#boost-urls-grammar-string_view_base-find_last_of-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_of Return the position of the last match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_of( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_of` [#boost-urls-grammar-string_view_base-find_last_of-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_of Return the position of the last match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- === Description See `core::string_view::find_last_of` [#boost-urls-grammar-string_view_base-find_last_of-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_of Return the position of the last match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_of` [#boost-urls-grammar-string_view_base-find_first_not_of-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_not_of Return the position of the first non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_not_of( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_not_of` [#boost-urls-grammar-string_view_base-find_first_not_of-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_not_of Return the position of the first non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_not_of( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_not_of` [#boost-urls-grammar-string_view_base-find_first_not_of-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_not_of Return the position of the first non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_not_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- === Description See `core::string_view::find_first_not_of` [#boost-urls-grammar-string_view_base-find_first_not_of-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_not_of Return the position of the first non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_not_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_not_of` [#boost-urls-grammar-string_view_base-find_last_not_of-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_not_of Return the position of the last non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_not_of( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_not_of` [#boost-urls-grammar-string_view_base-find_last_not_of-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_not_of Return the position of the last non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_not_of( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_not_of` [#boost-urls-grammar-string_view_base-find_last_not_of-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_not_of Return the position of the last non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_not_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- === Description See `core::string_view::find_last_not_of` [#boost-urls-grammar-string_view_base-find_last_not_of-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_last_not_of Return the position of the last non-match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_last_not_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = core::string_view::npos) const noexcept; ---- === Description See `core::string_view::find_last_not_of` [#boost-urls-grammar-string_view_base-contains-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::contains Return true if matching characters are found === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool contains(core::string_view sv) const noexcept; ---- === Description See `core::string_view::contains` [#boost-urls-grammar-string_view_base-contains-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::contains Return true if matching characters are found === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool contains(char c) const noexcept; ---- === Description See `core::string_view::contains` [#boost-urls-grammar-string_view_base-contains-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::contains Return true if matching characters are found === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr bool contains(char const* s) const noexcept; ---- === Description See `core::string_view::contains` [#boost-urls-grammar-string_view_base-find_first_of-0ab] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_of Return the position of the first match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_of( core::string_view str, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_of` [#boost-urls-grammar-string_view_base-find_first_of-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_of Return the position of the first match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_of( char c, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_of` [#boost-urls-grammar-string_view_base-find_first_of-0af] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_of Return the position of the first match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos, xref:boost-urls-grammar-string_view_base-size_type[size_type] n) const noexcept; ---- === Description See `core::string_view::find_first_of` [#boost-urls-grammar-string_view_base-find_first_of-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-grammar[pass:[grammar]]::xref:boost-urls-grammar-string_view_base[pass:[string_view_base]]::find_first_of Return the position of the first match === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-grammar-string_view_base-size_type[size_type] find_first_of( char const* s, xref:boost-urls-grammar-string_view_base-size_type[size_type] pos = 0) const noexcept; ---- === Description See `core::string_view::find_first_of` [#boost-urls-string_token-arg-2constructor-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::arg Default constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr arg() = default; ---- [#boost-urls-string_token-arg-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::arg Default move constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr arg(xref:boost-urls-string_token-arg[arg]&&) = default; ---- [#boost-urls-string_token-arg-2constructor-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::arg Deleted copy constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- arg(xref:boost-urls-string_token-arg[arg] const&) = delete; ---- [#boost-urls-string_token-arg-operator_assign-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::operator= Deleted move assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-string_token-arg[arg]& operator=(xref:boost-urls-string_token-arg[arg]&&) = delete; ---- [#boost-urls-string_token-arg-operator_assign-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-string_token[pass:[string_token]]::xref:boost-urls-string_token-arg[pass:[arg]]::operator= Deleted copy assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-string_token-arg[arg]& operator=(xref:boost-urls-string_token-arg[arg] const&) = delete; ---- [#boost-urls-ipv4_address-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::ipv4_address Constructor. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ipv4_address() = default; ---- [#boost-urls-ipv4_address-2constructor-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::ipv4_address Constructor. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ipv4_address(xref:boost-urls-ipv4_address[ipv4_address] const&) = default; ---- [#boost-urls-ipv4_address-2constructor-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::ipv4_address Construct from an unsigned integer. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit ipv4_address(xref:boost-urls-ipv4_address-uint_type[uint_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. === Parameters |=== | Name | Description | *u* | The integer to construct from. |=== [#boost-urls-ipv4_address-2constructor-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::ipv4_address Construct from an array of bytes. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit ipv4_address(xref:boost-urls-ipv4_address-bytes_type[bytes_type] const& bytes) noexcept; ---- === Description This function constructs an address from the array in `bytes`, which is interpreted in big-endian. === Parameters |=== | Name | Description | *bytes* | The value to construct from. |=== [#boost-urls-ipv4_address-2constructor-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv4_address[pass:[ipv4_address]]::ipv4_address Construct from a string. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit ipv4_address(core::string_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. [NOTE] For a non-throwing parse function, use xref:boost-urls-parse_ipv4_address[parse_ipv4_address] . === Exceptions thrown on invalid input. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | input failed to parse correctly. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== === See Also xref:boost-urls-parse_ipv4_address[parse_ipv4_address] . [#boost-urls-operator_eq-0f2] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return true if two addresses are equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==( xref:boost-urls-ipv4_address[ipv4_address] const& a1, xref:boost-urls-ipv4_address[ipv4_address] const& a2) noexcept; ---- [#boost-urls-operator_eq-0fd] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return true if two addresses are equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==( xref:boost-urls-ipv6_address[ipv6_address] const& a1, xref:boost-urls-ipv6_address[ipv6_address] const& a2) noexcept; ---- [#boost-urls-operator_eq-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_eq-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Compare two decode views for equality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator==( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-operator_eq-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==( xref:boost-urls-params_encoded_base-iterator[iterator] const& it0, xref:boost-urls-params_encoded_base-iterator[iterator] const& it1) noexcept; ---- [#boost-urls-operator_eq-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator== Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator==( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.a.com/index.htm" ); assert( u0 == u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() == b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value `true` if `u0 == u1` [#boost-urls-operator_not_eq-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return true if two addresses are not equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=( xref:boost-urls-ipv4_address[ipv4_address] const& a1, xref:boost-urls-ipv4_address[ipv4_address] const& a2) noexcept; ---- [#boost-urls-operator_not_eq-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return true if two addresses are not equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=( xref:boost-urls-ipv6_address[ipv6_address] const& a1, xref:boost-urls-ipv6_address[ipv6_address] const& a2) noexcept; ---- [#boost-urls-operator_not_eq-037] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_not_eq-03b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Compare two decode views for inequality === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator!=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-operator_not_eq-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=( xref:boost-urls-params_encoded_base-iterator[iterator] const& it0, xref:boost-urls-params_encoded_base-iterator[iterator] const& it1) noexcept; ---- [#boost-urls-operator_not_eq-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator!= Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator!=( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.b.com/index.htm" ); assert( u0 != u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() != b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value `true` if `u0 != u1` [#boost-urls-ipv6_address-2constructor-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::ipv6_address Constructor. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ipv6_address() = default; ---- === Description Default constructed objects represent the unspecified address. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.2[2.5.2. The Unspecified Address] === See Also xref:boost-urls-ipv6_address-is_unspecified[is_unspecified] [#boost-urls-ipv6_address-2constructor-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::ipv6_address Constructor. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ipv6_address(xref:boost-urls-ipv6_address[ipv6_address] const&) = default; ---- [#boost-urls-ipv6_address-2constructor-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::ipv6_address Construct from an array of bytes. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ipv6_address(xref:boost-urls-ipv6_address-bytes_type[bytes_type] const& bytes) noexcept; ---- === Description This function constructs an address from the array in `bytes`, which is interpreted in big-endian. === Parameters |=== | Name | Description | *bytes* | The value to construct from. |=== [#boost-urls-ipv6_address-2constructor-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::ipv6_address Construct from an IPv4 address. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ipv6_address(xref:boost-urls-ipv4_address[ipv4_address] const& addr) noexcept; ---- === Description This function constructs an IPv6 address from the IPv4 address `addr`. The resulting address is an IPv4-Mapped IPv6 Address. * link:https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2[2.5.5.2. IPv4-Mapped IPv6 Address (rfc4291)] === Parameters |=== | Name | Description | *addr* | The address to construct from. |=== [#boost-urls-ipv6_address-2constructor-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ipv6_address[pass:[ipv6_address]]::ipv6_address Construct from a string. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- ipv6_address(core::string_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. [NOTE] For a non-throwing parse function, use xref:boost-urls-parse_ipv6_address[parse_ipv6_address] . === Exceptions thrown on invalid input. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] === Exceptions |=== | Name | Thrown on | `The` | input failed to parse correctly. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== === See Also xref:boost-urls-parse_ipv6_address[parse_ipv6_address] . [#boost-urls-operator_lshift-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the address to an output stream. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-ipv4_address[ipv4_address] const& addr); ---- === Description IPv4 addresses written to output streams are written in their dotted decimal format. Format the address to an output stream. IPv4 addresses written to output streams are written in their dotted decimal format. === Parameters |=== | Name | Description | *os* | The output stream. | *addr* | The address to format. | *os* | The output stream. | *addr* | The address to format. |=== [#boost-urls-operator_lshift-0f6] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the address to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-ipv6_address[ipv6_address] const& addr); ---- === Description This hidden friend function writes the address to an output stream using standard notation. Format the address to an output stream This function writes the address to an output stream using standard notation. === Return Value The output stream, for chaining. === Parameters |=== | Name | Description | *os* | The output stream to write to. | *addr* | The address to write. | *os* | The output stream to write to. | *addr* | The address to write. |=== [#boost-urls-operator_lshift-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the encoded authority to the output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-authority_view[authority_view] const& a); ---- === Description This hidden friend function serializes the encoded URL to the output stream. [,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. [,cpp] ---- authority_view a( "www.example.com" ); std::cout << a << std::endl; ---- === Return Value A reference to the output stream, for chaining === Parameters |=== | Name | Description | *os* | The output stream to write to | *a* | The URL to write | *os* | The output stream to write to | *a* | The URL to write |=== [#boost-urls-operator_lshift-034] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the string with percent-decoding applied to the output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-decode_view[decode_view] const& s); ---- === Description This hidden friend function serializes the decoded view to the output stream. Format the string with percent-decoding applied to the output stream This function serializes the decoded view to the output stream. === Return Value A reference to the output stream, for chaining === Parameters |=== | Name | Description | *os* | The output stream to write to | *s* | The decoded view to write | *os* | The output stream to write to | *s* | The decoded view to write |=== [#boost-urls-operator_lshift-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-params_encoded_base[params_encoded_base] const& qp); ---- === Description Any percent-escapes are emitted as-is; no decoding is performed. === Linear in `ps.buffer().size()`. [,cpp] ---- return os << ps.buffer(); ---- [#boost-urls-operator_lshift-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-params_base[params_base] const& qp); ---- === Description Any percent-escapes are emitted as-is; no decoding is performed. === Linear in `ps.buffer().size()`. [,cpp] ---- return os << ps.buffer(); ---- [#boost-urls-operator_lshift-038] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-segments_encoded_base[segments_encoded_base] const& ps); ---- === Description Any percent-escapes are emitted as-is; no decoding is performed. === Linear in `ps.buffer().size()`. [,cpp] ---- return os << ps.buffer(); ---- [#boost-urls-operator_lshift-0f4] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format to an output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-segments_base[segments_base] const& ps); ---- === Description Any percent-escapes are emitted as-is; no decoding is performed. === Linear in `ps.buffer().size()`. [,cpp] ---- return os << ps.buffer(); ---- [#boost-urls-operator_lshift-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<< Format the url to the output stream === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& os, xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description This function serializes the url to the specified output stream. Any percent-escapes are emitted as-is; no decoding is performed. [,cpp] ---- url_view u( "http://www.example.com/index.htm" ); std::stringstream ss; ss << u; assert( ss.str() == "http://www.example.com/index.htm" ); ---- [,cpp] ---- return os << u.buffer(); ---- === Linear in `u.buffer().size()` === Basic guarantee. Format the url to the output stream This function serializes the url to the specified output stream. Any percent-escapes are emitted as-is; no decoding is performed. [,cpp] ---- url_view u( "http://www.example.com/index.htm" ); std::stringstream ss; ss << u; assert( ss.str() == "http://www.example.com/index.htm" ); ---- [,cpp] ---- return os << u.buffer(); ---- === Linear in `u.buffer().size()` === Basic guarantee. === Return Value A reference to the output stream, for chaining === Parameters |=== | Name | Description | *os* | The output stream to write to. | *u* | The url to write. | *os* | The output stream to write to. | *u* | The url to write. |=== [#boost-urls-decode_view-iterator-2constructor-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator() = default; ---- [#boost-urls-decode_view-iterator-2constructor-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator(xref:boost-urls-decode_view-iterator[iterator] const&) = default; ---- [#boost-urls-decode_view-iterator-operator_inc-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator]& operator++() noexcept; ---- [#boost-urls-decode_view-iterator-operator_inc-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator] operator++(int) noexcept; ---- [#boost-urls-decode_view-iterator-operator_dec-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator]& operator--() noexcept; ---- [#boost-urls-decode_view-iterator-operator_dec-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::xref:boost-urls-decode_view-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-decode_view-iterator[iterator] operator--(int) noexcept; ---- [#boost-urls-decode_view-2constructor-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::decode_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr decode_view() noexcept = default; ---- === Description Default-constructed views represent empty strings. [,cpp] ---- decode_view ds; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. [#boost-urls-decode_view-2constructor-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::decode_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit decode_view( xref:boost-urls-pct_string_view[pct_string_view] s, xref:boost-urls-encoding_opts[encoding_opts] opt = = {}) noexcept; ---- === Description This constructs a view from the character buffer `s`, which must remain valid and unmodified until the view is no longer accessed. [,cpp] ---- decode_view ds( "Program%20Files" ); ---- [,cpp] ---- this->encoded() == s ---- === Linear in `s.size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent encoding. |=== === Parameters |=== | Name | Description | *s* | A percent-encoded string that has already been validated. | *opt* | The options for decoding. If this parameter is omitted, the default options are used. |=== [#boost-urls-decode_view-starts_with-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::starts_with Checks if the string begins with the given prefix === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool starts_with(core::string_view s) const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).starts_with("Program") ); ---- === Linear. === Throws nothing. [#boost-urls-decode_view-starts_with-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::starts_with Checks if the string begins with the given prefix === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool starts_with(char ch) const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).starts_with('P') ); ---- === Constant. === Throws nothing. [#boost-urls-decode_view-ends_with-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::ends_with Checks if the string ends with the given prefix === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool ends_with(core::string_view s) const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).ends_with("Files") ); ---- === Linear. === Throws nothing. [#boost-urls-decode_view-ends_with-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::ends_with Checks if the string ends with the given prefix === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool ends_with(char ch) const noexcept; ---- === Description [,cpp] ---- assert( decode_view( "Program%20Files" ).ends_with('s') ); ---- === Constant. === Throws nothing. [#boost-urls-decode_view-compare-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- int compare(core::string_view other) const noexcept; ---- === Description The length of the sequences to compare is the smaller of `size()` and `other.size()`. The function compares the two strings as if by calling `char_traits<char>::compare(to_string().data(), v.data(), rlen)`. This means the comparison is performed with percent-decoding applied to the current string. === Return Value Negative value if this string is less than the other character sequence, zero if the both character sequences are equal, positive value if this string is greater than the other character sequence === Parameters |=== | Name | Description | *other* | string to compare |=== [#boost-urls-decode_view-compare-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-decode_view[pass:[decode_view]]::compare Return the result of comparing to another string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- int compare(xref:boost-urls-decode_view[decode_view] other) const noexcept; ---- === Description The length of the sequences to compare is the smaller of `size()` and `other.size()`. The function compares the two strings as if by calling `char_traits<char>::compare(to_string().data(), v.to_string().data(), rlen)`. This means the comparison is performed with percent-decoding applied to the current string. === Return Value Negative value if this string is less than the other character sequence, zero if the both character sequences are equal, positive value if this string is greater than the other character sequence === Parameters |=== | Name | Description | *other* | string to compare |=== [#boost-urls-pct_string_view-2constructor-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::pct_string_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pct_string_view() = default; ---- === Description Default constructed string are empty. === Constant. === Throws nothing. [#boost-urls-pct_string_view-2constructor-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::pct_string_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr pct_string_view(xref:boost-urls-pct_string_view[pct_string_view] const& other) = default; ---- === Description The copy references the same underlying character buffer. Ownership is not transferred. [,cpp] ---- this->data() == other.data() ---- === Constant. === Throws nothing. [#boost-urls-pct_string_view-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::pct_string_view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class String, class = void> pct_string_view(String const& s); ---- [#boost-urls-pct_string_view-2constructor-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::pct_string_view Constructor (deleted) === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- pct_string_view(std::nullptr_t) = delete; ---- [#boost-urls-pct_string_view-2constructor-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::pct_string_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- pct_string_view( char const* s, std::size_t len); ---- === Description The newly constructed string references the specified character buffer. Ownership is not transferred. [,cpp] ---- this->data() == s && this->size() == len ---- === Linear in `len`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent encoding. |=== === Parameters |=== | Name | Description | *s,* | len The string to construct from. |=== [#boost-urls-pct_string_view-2constructor-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-pct_string_view[pass:[pct_string_view]]::pct_string_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- pct_string_view(core::string_view s); ---- === Description The newly constructed string references the specified character buffer. Ownership is not transferred. [,cpp] ---- this->data() == s.data() && this->size() == s.size() ---- === Linear in `s.size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent encoding. |=== === Parameters |=== | Name | Description | *s* | The string to construct from. |=== [#boost-urls-url_view-operator_assign-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view[url_view]& operator=(xref:boost-urls-url_view[url_view] const& other) noexcept; ---- === Description After assignment, both views reference the same underlying character buffer. Ownership is not transferred. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing. [#boost-urls-url_view-operator_assign-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url_view[url_view]& operator=(xref:boost-urls-url_view_base[url_view_base] const& other) noexcept; ---- === Description After assignment, both views reference the same underlying character buffer. Ownership is not transferred. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing. [#boost-urls-url_view-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::url_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url_view() noexcept; ---- === Description Default constructed views refer to a string with zero length, which always remains valid. This matches the grammar for a relative-ref with an empty path and no query or fragment. [,cpp] ---- url_view u; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- === 4.2. Relative Reference (rfc3986) [#boost-urls-url_view-2constructor-025] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::url_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url_view(core::string_view s); ---- === Description This function constructs a URL from the string `s`, which must contain a valid _URI_ or _relative-ref_ or else an exception is thrown. Upon successful construction, the view refers to the characters in the buffer pointed to by `s`. Ownership is not transferred; The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- url_view u( "http://www.example.com/index.htm" ); ---- [,cpp] ---- return parse_uri_reference( s ).value(); ---- === Linear in `s.size()`. === Exceptions thrown on invalid input. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4.1. URI Reference] === Exceptions |=== | Name | Thrown on | `The` | input failed to parse correctly. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== === See Also xref:boost-urls-parse_uri_reference[parse_uri_reference] . [#boost-urls-url_view-2constructor-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::url_view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class String, class = void> url_view(String const& s); ---- [#boost-urls-url_view-2constructor-024] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::url_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url_view(xref:boost-urls-url_view[url_view] const& other) noexcept; ---- === Description After construction, both views reference the same underlying character buffer. Ownership is not transferred. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing. [#boost-urls-url_view-2constructor-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view[pass:[url_view]]::url_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url_view(xref:boost-urls-url_view_base[url_view_base] const& other) noexcept; ---- === Description After construction, both views reference the same underlying character buffer. Ownership is not transferred. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing. [#boost-urls-authority_view-2constructor-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::authority_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- authority_view() noexcept; ---- === Description Default constructed authorities refer to a string with zero length, which is always valid. This matches the grammar for a zero-length host. === Throws nothing. [#boost-urls-authority_view-2constructor-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::authority_view Construct from a string. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit authority_view(core::string_view s); ---- === Description This function attempts to construct an authority from the string `s`, which must be a valid ['authority] or else an exception is thrown. Upon successful construction, the view refers to the characters in the buffer pointed to by `s`. Ownership is not transferred; The caller is responsible for ensuring that the lifetime of the buffer extends until the view is destroyed. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] === See Also xref:boost-urls-parse_authority[parse_authority] . [#boost-urls-authority_view-2constructor-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-authority_view[pass:[authority_view]]::authority_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- authority_view(xref:boost-urls-authority_view[authority_view] const&) noexcept; ---- [#boost-urls-operator_lt-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator< Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator<( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_lt-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator< Compare two decode views for less than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator<( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-operator_lt-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator< Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator<( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.b.com/index.htm" ); assert( u0 < u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() < b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value `true` if `u0 < u1` [#boost-urls-operator_le-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator<=( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_le-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<= Compare two decode views for less than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator<=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-operator_le-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator<= Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator<=( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.b.com/index.htm" ); url_view u1( "http://www.b.com/index.htm" ); assert( u0 <= u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() <= b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value `true` if `u0 <= u1` [#boost-urls-operator_gt-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator> Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator>( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_gt-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator> Compare two decode views for greater than === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator>( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-operator_gt-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator> Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator>( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.b.com/index.htm" ); url_view u1( "http://www.a.com/index.htm" ); assert( u0 > u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() > b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value `true` if `u0 > u1` [#boost-urls-operator_ge-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator>= Return the result of comparing two authorities The authorities are compared component by component as if they were first normalized. === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator>=( xref:boost-urls-authority_view[authority_view] const& a0, xref:boost-urls-authority_view[authority_view] const& a1) noexcept; ---- === Description === Linear in `min( a0.size(), a1.size() )` === Throws nothing [#boost-urls-operator_ge-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator>= Compare two decode views for greater than or equal === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class S0, class S1> constexpr bool operator>=( S0 const& s0, S1 const& s1) noexcept; ---- === Description This function is only enabled if both types are decode_view or convertible to `core::string_view`, but not both are convertible to `core::string_view` [#boost-urls-operator_ge-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::operator>= Return the result of comparing two URLs === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- bool operator>=( xref:boost-urls-url_view_base[url_view_base] const& u0, xref:boost-urls-url_view_base[url_view_base] const& u1) noexcept; ---- === Description The URLs are compared component by component as if they were first normalized. [,cpp] ---- url_view u0( "http://www.a.com/index.htm" ); url_view u1( "http://www.a.com/index.htm" ); assert( u0 >= u1 ); ---- [,cpp] ---- url a(u0); a.normalize(); url b(u1); b.normalize(); return a.buffer() >= b.buffer(); ---- === Linear in `min( u0.size(), u1.size() )` === Throws nothing * link:https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2[6.2.2 Syntax-Based Normalization (rfc3986)] === Return Value `true` if `u0 >= u1` [#boost-urls-ignore_case_param-2constructor-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ignore_case_param[pass:[ignore_case_param]]::ignore_case_param Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ignore_case_param() noexcept = default; ---- === Description By default, comparisons are case-sensitive. === This function performs case-sensitive comparisons when called with no arguments: [,cpp] ---- void f( ignore_case_param = {} ); ---- [#boost-urls-ignore_case_param-2constructor-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-ignore_case_param[pass:[ignore_case_param]]::ignore_case_param Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr ignore_case_param(ignore_case_t) noexcept; ---- === Description Construction from xref:boost-urls-ignore_case[ignore_case] indicates that comparisons should be case-insensitive. === When xref:boost-urls-ignore_case[ignore_case] is passed as an argument, this function ignores case when performing comparisons: [,cpp] ---- void f( ignore_case_param = {} ); ---- [#boost-urls-encode-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::encode Apply percent-encoding to a string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template std::size_t encode( char* dest, std::size_t size, core::string_view s, CharSet const& unreserved, xref:boost-urls-encoding_opts[encoding_opts] opt = = {}); ---- === Description This function applies percent-encoding to the string using the given options and character set. The destination buffer provided by the caller is used to store the result, which may be truncated if there is insufficient space. [,cpp] ---- char buf[100]; assert( encode( buf, sizeof(buf), "Program Files", pchars ) == 15 ); ---- === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2.1. Percent-Encoding (rfc3986)] === Return Value The number of characters written to the destination buffer. === Parameters |=== | Name | Description | *dest* | The destination buffer to write to. | *size* | The number of writable characters pointed to by `dest`. If this is less than `encoded_size(s)`, the result is truncated. | *s* | The string to encode. | *unreserved* | The set of characters that is not percent-encoded. | *opt* | The options for encoding. If this parameter is omitted, the default options are used. |=== === See Also xref:boost-urls-encode-04[encode] , xref:boost-urls-encoded_size[encoded_size] , xref:boost-urls-make_pct_string_view[make_pct_string_view] . [#boost-urls-encode-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::encode Return a percent-encoded string === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template< class StringToken = xref:boost-urls-string_token[string_token]::xref:boost-urls-string_token-return_string[return_string], class CharSet> StringToken::result_type encode( core::string_view s, CharSet const& unreserved, xref:boost-urls-encoding_opts[encoding_opts] opt = = {}, StringToken&& token) noexcept; ---- === Description This function applies percent-encoding to the string using the given options and character set, and returns the result as a string when called with default arguments. [,cpp] ---- encoding_opts opt; opt.space_as_plus = true; std::string s = encode( "My Stuff", opt, pchars ); assert( s == "My+Stuff" ); ---- === Calls to allocate may throw. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[2.1. Percent-Encoding (rfc3986)] === Return Value The string === Parameters |=== | Name | Description | *s* | The string to encode. | *unreserved* | The set of characters that is not percent-encoded. | *opt* | The options for encoding. If this parameter is omitted, the default options are used. | *token* | A string token. |=== === See Also xref:boost-urls-encode-04[encode] , xref:boost-urls-encoded_size[encoded_size] , xref:boost-urls-encoding_opts[encoding_opts] , [#boost-urls-param_pct_view-2constructor-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::param_pct_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr param_pct_view() = default; ---- === Description Default constructed query parameters have an empty key and no value. [,cpp] ---- param_pct_view qp; ---- [,cpp] ---- this->key == "" && this->value == "" && this->has_value == false ---- === Constant. === Throws nothing. [#boost-urls-param_pct_view-2constructor-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::param_pct_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- param_pct_view( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-pct_string_view[pct_string_view] value) noexcept; ---- === Description This constructs a parameter with a key and value, which may both contain percent escapes. The new key and value reference the same corresponding underlying character buffers. Ownership of the buffers is not transferred; the caller is responsible for ensuring that the assigned buffers remain valid until they are no longer referenced. [,cpp] ---- param_pct_view qp( "key", "value" ); ---- [,cpp] ---- this->key.data() == key.data() && this->value.data() == value.data() && this->has_value == true ---- === Linear in `key.size() + value.size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | or `value` contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *key,* | value The key and value to set. |=== [#boost-urls-param_pct_view-2constructor-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::param_pct_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template param_pct_view( xref:boost-urls-pct_string_view[pct_string_view] key, OptionalString const& value); ---- === Description This constructs a parameter with a key and optional value, which may both contain percent escapes. The new key and value reference the same corresponding underlying character buffers. Ownership of the buffers is not transferred; the caller is responsible for ensuring that the assigned buffers remain valid until they are no longer referenced. [,cpp] ---- param_pct_view qp( "key", optional("value") ); ---- [,cpp] ---- this->key.data() == key.data() && this->value->data() == value->data() && this->has_value == true ---- === Linear in `key.size() + value->size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | or `value` contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *key,* | value The key and value to set. |=== [#boost-urls-param_pct_view-2constructor-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::param_pct_view Construction === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit param_pct_view(xref:boost-urls-param_view[param_view] const& p); ---- === Description This converts a param which may contain unvalidated percent-escapes into a param whose key and value are guaranteed to contain strings with no invalid percent-escapes, otherwise an exception is thrown. The new key and value reference the same corresponding underlying character buffers. Ownership of the buffers is not transferred; the caller is responsible for ensuring that the assigned buffers remain valid until they are no longer referenced. [,cpp] ---- param_pct_view qp( param_view( "key", "value" ) ); ---- === Linear in `key.size() + value.size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | or `value` contains an invalid percent escape. |=== === Parameters |=== | Name | Description | *p* | The param to construct from. |=== [#boost-urls-param_pct_view-2constructor-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_pct_view[pass:[param_pct_view]]::param_pct_view aggregate construction === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- param_pct_view( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-pct_string_view[pct_string_view] value, bool has_value) noexcept; ---- [#boost-urls-param_view-2constructor-07a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::param_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr param_view() = default; ---- === Description Default constructed query parameters have an empty key and no value. [,cpp] ---- param_view qp; ---- [,cpp] ---- this->key == "" && this->value == "" && this->has_value == false ---- === Constant. === Throws nothing. [#boost-urls-param_view-2constructor-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::param_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template param_view( core::string_view key, OptionalString const& value) noexcept; ---- === Description This constructs a parameter with a key and value. No validation is performed on the strings. The new key and value reference the same corresponding underlying character buffers. Ownership of the buffers is not transferred; the caller is responsible for ensuring that the assigned buffers remain valid until they are no longer referenced. [,cpp] ---- param_view qp( "key", "value" ); ---- [,cpp] ---- this->key.data() == key.data() && this->value.data() == value.data() && this->has_value == true ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *key,* | value The key and value to set. |=== [#boost-urls-param_view-2constructor-07e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::param_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- param_view(xref: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. Ownership of the buffers is not transferred; the caller is responsible for ensuring that the assigned buffers remain valid until they are no longer referenced. [,cpp] ---- param qp( "key", "value" ); param_view qpv( qp ); ---- [,cpp] ---- this->key == key && this->value == value && this->has_value == other.has_value ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The param to reference |=== [#boost-urls-param_view-2constructor-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param_view[pass:[param_view]]::param_view === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- param_view( core::string_view key_, core::string_view value_, bool has_value_) noexcept; ---- [#boost-urls-param-2constructor-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::param Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr param() = default; ---- === Description Default constructed query parameters have an empty key and no value. [,cpp] ---- param qp; ---- [,cpp] ---- this->key == "" && this->value == "" && this->has_value == false ---- === Constant. === Throws nothing. [#boost-urls-param-2constructor-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::param Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- param(xref:boost-urls-param[param]&& other) noexcept; ---- === Description Upon construction, this acquires ownership of the members of other via move construction. The moved from object is as if default constructed. === Constant. === Throws nothing. [#boost-urls-param-2constructor-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::param Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr param(xref:boost-urls-param[param] const& other) = default; ---- === Description Upon construction, this becomes a copy of `other`. [,cpp] ---- this->key == other.key && this->value == other.value && this->has_value == other.has_value ---- === Linear in `other.key.size() + other.value.size()`. === Calls to allocate may throw. [#boost-urls-param-2constructor-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::param Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template param( core::string_view key, OptionalString const& value); ---- === Description This constructs a parameter with a key and value. No validation is performed on the strings. Ownership of the key and value is acquired by making copies. [,cpp] ---- param qp( "key", "value" ); ---- [,cpp] ---- param qp( "key", optional("value") ); ---- [,cpp] ---- param qp( "key", boost::none ); ---- [,cpp] ---- param qp( "key", nullptr ); ---- [,cpp] ---- param qp( "key", no_value ); ---- [,cpp] ---- this->key == key && this->value == value && this->has_value == true ---- === Linear in `key.size() + value.size()`. === Calls to allocate may throw. === Parameters |=== | Name | Description | *key,* | value The key and value to set. |=== [#boost-urls-param-2constructor-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::param === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- param( core::string_view key, core::string_view value, bool has_value) noexcept; ---- [#boost-urls-param-operator_assign-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param[param]& operator=(xref:boost-urls-param[param]&& other) noexcept; ---- === Description Upon assignment, this acquires ownership of the members of other via move assignment. The moved from object is as if default constructed. === Constant. === Throws nothing. [#boost-urls-param-operator_assign-0cd] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr xref:boost-urls-param[param]& operator=(xref:boost-urls-param[param] const&) = default; ---- === Description Upon assignment, this becomes a copy of `other`. [,cpp] ---- this->key == other.key && this->value == other.value && this->has_value == other.has_value ---- === Linear in `other.key.size() + other.value.size()`. === Calls to allocate may throw. [#boost-urls-param-operator_assign-0cb] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param[param]& operator=(xref:boost-urls-param_view[param_view] const& other); ---- === Description The members of `other` are copied, re-using already existing string capacity. [,cpp] ---- this->key == other.key && this->value == other.value && this->has_value == other.has_value ---- === Linear in `other.key.size() + other.value.size()`. === Calls to allocate may throw. === Parameters |=== | Name | Description | *other* | The parameter to copy. |=== [#boost-urls-param-operator_assign-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-param[pass:[param]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-param[param]& operator=(xref:boost-urls-param_pct_view[param_pct_view] const& other); ---- === Description The members of `other` are copied, re-using already existing string capacity. [,cpp] ---- this->key == other.key && this->value == other.value && this->has_value == other.has_value ---- === Linear in `other.key.size() + other.value.size()`. === Calls to allocate may throw. === Parameters |=== | Name | Description | *other* | The parameter to copy. |=== [#boost-urls-params_encoded_base-iterator-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator() = default; ---- [#boost-urls-params_encoded_base-iterator-2constructor-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator(xref:boost-urls-params_encoded_base-iterator[iterator] const&) = default; ---- [#boost-urls-params_encoded_base-iterator-operator_inc-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator]& operator++() noexcept; ---- [#boost-urls-params_encoded_base-iterator-operator_inc-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] operator++(int) noexcept; ---- [#boost-urls-params_encoded_base-iterator-operator_dec-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator]& operator--() noexcept; ---- [#boost-urls-params_encoded_base-iterator-operator_dec-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::xref:boost-urls-params_encoded_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] operator--(int) noexcept; ---- [#boost-urls-params_encoded_base-find-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::find Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] find( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key, which may contain percent escapes. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).encoded_params().find( "First", ignore_case )->value == "John" ); ---- [,cpp] ---- return this->find( this->begin(), key, ic ); ---- === Linear in `this->buffer().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_encoded_base-find-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::find Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] find( xref:boost-urls-params_encoded_base-iterator[iterator] from, xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key, which may contain percent escapes. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- url_view u( "?First=John&Last=Doe" ); assert( u.encoded_params().find( "first" ) != u.encoded_params().find( "first", ignore_case ) ); ---- === Linear in `this->buffer().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Return Value an iterator to the param === Parameters |=== | Name | Description | *from* | The position to begin the search from. This can be `end()`. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_encoded_base-find_last-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::find_last Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] find_last( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key, which may contain percent escapes. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( url_view( "?first=John&last=Doe" ).encoded_params().find_last( "last" )->value == "Doe" ); ---- === Linear in `this->buffer().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_encoded_base-find_last-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_base[pass:[params_encoded_base]]::find_last Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] find_last( xref:boost-urls-params_encoded_base-iterator[iterator] before, xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key, which may contain percent escapes. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- url_view u( "?First=John&Last=Doe" ); assert( u.encoded_params().find_last( "last" ) != u.encoded_params().find_last( "last", ignore_case ) ); ---- === Linear in `this->buffer().size()`. === Return Value an iterator to the param === Parameters |=== | Name | Description | *before* | One past the position to begin the search from. This can be `end()`. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_ref-2constructor-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::params_ref Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr params_ref(xref:boost-urls-params_ref[params_ref] const& other) = default; ---- === Description After construction, both views reference the same url. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the url extends until it is no longer referenced. [,cpp] ---- &this->url() == &other.url() ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The other view. |=== [#boost-urls-params_ref-2constructor-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::params_ref Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- params_ref( xref:boost-urls-params_ref[params_ref] const& other, xref:boost-urls-encoding_opts[encoding_opts] opt) noexcept; ---- === Description After construction, both views will reference the same url but this instance will use the specified xref:boost-urls-encoding_opts[encoding_opts] when the values are decoded. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the url extends until it is no longer referenced. [,cpp] ---- &this->url() == &other.url() ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *other* | The other view. | *opt* | The options for decoding. If this parameter is omitted, `space_as_plus` is used. |=== [#boost-urls-params_ref-operator_assign-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref]& operator=(xref:boost-urls-params_ref[params_ref] const& other); ---- === Description The previous contents of this are replaced by the contents of `other. All iterators are invalidated. [NOTE] The strings referenced by `other` must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *other* | The params to assign. |=== [#boost-urls-params_ref-operator_assign-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref]& operator=(std::initializer_list init); ---- === Description After assignment, the previous contents of the query parameters are replaced by the contents of the initializer-list. === None of character buffers referenced by `init` may overlap the character buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( init ); ---- === Linear in `init.size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *init* | The list of params to assign. |=== [#boost-urls-params_ref-assign-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::assign Assign elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void assign(std::initializer_list init); ---- === Description This function replaces the entire contents of the view with the params in the _initializer-list_ . All iterators are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- url u; u.params().assign( {{ "first", "John" }, { "last", "Doe" }} ); ---- === Linear in `init.size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *init* | The list of params to assign. |=== [#boost-urls-params_ref-assign-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::assign Assign elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template void assign( FwdIt first, FwdIt last); ---- === Description This function replaces the entire contents of the view with the params in the range. All iterators are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true ---- === Linear in the size of the range. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *first,* | last The range of params to assign. |=== [#boost-urls-params_ref-append-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::append Append elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] append(xref:boost-urls-param_view[param_view] const& p); ---- === Description This function appends a param to the view. The `end()` iterator is invalidated. [,cpp] ---- url u; u.params().append( { "first", "John" } ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the new element. === Parameters |=== | Name | Description | *p* | The param to append. |=== [#boost-urls-params_ref-append-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::append Append elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] append(std::initializer_list init); ---- === Description This function appends the params in an _initializer-list_ to the view. The `end()` iterator is invalidated. [,cpp] ---- url u; u.params().append({ { "first", "John" }, { "last", "Doe" } }); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first new element. === Parameters |=== | Name | Description | *init* | The list of params to append. |=== [#boost-urls-params_ref-append-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::append Append elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_base-iterator[iterator] append( FwdIt first, FwdIt last); ---- === Description This function appends a range of params to the view. The `end()` iterator is invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first new element. === Parameters |=== | Name | Description | *first,* | last The range of params to append. |=== [#boost-urls-params_ref-insert-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::insert Insert elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] insert( xref:boost-urls-params_base-iterator[iterator] before, xref:boost-urls-param_view[param_view] const& p); ---- === Description This function inserts a param before the specified position. All iterators that are equal to `before` or come after are invalidated. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the inserted element. === Parameters |=== | Name | Description | *before* | An iterator before which the param is inserted. This may be equal to `end()`. | *p* | The param to insert. |=== [#boost-urls-params_ref-insert-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::insert Insert elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] insert( xref:boost-urls-params_base-iterator[iterator] before, std::initializer_list init); ---- === Description This function inserts the params in an _initializer-list_ before the specified position. All iterators that are equal to `before` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first element inserted, or `before` if `init.size() == 0`. === Parameters |=== | Name | Description | *before* | An iterator before which the element is inserted. This may be equal to `end()`. | *init* | The list of params to insert. |=== [#boost-urls-params_ref-insert-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::insert Insert elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_base-iterator[iterator] insert( xref:boost-urls-params_base-iterator[iterator] before, FwdIt first, FwdIt last); ---- === Description This function inserts a range of params before the specified position. All iterators that are equal to `before` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first element inserted, or `before` if `first == last`. === Parameters |=== | Name | Description | *before* | An iterator before which the element is inserted. This may be equal to `end()`. | *first,* | last The range of params to insert. |=== [#boost-urls-params_ref-erase-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::erase Erase elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] erase(xref:boost-urls-params_base-iterator[iterator] pos) noexcept; ---- === Description This function removes an element from the container. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?first=John&last=Doe" ); params_ref::iterator it = u.params().erase( u.params().begin() ); assert( u.encoded_query() == "last=Doe" ); ---- === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value An iterator to one past the removed element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. |=== [#boost-urls-params_ref-erase-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::erase Erase elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] erase( xref:boost-urls-params_base-iterator[iterator] first, xref:boost-urls-params_base-iterator[iterator] last) noexcept; ---- === Description This function removes a range of elements from the container. All iterators that are equal to `first` or come after are invalidated. === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value An iterator to one past the removed range. === Parameters |=== | Name | Description | *first,* | last The range of elements to erase. |=== [#boost-urls-params_ref-erase-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::erase Erase elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t erase( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) noexcept; ---- === Description All iterators are invalidated. [,cpp] ---- this->count( key, ic ) == 0 ---- === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value The number of elements removed from the container. === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_ref-replace-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::replace Replace elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] replace( xref:boost-urls-params_base-iterator[iterator] pos, xref:boost-urls-param_view[param_view] const& p); ---- === Description This function replaces the contents of the element at `pos` with the specified param. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?first=John&last=Doe" ); u.params().replace( u.params().begin(), { "title", "Mr" }); assert( u.encoded_query() == "title=Mr&last=Doe" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *p* | The param to assign. |=== [#boost-urls-params_ref-replace-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::replace Replace elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] replace( xref:boost-urls-params_base-iterator[iterator] from, xref:boost-urls-params_base-iterator[iterator] to, std::initializer_list init); ---- === Description This function replaces a range of elements with the params in an _initializer-list_ . All iterators that are equal to `from` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first element inserted, or one past `to` if `init.size() == 0`. === Parameters |=== | Name | Description | *from,to* | The range of elements to replace. | *init* | The list of params to assign. |=== [#boost-urls-params_ref-replace-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::replace Replace elements === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_base-iterator[iterator] replace( xref:boost-urls-params_base-iterator[iterator] from, xref:boost-urls-params_base-iterator[iterator] to, FwdIt first, FwdIt last); ---- === Description This function replaces a range of elements with a range of params. All iterators that are equal to `from` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first element inserted, or one past `to` if `first == last`. === Parameters |=== | Name | Description | *from,to* | The range of elements to replace. | *first,* | last The range of params to assign. |=== [#boost-urls-params_ref-set-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::set Set a value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] set( xref:boost-urls-params_base-iterator[iterator] pos, core::string_view value); ---- === Description This function replaces the value of an element at the specified position. All iterators that are equal to `pos` or come after are invalidated. [,cpp] ---- url u( "?id=42&id=69" ); u.params().set( u.params().begin(), "none" ); assert( u.encoded_query() == "id=none&id=69" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *value* | The value to assign. The empty string still counts as a value. That is, `has_value` for the element is true. |=== [#boost-urls-params_ref-set-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_ref[pass:[params_ref]]::set Set a value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] set( core::string_view key, core::string_view value, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}); ---- === Description This function performs one of two actions depending on the value of `this->contains( key, ic )`. * If key is contained in the view then one of the matching elements has its value changed to the specified value. The remaining elements with a matching key are erased. Otherwise, * If `key` is not contained in the view, then the function apppends the param `{ key, value }`. All iterators are invalidated. [,cpp] ---- url u( "?id=42&id=69" ); u.params().set( "id", "none" ); assert( u.params().count( "id" ) == 1 ); ---- [,cpp] ---- this->count( key, ic ) == 1 && this->find( key, ic )->value == value ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the appended or modified element. === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *value* | The value to assign. The empty string still counts as a value. That is, `has_value` for the element is true. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_base-iterator-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator() = default; ---- [#boost-urls-params_base-iterator-2constructor-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator(xref:boost-urls-params_base-iterator[iterator] const&) = default; ---- [#boost-urls-params_base-iterator-operator_inc-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator]& operator++() noexcept; ---- [#boost-urls-params_base-iterator-operator_inc-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] operator++(int) noexcept; ---- [#boost-urls-params_base-iterator-operator_dec-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator]& operator--() noexcept; ---- [#boost-urls-params_base-iterator-operator_dec-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::xref:boost-urls-params_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] operator--(int) noexcept; ---- [#boost-urls-params_base-find-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::find Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] find( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( (*url_view( "?first=John&last=Doe" ).params().find( "First", ignore_case )).value == "John" ); ---- [,cpp] ---- return this->find( this->begin(), key, ic ); ---- === Linear in `this->buffer().size()`. === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_base-find-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::find Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] find( xref:boost-urls-params_base-iterator[iterator] from, core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- url_view u( "?First=John&Last=Doe" ); assert( u.params().find( "first" ) != u.params().find( "first", ignore_case ) ); ---- === Linear in `this->buffer().size()`. === Return Value an iterator to the param === Parameters |=== | Name | Description | *from* | The position to begin the search from. This can be `end()`. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_base-find_last-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::find_last Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] find_last( core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- assert( (*url_view( "?first=John&last=Doe" ).params().find_last( "last" )).value == "Doe" ); ---- === Linear in `this->buffer().size()`. === Return Value an iterator to the param === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_base-find_last-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_base[pass:[params_base]]::find_last Find a matching key === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_base-iterator[iterator] find_last( xref:boost-urls-params_base-iterator[iterator] before, core::string_view key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) const noexcept; ---- === Description This function examines the parameters in the container to find a match for the specified key. The comparison is performed as if all escaped characters were decoded first. 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. [,cpp] ---- url_view u( "?First=John&Last=Doe" ); assert( u.params().find_last( "last" ) != u.params().find_last( "last", ignore_case ) ); ---- === Linear in `this->buffer().size()`. === Return Value an iterator to the param === Parameters |=== | Name | Description | *before* | One past the position to begin the search from. This can be `end()`. | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_view-2constructor-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_view[pass:[params_view]]::params_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- params_view() = default; ---- === Description Default-constructed params have zero elements. [,cpp] ---- params_view qp; ---- [,cpp] ---- return params_view( "" ); ---- === Constant. === Throws nothing. [#boost-urls-params_view-2constructor-091] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_view[pass:[params_view]]::params_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr params_view(xref:boost-urls-params_view[params_view] const& other) = default; ---- === Description After construction both views reference the same character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing [#boost-urls-params_view-2constructor-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_view[pass:[params_view]]::params_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- params_view( xref:boost-urls-params_view[params_view] const& other, xref:boost-urls-encoding_opts[encoding_opts] opt) noexcept; ---- === Description After construction both views will reference the same character buffer but this instance will use the specified xref:boost-urls-encoding_opts[encoding_opts] when the values are decoded. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing [#boost-urls-params_view-2constructor-09a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_view[pass:[params_view]]::params_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- params_view(core::string_view s); ---- === Description This function constructs params from a valid query parameter string, which can contain percent escapes. Unlike the parameters in URLs, the string passed here should not start with "?". Upon construction, the view references the character buffer pointed to by `s`. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- params_view qp( "first=John&last=Doe" ); ---- [,cpp] ---- return parse_query( s ).value(); ---- [,cpp] ---- this->buffer().data() == s.data() ---- === Linear in `s`. === Exceptions thrown on invalid input. [,cpp] ---- query-params = [ query-param ] *( "&" query-param ) query-param = key [ "=" value ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid query parameter string. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-params_view-2constructor-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_view[pass:[params_view]]::params_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- params_view( core::string_view s, xref:boost-urls-encoding_opts[encoding_opts] opt); ---- === Description This function constructs params from a valid query parameter string, which can contain percent escapes. This instance will use the specified xref:boost-urls-encoding_opts[encoding_opts] when the values are decoded. Unlike the parameters in URLs, the string passed here should not start with "?". Upon construction, the view will reference the character buffer pointed to by `s`. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- encoding_opts opt; opt.space_as_plus = true; params_view qp( "name=John+Doe", opt ); ---- [,cpp] ---- return params_view(parse_query( s ).value(), opt); ---- [,cpp] ---- this->buffer().data() == s.data() ---- === Linear in `s`. === Exceptions thrown on invalid input. [,cpp] ---- query-params = [ query-param ] *( "&" query-param ) query-param = key [ "=" value ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid query parameter string. |=== === Parameters |=== | Name | Description | *s* | The string to parse. | *opt* | The options for decoding. If this parameter is omitted, `space_as_plus` is used. |=== [#boost-urls-params_encoded_view-2constructor-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_view[pass:[params_encoded_view]]::params_encoded_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr params_encoded_view() = default; ---- === Description Default-constructed params have zero elements. [,cpp] ---- params_encoded_view qp; ---- [,cpp] ---- return params_encoded_view( "" ); ---- === Constant. === Throws nothing. [#boost-urls-params_encoded_view-2constructor-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_view[pass:[params_encoded_view]]::params_encoded_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr params_encoded_view(xref:boost-urls-params_encoded_view[params_encoded_view] const& other) = default; ---- === Description After construction both views reference the same character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing [#boost-urls-params_encoded_view-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_view[pass:[params_encoded_view]]::params_encoded_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- params_encoded_view(core::string_view s); ---- === Description This function constructs params from a valid query parameter string, which can contain percent escapes. Unlike the parameters in URLs, the string passed here should not start with "?". Upon construction, the view references the character buffer pointed to by `s`. The caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- params_encoded_view qp( "first=John&last=Doe" ); ---- [,cpp] ---- return parse_query( s ).value(); ---- [,cpp] ---- this->buffer().data() == s.data() ---- === Linear in `s`. === Exceptions thrown on invalid input. [,cpp] ---- query-params = [ query-param ] *( "&" query-param ) query-param = key [ "=" value ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid query parameter string. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-url_base-segments-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::segments Return the path as a container of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls[urls]::xref:boost-urls-segments_ref[segments_ref] segments() noexcept; ---- === Description This function returns a bidirectional view of segments over the path. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- url u( "http://example.com/path/to/file.txt" ); segments sv = u.segments(); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path[set_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url_base-segments-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::segments Return the path as a container of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_view[segments_view] segments() const noexcept; ---- === Description This function returns a bidirectional view of strings over the path. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. [,cpp] ---- segments_view sv = url_view( "/path/to/file.txt" ).segments(); ---- === Constant. === Throws nothing. [,cpp] ---- path = [ "/" ] segment *( "/" segment ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_view_base-is_path_absolute[is_path_absolute] , xref:boost-urls-url_view_base-encoded_path[encoded_path] , xref:boost-urls-url_view_base-encoded_segments[encoded_segments] . xref:boost-urls-url_view_base-path[path] , xref:boost-urls-segments_view[segments_view] . [#boost-urls-url_base-encoded_segments-0e8] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::encoded_segments Return the path as a container of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref] encoded_segments() noexcept; ---- === Description This function returns a bidirectional view of segments over the path. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- url u( "http://example.com/path/to/file.txt" ); segments_encoded_ref sv = u.encoded_segments(); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_base-encoded_segments-0e5[encoded_segments] , xref:boost-urls-url_base-set_encoded_path[set_encoded_path] , xref:boost-urls-url_base-set_path[set_path] , xref:boost-urls-url_base-set_path_absolute[set_path_absolute] . [#boost-urls-url_base-encoded_segments-0e5] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::encoded_segments Return the path as a container of segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_view[segments_encoded_view] encoded_segments() const noexcept; ---- === Description This function returns a bidirectional view of strings over the path. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. [,cpp] ---- segments_encoded_view sv = url_view( "/path/to/file.txt" ).encoded_segments(); ---- === Constant. === Throws nothing. [,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 ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path (rfc3986)] === See Also xref:boost-urls-url_view_base-is_path_absolute[is_path_absolute] , xref:boost-urls-url_view_base-encoded_path[encoded_path] , xref:boost-urls-url_view_base-path[path] , xref:boost-urls-url_view_base-segments[segments] , xref:boost-urls-segments_encoded_view[segments_encoded_view] . [#boost-urls-url_base-params-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::params Return the query as a container of parameters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref] params() noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- params_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params(); ---- === Constant. === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url_base-params-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::params xref:boost-urls-url_view_base-params-05[url_view_base::params] === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view[params_view] params() const noexcept; ---- [#boost-urls-url_base-params-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::params Return the query as a container of parameters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_ref[params_ref] params(xref:boost-urls-encoding_opts[encoding_opts] opt) noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- encoding_opts opt; opt.space_as_plus = true; params_ref pv = url( "/sql?id=42&name=jane+doe&page+size=20" ).params(opt); ---- === Constant. === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === Parameters |=== | Name | Description | *opt* | The options for decoding. If this parameter is omitted, the `space_as_plus` is used. |=== === See Also xref:boost-urls-url_base-encoded_params-06[encoded_params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-url_base-encoded_params-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_base[pass:[url_base]]::encoded_params Return the query as a container of parameters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_view[params_encoded_view] encoded_params() const noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. [,cpp] ---- params_encoded_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params(); ---- === Constant. === Throws nothing. * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_ref[params_encoded_ref] encoded_params() noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Strings returned when iterating the range may contain percent escapes. The container is modifiable; changes to the container are reflected in the underlying URL. [,cpp] ---- params_encoded_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params(); ---- === Constant. === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)] * link:https://en.wikipedia.org/wiki/Query_string[Query string (Wikipedia)] === See Also xref:boost-urls-url_base-params-0c[params] , xref:boost-urls-url_base-remove_query[remove_query] , xref:boost-urls-url_base-set_encoded_query[set_encoded_query] , xref:boost-urls-url_base-set_query[set_query] . [#boost-urls-params_encoded_ref-operator_assign-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_ref[params_encoded_ref]& operator=(xref:boost-urls-params_encoded_ref[params_encoded_ref] const& other); ---- === Description The previous contents of this are replaced by the contents of `other. All iterators are invalidated. [NOTE] The strings referenced by `other` must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *other* | The params to assign. |=== [#boost-urls-params_encoded_ref-operator_assign-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_ref[params_encoded_ref]& operator=(std::initializer_list init); ---- === Description After assignment, the previous contents of the query parameters are replaced by the contents of the initializer-list. All iterators are invalidated. === None of character buffers referenced by `init` may overlap the character buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( init.begin(), init.end() ); ---- === Linear in `init.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``init`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *init* | The list of params to assign. |=== [#boost-urls-params_encoded_ref-assign-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::assign Assign params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void assign(std::initializer_list init); ---- === Description This function replaces the entire contents of the view with the params in the _initializer-list_ . All iterators are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- url u; u.encoded_params().assign({ { "first", "John" }, { "last", "Doe" } }); ---- === Linear in `init.size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``init`` | contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *init* | The list of params to assign. |=== [#boost-urls-params_encoded_ref-assign-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::assign Assign params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template void assign( FwdIt first, FwdIt last); ---- === Description This function replaces the entire contents of the view with the params in the range. All iterators are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true ---- === Linear in the size of the range. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | range contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *first,* | last The range of params to assign. |=== [#boost-urls-params_encoded_ref-append-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::append Append params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] append(xref:boost-urls-param_pct_view[param_pct_view] const& p); ---- === Description This function appends a param to the view. The `end()` iterator is invalidated. [,cpp] ---- url u; u.encoded_params().append( { "first", "John" } ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``p`` | contains an invalid percent-encoding. |=== === Return Value An iterator to the new element. === Parameters |=== | Name | Description | *p* | The param to append. |=== [#boost-urls-params_encoded_ref-append-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::append Append params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] append(std::initializer_list init); ---- === Description This function appends the params in an _initializer-list_ to the view. The `end()` iterator is invalidated. [,cpp] ---- url u; u.encoded_params().append({ {"first", "John"}, {"last", "Doe"} }); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``init`` | contains an invalid percent-encoding. |=== === Return Value An iterator to the first new element. === Parameters |=== | Name | Description | *init* | The list of params to append. |=== [#boost-urls-params_encoded_ref-append-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::append Append params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_encoded_base-iterator[iterator] append( FwdIt first, FwdIt last); ---- === Description This function appends a range of params to the view. The `end()` iterator is invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the first new element. === Parameters |=== | Name | Description | *first,* | last The range of params to append. |=== [#boost-urls-params_encoded_ref-insert-03] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::insert Insert params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] insert( xref:boost-urls-params_encoded_base-iterator[iterator] before, xref:boost-urls-param_pct_view[param_pct_view] const& p); ---- === Description This function inserts a param before the specified position. All iterators that are equal to `before` or come after are invalidated. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``p`` | contains an invalid percent-encoding. |=== === Return Value An iterator to the inserted element. === Parameters |=== | Name | Description | *before* | An iterator before which the param is inserted. This may be equal to `end()`. | *p* | The param to insert. |=== [#boost-urls-params_encoded_ref-insert-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::insert Insert params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] insert( xref:boost-urls-params_encoded_base-iterator[iterator] before, std::initializer_list init); ---- === Description This function inserts the params in an _initializer-list_ before the specified position. All iterators that are equal to `before` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``init`` | contains an invalid percent-encoding. |=== === Return Value An iterator to the first element inserted, or `before` if `init.size() == 0`. === Parameters |=== | Name | Description | *before* | An iterator before which the element is inserted. This may be equal to `end()`. | *init* | The list of params to insert. |=== [#boost-urls-params_encoded_ref-insert-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::insert Insert params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_encoded_base-iterator[iterator] insert( xref:boost-urls-params_encoded_base-iterator[iterator] before, FwdIt first, FwdIt last); ---- === Description This function inserts a range of params before the specified position. All iterators that are equal to `before` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the first element inserted, or `before` if `first == last`. === Parameters |=== | Name | Description | *before* | An iterator before which the element is inserted. This may be equal to `end()`. | *first,* | last The range of params to insert. |=== [#boost-urls-params_encoded_ref-erase-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::erase Erase params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] erase(xref:boost-urls-params_encoded_base-iterator[iterator] pos) noexcept; ---- === Description This function removes an element from the container. All iterators that are equal to `pos` or come after are invalidated. [,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" ); ---- === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value An iterator to one past the removed element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. |=== [#boost-urls-params_encoded_ref-erase-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::erase Erase params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] erase( xref:boost-urls-params_encoded_base-iterator[iterator] first, xref:boost-urls-params_encoded_base-iterator[iterator] last) noexcept; ---- === Description This function removes a range of params from the container. All iterators that are equal to `first` or come after are invalidated. === Linear in `this->url().encoded_query().size()`. === Throws nothing. === Return Value An iterator to one past the removed range. === Parameters |=== | Name | Description | *first,* | last The range of params to erase. |=== [#boost-urls-params_encoded_ref-erase-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::erase Erase params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- std::size_t erase( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}) noexcept; ---- === Description All iterators are invalidated. [,cpp] ---- this->count( key, ic ) == 0 ---- === Linear in `this->url().encoded_query().size()`. === Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | contains an invalid percent-encoding. |=== === Return Value The number of params removed from the container. === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-params_encoded_ref-replace-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::replace Replace params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] replace( xref:boost-urls-params_encoded_base-iterator[iterator] pos, xref:boost-urls-param_pct_view[param_pct_view] const& p); ---- === Description This function replaces the contents of the element at `pos` with the specified param. All iterators that are equal to `pos` or come after are invalidated. [NOTE] The strings passed in must not come from the element being replaced, or else the behavior is undefined. [,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" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``p`` | contains an invalid percent-encoding. |=== === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *p* | The param to assign. |=== [#boost-urls-params_encoded_ref-replace-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::replace Replace params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] replace( xref:boost-urls-params_encoded_base-iterator[iterator] from, xref:boost-urls-params_encoded_base-iterator[iterator] to, std::initializer_list init); ---- === Description This function replaces a range of params with the params in an _initializer-list_ . All iterators that are equal to `from` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``init`` | contains an invalid percent-encoding. |=== === Return Value An iterator to the first element inserted, or one past `to` if `init.size() == 0`. === Parameters |=== | Name | Description | *from,to* | The range of params to replace. | *init* | The list of params to assign. |=== [#boost-urls-params_encoded_ref-replace-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::replace Replace params === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-params_encoded_base-iterator[iterator] replace( xref:boost-urls-params_encoded_base-iterator[iterator] from, xref: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. All iterators that are equal to `from` or come after are invalidated. [NOTE] The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_pct_view >::value == true ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the first element inserted, or one past `to` if `first == last`. === Parameters |=== | Name | Description | *from,to* | The range of params to replace. | *first,* | last The range of params to assign. |=== [#boost-urls-params_encoded_ref-set-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::set Set a value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] set( xref:boost-urls-params_encoded_base-iterator[iterator] pos, xref:boost-urls-pct_string_view[pct_string_view] value); ---- === Description This function replaces the value of an element at the specified position. All iterators that are equal to `pos` or come after are invalidated. [NOTE] The string passed in must not come from the element being replaced, or else the behavior is undefined. [,cpp] ---- url u( "?id=42&id=69" ); u.encoded_params().set( u.encoded_params().begin(), "none" ); assert( u.encoded_query() == "id=none&id=69" ); ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``value`` | contains an invalid percent-encoding. |=== === Return Value An iterator to the element. === Parameters |=== | Name | Description | *pos* | An iterator to the element. | *value* | The value to assign. The empty string still counts as a value. That is, `has_value` for the element is true. |=== [#boost-urls-params_encoded_ref-set-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-params_encoded_ref[pass:[params_encoded_ref]]::set Set a value === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_encoded_base-iterator[iterator] set( xref:boost-urls-pct_string_view[pct_string_view] key, xref:boost-urls-pct_string_view[pct_string_view] value, xref:boost-urls-ignore_case_param[ignore_case_param] ic = = {}); ---- === Description This function performs one of two actions depending on the value of `this->contains( key, ic )`. * If key is contained in the view then one of the matching params has its value changed to the specified value. The remaining params with a matching key are erased. Otherwise, * If `key` is not contained in the view, then the function apppends the param `{ key, value }`. All iterators are invalidated. [NOTE] The strings passed in must not come from the element being replaced, or else the behavior is undefined. [,cpp] ---- url u( "?id=42&id=69" ); u.encoded_params().set( "id", "none" ); assert( u.encoded_params().count( "id" ) == 1 ); ---- [,cpp] ---- this->count( key, ic ) == 1 && this->find( key, ic )->value == value ---- === Linear in `this->url().encoded_query().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | ``key`` | or `value` contain an invalid percent-encoding. |=== === Return Value An iterator to the appended or modified element. === Parameters |=== | Name | Description | *key* | The key to match. By default, a case-sensitive comparison is used. | *value* | The value to assign. The empty string still counts as a value. That is, `has_value` for the element is true. | *ic* | An optional parameter. If the value xref:boost-urls-ignore_case[ignore_case] is passed here, the comparison is case-insensitive. |=== [#boost-urls-segments_encoded_base-iterator-2constructor-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator() = default; ---- [#boost-urls-segments_encoded_base-iterator-2constructor-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator(xref:boost-urls-segments_encoded_base-iterator[iterator] const&) = default; ---- [#boost-urls-segments_encoded_base-iterator-operator_dec-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator]& operator--() noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_dec-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] operator--(int) noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_inc-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator]& operator++() noexcept; ---- [#boost-urls-segments_encoded_base-iterator-operator_inc-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_base[pass:[segments_encoded_base]]::xref:boost-urls-segments_encoded_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] operator++(int) noexcept; ---- [#boost-urls-segments_encoded_view-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_view[pass:[segments_encoded_view]]::segments_encoded_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr segments_encoded_view() = default; ---- === Description Default-constructed segments have zero elements. [,cpp] ---- segments_encoded_view ps; ---- [,cpp] ---- return segments_encoded_view( "" ); ---- === Constant. === Throws nothing. [#boost-urls-segments_encoded_view-2constructor-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_view[pass:[segments_encoded_view]]::segments_encoded_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr segments_encoded_view(xref:boost-urls-segments_encoded_view[segments_encoded_view] const&) noexcept = default; ---- === Description After construction, both views reference the same character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant. === Throws nothing [#boost-urls-segments_encoded_view-2constructor-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_view[pass:[segments_encoded_view]]::segments_encoded_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- segments_encoded_view(core::string_view s); ---- === Description This function constructs segments from a valid path string, which can contain percent escapes. Upon construction, the view references the character buffer pointed to by `s`. caller is responsible for ensuring that the lifetime of the buffer extends until the view is destroyed. [,cpp] ---- segments_encoded_view ps( "/path/to/file.txt" ); ---- [,cpp] ---- return parse_path( s ).value(); ---- [,cpp] ---- this->buffer().data() == s.data() ---- === Linear in `s`. === Exceptions thrown on invalid input. [,cpp] ---- path = [ "/" ] [ segment *( "/" segment ) ] segment = *pchar ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid path. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-segments_encoded_ref-operator_assign-02c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref]& operator=(xref:boost-urls-segments_encoded_ref[segments_encoded_ref] const& other); ---- === Description The existing contents are replaced by a copy of the other segments. All iterators are invalidated. [NOTE] None of the character buffers referenced by `other` may overlap the buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. @{ === Parameters |=== | Name | Description | *other* | The segments to assign. |=== [#boost-urls-segments_encoded_ref-operator_assign-02e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref]& operator=(xref:boost-urls-segments_encoded_view[segments_encoded_view] const& other); ---- [#boost-urls-segments_encoded_ref-operator_assign-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_ref[segments_encoded_ref]& operator=(std::initializer_list init); ---- === Description The existing contents are replaced by a copy of the contents of the initializer list. Reserved characters in the list are automatically escaped. Escapes in the list are preserved. All iterators are invalidated. [,cpp] ---- url u; u.encoded_segments() = {"path", "to", "file.txt"}; ---- === None of the character buffers referenced by the list may overlap the character buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( init.begin(), init.end() ); ---- === Linear in `init.size() + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | list contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *init* | The list of segments to assign. |=== [#boost-urls-segments_encoded_ref-assign-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::assign Assign segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void assign(std::initializer_list init); ---- === Description The existing contents are replaced by a copy of the contents of the initializer list. Reserved characters in the list are automatically escaped. Escapes in the list are preserved. All iterators are invalidated. [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. [,cpp] ---- url u; u.segments().assign( {"path", "to", "file.txt"} ); ---- === Linear in `init.size() + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | list contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *init* | The list of segments to assign. |=== [#boost-urls-segments_encoded_ref-assign-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::assign Assign segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template void assign( FwdIt first, FwdIt last); ---- === Description The existing contents are replaced by a copy of the contents of the range. Reserved characters in the range are automatically escaped. Escapes in the range are preserved. All iterators are invalidated. [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. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, pct_string_view >::value == true ---- === Linear in `std::distance( first, last ) + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | range contains an invalid percent-encoding. |=== === Parameters |=== | Name | Description | *first,* | last The range of segments to assign. |=== [#boost-urls-segments_encoded_ref-erase-006] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::erase Erase segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] erase(xref:boost-urls-segments_encoded_base-iterator[iterator] pos) noexcept; ---- === Description This function removes a segment. All iterators that are equal to `pos` or come after are invalidated. === Linear in `this->url().encoded_resource().size()`. === Throws nothing. === Return Value An iterator to one past the removed segment. === Parameters |=== | Name | Description | *pos* | An iterator to the element. |=== [#boost-urls-segments_encoded_ref-erase-00a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::erase Erase segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] erase( xref:boost-urls-segments_encoded_base-iterator[iterator] first, xref:boost-urls-segments_encoded_base-iterator[iterator] last) noexcept; ---- === Description This function removes a range of segments from the container. All iterators that are equal to `first` or come after are invalidated. === Linear in `this->url().encoded_resource().size()`. === Throws nothing. === Return Value An iterator to one past the removed range. === Parameters |=== | Name | Description | *first,* | last The range of segments to erase. |=== [#boost-urls-segments_encoded_ref-insert-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::insert Insert segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] insert( xref:boost-urls-segments_encoded_base-iterator[iterator] before, xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function inserts a segment before the specified position. Reserved characters in the segment are automatically escaped. Escapes in the segment are preserved. All iterators that are equal to `before` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | segment contains an invalid percent-encoding. |=== === Return Value An iterator to the inserted segment. === Parameters |=== | Name | Description | *before* | An iterator before which the segment is inserted. This may be equal to `end()`. | *s* | The segment to insert. |=== [#boost-urls-segments_encoded_ref-insert-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::insert Insert segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] insert( xref:boost-urls-segments_encoded_base-iterator[iterator] before, std::initializer_list init); ---- === Description This function inserts the segments in an initializer list before the specified position. Reserved characters in the list are automatically escaped. Escapes in the list are preserved. All iterators that are equal to `before` or come after are invalidated. [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. [,cpp] ---- url u( "/file.txt" ); u.encoded_segments().insert( u.encoded_segments().begin(), { "path", "to" } ); ---- === Linear in `init.size() + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | list contains an invalid percent-encoding. |=== === Return Value An iterator to the first element inserted, or `before` if `init.size() == 0`. === Parameters |=== | Name | Description | *before* | An iterator before which the list is inserted. This may be equal to `end()`. | *init* | The list of segments to insert. |=== [#boost-urls-segments_encoded_ref-insert-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::insert Insert segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_encoded_base-iterator[iterator] insert( xref: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. Reserved characters in the range are automatically escaped. Escapes in the range are preserved. All iterators that are equal to `before` or come after are invalidated. [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. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, pct_string_view >::value == true ---- === Linear in `std::distance( first, last ) + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the first segment inserted, or `before` if `init.empty()`. === Parameters |=== | Name | Description | *before* | An iterator before which the range is inserted. This may be equal to `end()`. | *first,* | last The range of segments to insert. |=== [#boost-urls-segments_encoded_ref-replace-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] replace( xref:boost-urls-segments_encoded_base-iterator[iterator] pos, xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function replaces the segment at the specified position. Reserved characters in the string are automatically escaped. Escapes in the string are preserved. All iterators that are equal to `pos` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the replaced segment. === Parameters |=== | Name | Description | *pos* | An iterator to the segment. | *s* | The string to assign. |=== [#boost-urls-segments_encoded_ref-replace-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] replace( xref:boost-urls-segments_encoded_base-iterator[iterator] from, xref:boost-urls-segments_encoded_base-iterator[iterator] to, xref:boost-urls-pct_string_view[pct_string_view] s); ---- === Description This function replaces a range of segments with one segment. Reserved characters in the string are automatically escaped. Escapes in the string are preserved. All iterators that are equal to `from` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | string contains an invalid percent-encoding. |=== === Return Value An iterator to the new segment. === Parameters |=== | Name | Description | *from,* | to The range of segments to replace. | *s* | The string to assign. |=== [#boost-urls-segments_encoded_ref-replace-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_encoded_base-iterator[iterator] replace( xref:boost-urls-segments_encoded_base-iterator[iterator] from, xref:boost-urls-segments_encoded_base-iterator[iterator] to, std::initializer_list init); ---- === Description This function replaces a range of segments with a list of segments in an initializer list. Reserved characters in the list are automatically escaped. Escapes in the list are preserved. All iterators that are equal to `from` or come after are invalidated. === None of the character buffers referenced by the list may overlap the character buffer of the underlying url, or else the behavior is undefined. === Linear in `init.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | list contains an invalid percent-encoding. |=== === Return Value An iterator to the first segment inserted, or one past `to` if `init.size() == 0`. === Parameters |=== | Name | Description | *from,* | to The range of segments to replace. | *init* | The list of segments to assign. |=== [#boost-urls-segments_encoded_ref-replace-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_encoded_ref[pass:[segments_encoded_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_encoded_base-iterator[iterator] replace( xref:boost-urls-segments_encoded_base-iterator[iterator] from, xref: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. Reserved characters in the new range are automatically escaped. Escapes in the new range are preserved. All iterators that are equal to `from` or come after are invalidated. === 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. === Linear in `std::distance( first, last ) + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input. === Exceptions |=== | Name | Thrown on | `The` | range contains an invalid percent-encoding. |=== === Return Value An iterator to the first segment inserted, or one past `to` if `init.size() == 0`. === Parameters |=== | Name | Description | *from,* | to The range of segments to replace. | *first,* | last The range of segments to assign. |=== [#boost-urls-segments_base-iterator-2constructor-0a] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator() = default; ---- [#boost-urls-segments_base-iterator-2constructor-00] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::iterator === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr iterator(xref:boost-urls-segments_base-iterator[iterator] const&) = default; ---- [#boost-urls-segments_base-iterator-operator_inc-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator]& operator++() noexcept; ---- [#boost-urls-segments_base-iterator-operator_inc-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator++ === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] operator++(int) noexcept; ---- [#boost-urls-segments_base-iterator-operator_dec-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator]& operator--() noexcept; ---- [#boost-urls-segments_base-iterator-operator_dec-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_base[pass:[segments_base]]::xref:boost-urls-segments_base-iterator[pass:[iterator]]::operator-- === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] operator--(int) noexcept; ---- [#boost-urls-segments_view-2constructor-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_view[pass:[segments_view]]::segments_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr segments_view() = default; ---- === Description Default-constructed segments have zero elements. [,cpp] ---- segments_view ps; ---- [,cpp] ---- return segments_view( "" ); ---- === Constant. === Throws nothing. [#boost-urls-segments_view-2constructor-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_view[pass:[segments_view]]::segments_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- constexpr segments_view(xref:boost-urls-segments_view[segments_view] const& other) = default; ---- === Description After construction, viewss reference the same underlying character buffer. Ownership is not transferred; the caller is responsible for ensuring the lifetime of the buffer extends until it is no longer referenced. [,cpp] ---- this->buffer().data() == other.buffer().data() ---- === Constant === Throws nothing [#boost-urls-segments_view-2constructor-0e] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_view[pass:[segments_view]]::segments_view Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- segments_view(core::string_view s); ---- === Description This function constructs segments from a valid path string, which can contain percent escapes. Upon construction, the view references the character buffer pointed to by `s`. caller is responsible for ensuring that the lifetime of the buffer extends until the view is destroyed. [,cpp] ---- segments_view ps( "/path/to/file.txt" ); ---- [,cpp] ---- return parse_path( s ).value(); ---- [,cpp] ---- this->buffer().data() == s.data() ---- === Linear in `s`. === Exceptions thrown on invalid input. [,cpp] ---- path = [ "/" ] [ segment *( "/" segment ) ] segment = *pchar ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.3[3.3. Path] === Exceptions |=== | Name | Thrown on | ``s`` | contains an invalid path. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-segments_ref-operator_assign-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_ref[segments_ref]& operator=(xref:boost-urls-segments_ref[segments_ref] const& other); ---- === Description The existing contents are replaced by a copy of the other segments. All iterators are invalidated. [NOTE] None of the character buffers referenced by `other` may overlap the buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( other.begin(), other.end() ); ---- === Linear in `other.buffer().size()`. === Strong guarantee. Calls to allocate may throw. @{ === Parameters |=== | Name | Description | *other* | The segments to assign. |=== [#boost-urls-segments_ref-operator_assign-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::operator= === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_ref[segments_ref]& operator=(xref:boost-urls-segments_view[segments_view] const& other); ---- [#boost-urls-segments_ref-operator_assign-0f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_ref[segments_ref]& operator=(std::initializer_list init); ---- === Description The existing contents are replaced by a copy of the contents of the initializer list. Reserved characters in the list are automatically escaped. All iterators are invalidated. [,cpp] ---- url u; u.segments() = { "path", "to", "file.txt" }; ---- === None of the character buffers referenced by the list may overlap the character buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- this->assign( init.begin(), init.end() ); ---- === Linear in `init.size() + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *init* | The list of segments to assign. |=== [#boost-urls-segments_ref-assign-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::assign Assign segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void assign(std::initializer_list init); ---- === Description The existing contents are replaced by a copy of the contents of the initializer list. Reserved characters in the list are automatically escaped. All iterators are invalidated. [NOTE] None of the character buffers referenced by `init` may overlap the character buffer of the underlying url, or else the behavior is undefined. [,cpp] ---- url u; u.segments().assign( { "path", "to", "file.txt" } ); ---- === Linear in `init.size() + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *init* | The list of segments to assign. |=== [#boost-urls-segments_ref-assign-0d] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::assign Assign segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template void assign( FwdIt first, FwdIt last); ---- === Description The existing contents are replaced by a copy of the contents of the range. Reserved characters in the range are automatically escaped. All iterators are invalidated. [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. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, core::string_view >::value == true ---- === Linear in `std::distance( first, last ) + this->url().encoded_query().size() + this->url().encoded_fragment().size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *first,* | last The range of segments to assign. |=== [#boost-urls-segments_ref-erase-0af2] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::erase Erase segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] erase(xref:boost-urls-segments_base-iterator[iterator] pos) noexcept; ---- === Description This function removes a segment. All iterators that are equal to `pos` or come after are invalidated. === Linear in `this->url().encoded_resource().size()`. === Throws nothing. === Return Value An iterator to one past the removed segment. === Parameters |=== | Name | Description | *pos* | An iterator to the segment. |=== [#boost-urls-segments_ref-erase-0af5] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::erase Erase segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] erase( xref:boost-urls-segments_base-iterator[iterator] first, xref:boost-urls-segments_base-iterator[iterator] last) noexcept; ---- === Description This function removes a range of segments. All iterators that are equal to `first` or come after are invalidated. === Linear in `this->url().encoded_resource().size()`. === Throws nothing. === Return Value An iterator to one past the removed range. === Parameters |=== | Name | Description | *first,* | last The range of segments to erase. |=== [#boost-urls-segments_ref-insert-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::insert Insert segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] insert( xref:boost-urls-segments_base-iterator[iterator] before, core::string_view s); ---- === Description This function inserts a segment before the specified position. Reserved characters in the segment are automatically escaped. All iterators that are equal to `before` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the inserted segment. === Parameters |=== | Name | Description | *before* | An iterator before which the segment is inserted. This may be equal to `end()`. | *s* | The segment to insert. |=== [#boost-urls-segments_ref-insert-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::insert Insert segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] insert( xref:boost-urls-segments_base-iterator[iterator] before, std::initializer_list init); ---- === Description This function inserts the segments in an initializer list before the specified position. Reserved characters in the list are percent-escaped in the result. All iterators that are equal to `before` or come after are invalidated. [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. [,cpp] ---- url u( "/file.txt" ); u.segments().insert( u.segments().begin(), { "path", "to" } ); ---- === Linear in `init.size() + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first element inserted, or `before` if `init.size() == 0`. === Parameters |=== | Name | Description | *before* | An iterator before which the list is inserted. This may be equal to `end()`. | *init* | The list of segments to insert. |=== [#boost-urls-segments_ref-insert-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::insert Insert segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_base-iterator[iterator] insert( xref:boost-urls-segments_base-iterator[iterator] before, FwdIt first, FwdIt last); ---- === Description This function inserts the segments in a range before the specified position. Reserved characters in the list are automatically escaped. All iterators that are equal to `before` or come after are invalidated. [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. [,cpp] ---- std::is_convertible< std::iterator_traits< FwdIt >::reference_type, core::string_view >::value == true ---- === Linear in `std::distance( first, last ) + this->url().encoded_resource().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first segment inserted, or `before` if `init.empty()`. === Parameters |=== | Name | Description | *before* | An iterator before which the range is inserted. This may be equal to `end()`. | *first,* | last The range of segments to insert. |=== [#boost-urls-segments_ref-replace-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] replace( xref:boost-urls-segments_base-iterator[iterator] pos, core::string_view s); ---- === Description This function replaces the segment at the specified position. Reserved characters in the string are automatically escaped. All iterators that are equal to `pos` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the replaced segment. === Parameters |=== | Name | Description | *pos* | An iterator to the segment. | *s* | The string to assign. |=== [#boost-urls-segments_ref-replace-04] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] replace( xref:boost-urls-segments_base-iterator[iterator] from, xref:boost-urls-segments_base-iterator[iterator] to, core::string_view s); ---- === Description This function replaces a range of segments with one segment. Reserved characters in the string are automatically escaped. All iterators that are equal to `from` or come after are invalidated. === Linear in `s.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the new segment. === Parameters |=== | Name | Description | *from,* | to The range of segments to replace. | *s* | The string to assign. |=== [#boost-urls-segments_ref-replace-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-segments_base-iterator[iterator] replace( xref:boost-urls-segments_base-iterator[iterator] from, xref:boost-urls-segments_base-iterator[iterator] to, std::initializer_list init); ---- === Description This function replaces a range of segments with a list of segments in an initializer list. Reserved characters in the list are automatically escaped. All iterators that are equal to `from` or come after are invalidated. === None of the character buffers referenced by the list may overlap the character buffer of the underlying url, or else the behavior is undefined. === Linear in `init.size() + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first segment inserted, or one past `to` if `init.size() == 0`. === Parameters |=== | Name | Description | *from,* | to The range of segments to replace. | *init* | The list of segments to assign. |=== [#boost-urls-segments_ref-replace-07] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-segments_ref[pass:[segments_ref]]::replace Replace segments === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-segments_base-iterator[iterator] replace( xref:boost-urls-segments_base-iterator[iterator] from, xref:boost-urls-segments_base-iterator[iterator] to, FwdIt first, FwdIt last); ---- === Description This function replaces a range of segments with annother range of segments. Reserved characters in the new range are automatically escaped. All iterators that are equal to `from` or come after are invalidated. === 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. === Linear in `std::distance( first, last ) + this->url().encoded_resouce().size()`. === Strong guarantee. Calls to allocate may throw. === Return Value An iterator to the first segment inserted, or one past `to` if `init.size() == 0`. === Parameters |=== | Name | Description | *from,* | to The range of segments to replace. | *first,* | last The range of segments to assign. |=== [#boost-urls-url_view_base-params-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url_view_base[pass:[url_view_base]]::params Return the query as a container of parameters === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view[params_view] params() const noexcept; ---- === Description This function returns a bidirectional view of key/value pairs over the query. The returned view references the same underlying character buffer; ownership is not transferred. Any percent-escapes in strings returned when iterating the view are decoded first. [,cpp] ---- params_view pv = url_view( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params(); ---- === Constant. === Throws nothing. [,cpp] ---- query = *( pchar / "/" / "?" ) query-param = key [ "=" value ] query-params = [ query-param ] *( "&" query-param ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 >3.4. Query (rfc3986) @li ` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-params_view[params_view] params(xref:boost-urls-encoding_opts[encoding_opts] opt) const noexcept; ---- [#boost-urls-url-2constructor-0f0] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url() noexcept; ---- === Description Default constructed urls contain a zero-length string. This matches the grammar for a relative-ref with an empty path and no query or fragment. [,cpp] ---- url u; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- === 4.2. Relative Reference (rfc3986) [#boost-urls-url-2constructor-002] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit url(core::string_view s); ---- === Description This function constructs a URL from the string `s`, which must contain a valid _URI_ or _relative-ref_ or else an exception is thrown. The new url retains ownership by allocating a copy of the passed string. [,cpp] ---- url u( "https://www.example.com" ); ---- [,cpp] ---- return url( parse_uri_reference( s ).value() ); ---- [,cpp] ---- this->buffer().data() != s.data() ---- === Linear in `s.size()`. === Calls to allocate may throw. Exceptions thrown on invalid input. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4.1. URI Reference] === Exceptions |=== | Name | Thrown on | `The` | input does not contain a valid url. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-url-2constructor-01] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url(xref:boost-urls-url[url]&& u) noexcept; ---- === Description The contents of `u` are transferred to the newly constructed object, which includes the underlying character buffer. After construction, the moved-from object is as if default constructed. [,cpp] ---- u.empty() == true ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *u* | The url to move from. |=== [#boost-urls-url-2constructor-001] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url(xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description The newly constructed object contains a copy of `u`. [,cpp] ---- this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data() ---- === Linear in `u.size()`. === Strong guarantee. Calls to allocate may throw. === Exceptions |=== | Name | Thrown on | ``u.size()` | > max_size()`. |=== === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-url-2constructor-0f7] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- url(xref:boost-urls-url[url] const& u); ---- === Description The newly constructed object contains a copy of `u`. [,cpp] ---- this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data() ---- === Linear in `u.size()`. === Strong guarantee. Calls to allocate may throw. === Exceptions |=== | Name | Thrown on | ``u.size()` | > max_size()`. |=== === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-url-operator_assign-09] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& operator=(xref:boost-urls-url[url]&& u) noexcept; ---- === Description The contents of `u` are transferred to `this`, including the underlying character buffer. The previous contents of `this` are destroyed. After assignment, the moved-from object is as if default constructed. [,cpp] ---- u.empty() == true ---- === Constant. === Throws nothing. === Parameters |=== | Name | Description | *u* | The url to assign from. |=== [#boost-urls-url-operator_assign-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& operator=(xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description The contents of `u` are copied and the previous contents of `this` are destroyed. Capacity is preserved, or increases. [,cpp] ---- this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data() ---- === Linear in `u.size()`. === Strong guarantee. Calls to allocate may throw. === Exceptions |=== | Name | Thrown on | ``u.size()` | > max_size()`. |=== === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-url-operator_assign-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-url[pass:[url]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url]& operator=(xref:boost-urls-url[url] const& u); ---- === Description The contents of `u` are copied and the previous contents of `this` are destroyed. Capacity is preserved, or increases. [,cpp] ---- this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data() ---- === Linear in `u.size()`. === Strong guarantee. Calls to allocate may throw. === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-format-05] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::format Format arguments into a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template xref:boost-urls-url[url] format( core::string_view fmt, Args&&... args); ---- === Description Format arguments according to the format URL string into a xref:boost-urls-url[url] . The rules for a format URL string are the same as for a `std::format_string`, where replacement fields are delimited by curly braces. The URL components to which replacement fields belong are identified before replacement is applied and any invalid characters for that formatted argument are percent-escaped. Hence, the delimiters between URL components, such as `:`, `//`, `?`, and `#`, should be included in the URL format string. Likewise, a format string with a single `"{}"` is interpreted as a path and any replacement characters invalid in this component will be encoded to form a valid URL. [,cpp] ---- assert(format("{}", "Hello world!").buffer() == "Hello%20world%21"); ---- === All replacement fields must be valid and the resulting URL should be valid after arguments are formatted into the URL. 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-encoding of arbitrary characters. [,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 ---- * link:https://fmt.dev/latest/syntax.html[Format String Syntax] === Exceptions |=== | Name | Thrown on | ``fmt`` | contains an invalid format string and the result contains an invalid URL after replacements are applied. |=== === Return Value A URL holding the formatted result. === Parameters |=== | Name | Description | *fmt* | The format URL string. | *args* | Arguments to be formatted. |=== === See Also xref:boost-urls-format_to-0b[format_to] . [#boost-urls-format-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::format Format arguments into a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-url[url] format( core::string_view fmt, std::initializer_list args); ---- === Description Format arguments according to the format URL string into a xref:boost-urls-url[url] . This overload allows type-erased arguments to be passed as an initializer_list, which is mostly convenient for named parameters. All arguments must be convertible to a implementation defined type able to store a type-erased reference to any valid format argument. The rules for a format URL string are the same as for a `std::format_string`, where replacement fields are delimited by curly braces. The URL components to which replacement fields belong are identified before replacement is applied and any invalid characters for that formatted argument are percent-escaped. Hence, the delimiters between URL components, such as `:`, `//`, `?`, and `#`, should be included in the URL format string. Likewise, a format string with a single `"{}"` is interpreted as a path and any replacement characters invalid in this component will be encoded to form a valid URL. [,cpp] ---- assert(format("user/{id}", {{"id", 1}}).buffer() == "user/1"); ---- === All replacement fields must be valid and the resulting URL should be valid after arguments are formatted into the URL. 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-encoding of arbitrary characters. [,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 ---- * link:https://fmt.dev/latest/syntax.html[Format String Syntax] === Exceptions |=== | Name | Thrown on | ``fmt`` | contains an invalid format string and the result contains an invalid URL after replacements are applied. |=== === Return Value A URL holding the formatted result. === Parameters |=== | Name | Description | *fmt* | The format URL string. | *args* | Arguments to be formatted. |=== === See Also xref:boost-urls-format_to-0b[format_to] . [#boost-urls-format_to-02] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::format_to Format arguments into a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- template void format_to( xref:boost-urls-url_base[url_base]& u, core::string_view fmt, Args&&... args); ---- === Description Format arguments according to the format URL string into a xref:boost-urls-url_base[url_base] . The rules for a format URL string are the same as for a `std::format_string`, where replacement fields are delimited by curly braces. The URL components to which replacement fields belong are identified before replacement is applied and any invalid characters for that formatted argument are percent-escaped. Hence, the delimiters between URL components, such as `:`, `//`, `?`, and `#`, should be included in the URL format string. Likewise, a format string with a single `"{}"` is interpreted as a path and any replacement characters invalid in this component will be encoded to form a valid URL. [,cpp] ---- static_url<30> u; format(u, "{}", "Hello world!"); assert(u.buffer() == "Hello%20world%21"); ---- === All replacement fields must be valid and the resulting URL should be valid after arguments are formatted into the URL. 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-encoding of arbitrary characters. === Strong guarantee. [,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 ---- * link:https://fmt.dev/latest/syntax.html[Format String Syntax] === Exceptions |=== | Name | Thrown on | ``fmt`` | contains an invalid format string and `u` contains an invalid URL after replacements are applied. |=== === Parameters |=== | Name | Description | *u* | An object that derives from xref:boost-urls-url_base[url_base] . | *fmt* | The format URL string. | *args* | Arguments to be formatted. |=== === See Also xref:boost-urls-format-02[format] . [#boost-urls-format_to-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::format_to Format arguments into a URL === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- void format_to( xref:boost-urls-url_base[url_base]& u, core::string_view fmt, std::initializer_list args); ---- === Description Format arguments according to the format URL string into a xref:boost-urls-url_base[url_base] . This overload allows type-erased arguments to be passed as an initializer_list, which is mostly convenient for named parameters. All arguments must be convertible to a implementation defined type able to store a type-erased reference to any valid format argument. The rules for a format URL string are the same as for a `std::format_string`, where replacement fields are delimited by curly braces. The URL components to which replacement fields belong are identified before replacement is applied and any invalid characters for that formatted argument are percent-escaped. Hence, the delimiters between URL components, such as `:`, `//`, `?`, and `#`, should be included in the URL format string. Likewise, a format string with a single `"{}"` is interpreted as a path and any replacement characters invalid in this component will be encoded to form a valid URL. [,cpp] ---- static_url<30> u; format_to(u, "user/{id}", {{"id", 1}}) assert(u.buffer() == "user/1"); ---- === All replacement fields must be valid and the resulting URL should be valid after arguments are formatted into the URL. 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-encoding of arbitrary characters. === Strong guarantee. [,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 ---- * link:https://fmt.dev/latest/syntax.html[Format String Syntax] === Exceptions |=== | Name | Thrown on | ``fmt`` | contains an invalid format string and `u` contains an invalid URL after replacements are applied. |=== === Parameters |=== | Name | Description | *u* | An object that derives from xref:boost-urls-url_base[url_base] . | *fmt* | The format URL string. | *args* | Arguments to be formatted. |=== === See Also xref:boost-urls-format-02[format] . [#boost-urls-static_url-2constructor-098] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::static_url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- static_url() noexcept; ---- === Description Default constructed urls contain a zero-length string. This matches the grammar for a relative-ref with an empty path and no query or fragment. [,cpp] ---- static_url< 1024 > u; ---- [,cpp] ---- this->empty() == true ---- === Constant. === Throws nothing. [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- === 4.2. Relative Reference (rfc3986) [#boost-urls-static_url-2constructor-08] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::static_url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- explicit static_url(core::string_view s); ---- === Description This function constructs a url from the string `s`, which must contain a valid _URI_ or _relative-ref_ or else an exception is thrown. The new url retains ownership by making a copy of the passed string. [,cpp] ---- static_url< 1024 > u( "https://www.example.com" ); ---- [,cpp] ---- return static_url( parse_uri_reference( s ).value() ); ---- [,cpp] ---- this->buffer().data() != s.data() ---- === Linear in `s.size()`. === Exceptions thrown on invalid input. [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4.1. URI Reference] === Exceptions |=== | Name | Thrown on | `The` | input does not contain a valid url. |=== === Parameters |=== | Name | Description | *s* | The string to parse. |=== [#boost-urls-static_url-2constructor-09f] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::static_url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- static_url(xref:boost-urls-static_url[static_url] const& u) noexcept; ---- === Description The newly constructed object contains a copy of `u`. [,cpp] ---- this->buffer() == u.buffer() && this->buffer.data() != u.buffer().data() ---- === Linear in `u.size()`. === Exception thrown if maximum size exceeded. === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-static_url-2constructor-0b] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::static_url Constructor === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- static_url(xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description The newly constructed object contains a copy of `u`. [,cpp] ---- this->buffer() == u.buffer() && this->buffer.data() != u.buffer().data() ---- === Linear in `u.size()`. === Exception thrown if capacity exceeded. === Exceptions |=== | Name | Thrown on | `Capacity` | would be exceeded. |=== === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-static_url-operator_assign-06] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& operator=(xref:boost-urls-static_url[static_url] const& u) noexcept; ---- === Description The contents of `u` are copied and the previous contents of `this` are discarded. Capacity remains unchanged. [,cpp] ---- this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data() ---- === Linear in `u.size()`. === Throws nothing. === Parameters |=== | Name | Description | *u* | The url to copy. |=== [#boost-urls-static_url-operator_assign-0c] == xref:boost[pass:[boost]]::xref:boost-urls[pass:[urls]]::xref:boost-urls-static_url[pass:[static_url]]::operator= Assignment === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost-urls-static_url[static_url]& operator=(xref:boost-urls-url_view_base[url_view_base] const& u); ---- === Description The contents of `u` are copied and the previous contents of `this` are discarded. [,cpp] ---- this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data() ---- === Linear in `u.size()`. === Strong guarantee. Exception thrown if capacity exceeded. === Exceptions |=== | Name | Thrown on | `Capacity` | would be exceeded. |=== === Parameters |=== | Name | Description | *u* | The url to copy. |=== Created with MrDocs