[#ACDEA9F7F68B0112FD4BD827D3693E33E8F6D6AF]

Function url_view_base:: zone_id

Return the IPv6 Zone ID

Synopsis

            template
StringToken::result_type
zone_id(StringToken&& token) const;
        

Description

If the host type is 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.

Example

assert( url_view( "http://[fe80::1%25eth0]/" ).zone_id() == "eth0" );

Complexity

Linear in `this->encoded_zone_id().size()`.

Exception Safety

Calls to allocate may throw.

BNF

host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPv6addrz / IPvFuture ) "]" ZoneID = 1*( unreserved / pct-encoded ) IPv6addrz = IPv6address "%25" ZoneID

Specification

  • Representing IPv6 Zone Identifiers in Address Literals and Uniform Resource Identifiers