Boost.URL Logo

PrevUpHomeNext
url_view::ipv4_address

Return the host as an IPv4 address.

Synopsis
urls::ipv4_address
ipv4_address() const;
Description

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

Example
url_view u( "http://127.0.0.1/index.htm?user=win95" );

ipv4_address ip = u.ipv4_address();
BNF
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
Exception Safety

Throws nothing.

Specification
See Also

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


PrevUpHomeNext