Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
url::set_encoded_authority

Set the authority.

Synopsis
url&
set_encoded_authority(
    pct_string_view s);
Description

This function sets the authority to the specified string. The string may contain percent-escapes.

Example
assert( [link url.ref.boost__urls__url.url `url`]().[link url.ref.boost__urls__url.set_encoded_authority `set_encoded_authority`]( "My%20Computer" ).[link url.ref.boost__urls__url.has_authority `has_authority`]() );
Exception Safety

Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.

Exceptions

Type

Thrown On

system_eror

The string contains an invalid percent-encoding.

Parameters

Name

Description

s

The authority string to set.

BNF
[link url.ref.boost__urls__url.authority `authority`]     = [ [link url.ref.boost__urls__url.userinfo `userinfo`] "@" ] [link url.ref.boost__urls__url.host `host`] [ ":" [link url.ref.boost__urls__url.port `port`] ]

[link url.ref.boost__urls__url.userinfo `userinfo`]      = *( unreserved / pct-encoded / sub-delims / ":" )
[link url.ref.boost__urls__url.host `host`]          = IP-literal / IPv4address / reg-[link url.ref.boost__urls__host_type `name`]
[link url.ref.boost__urls__url.port `port`]          = *DIGIT
Specification
See Also

/root/project/libs/url/include/boost/url/url.hpp


PrevUpHomeNext