Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

ipv4_address

An IP version 4 style address.

Synopsis

Defined in header <boost/url/ipv4_address.hpp>

class ipv4_address
Types

Name

Description

bytes_type

The type used to represent an address as an array of bytes.

uint_type

The type used to represent an address as an unsigned integer.

Member Functions

Name

Description

ipv4_address [constructor]

Constructor.

Construct from an unsigned integer.

Construct from an array of bytes.

Construct from a string.

is_loopback

Return true if the address is a loopback address.

is_multicast

Return true if the address is a multicast address.

is_unspecified

Return true if the address is unspecified.

operator=

Copy Assignment.

to_buffer

Write a dotted decimal string representing the address to a buffer.

to_bytes

Return the address as bytes, in network byte order.

to_string

Return the address as a string in dotted decimal format.

to_uint

Return the address as an unsigned integer.

Static Member Functions

Name

Description

any

Return an address object that represents any address.

broadcast

Return an address object that represents the broadcast address.

loopback

Return an address object that represents the loopback address.

Static Members

Name

Description

max_str_len

The number of characters in the longest possible IPv4 string.

Friends

Name

Description

operator==

Return true if two addresses are equal.

operator!=

Return true if two addresses are not equal.

operator<<

Format the address to an output stream.

Description

Objects of this type are used to construct, parse, and manipulate IP version 6 addresses.

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
See Also

parse_ipv4_address, ipv6_address.

Convenience header <boost/url.hpp>


PrevUpHomeNext