Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit e70692e4d8.
PrevUpHomeNext
authority_view::host_ipv4_address

Return the host IPv4 address.

Synopsis
ipv4_address
host_ipv4_address() const;
Description

If the host type is host_type::ipv4, this function returns the address as a value of type 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".

Example
assert( url_view( "http://127.0.0.1/index.htm?user=win95" ).host_ipv4_address() == ipv4_address( "127.0.0.1" ) );
Complexity

Constant.

Exception Safety

Throws nothing.

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
Specification

PrevUpHomeNext