Boost.URL Logo

PrevUpHomeNext
url_view::ipv6_address

Return the host as an IPv6 address.

Synopsis
urls::ipv6_address
ipv6_address() const;
Description

If host_type equals urls::host_type::ipv6, this function returns the corresponding ipv6_address of the host if it exists, otherwise it returns the unspecified address which is equal to "0:0:0:0:0:0:0:0".

Example
url_view u( "ftp://[::1]" );

ipv6_address ip = u.ipv6_address();

assert( ip.is_loopback() );
BNF
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
Exception Safety

Throws nothing.

Specification
See Also

encoded_hostname, hostname, host_type, ipv4_address, ipvfuture, urls::ipv6_address.


PrevUpHomeNext