Implements IP version 4 style addresses.
More...
#include <address_v4.hpp>
|
| address_v4 () ASIO_NOEXCEPT |
| Default constructor.
|
|
ASIO_DECL | address_v4 (const bytes_type &bytes) |
| Construct an address from raw bytes.
|
|
ASIO_DECL | address_v4 (uint_type addr) |
| Construct an address from an unsigned integer in host byte order.
|
|
| address_v4 (const address_v4 &other) ASIO_NOEXCEPT |
| Copy constructor.
|
|
address_v4 & | operator= (const address_v4 &other) ASIO_NOEXCEPT |
| Assign from another address.
|
|
ASIO_DECL bytes_type | to_bytes () const ASIO_NOEXCEPT |
| Get the address in bytes, in network byte order.
|
|
ASIO_DECL uint_type | to_uint () const ASIO_NOEXCEPT |
| Get the address as an unsigned integer in host byte order.
|
|
ASIO_DECL unsigned long | to_ulong () const |
| Get the address as an unsigned long in host byte order.
|
|
ASIO_DECL std::string | to_string () const |
| Get the address as a string in dotted decimal format.
|
|
ASIO_DECL std::string | to_string (asio::error_code &ec) const |
| (Deprecated: Use other overload.) Get the address as a string in dotted decimal format. More...
|
|
ASIO_DECL bool | is_loopback () const ASIO_NOEXCEPT |
| Determine whether the address is a loopback address.
|
|
ASIO_DECL bool | is_unspecified () const ASIO_NOEXCEPT |
| Determine whether the address is unspecified.
|
|
ASIO_DECL bool | is_class_a () const |
| (Deprecated: Use network_v4 class.) Determine whether the address is a class A address. More...
|
|
ASIO_DECL bool | is_class_b () const |
| (Deprecated: Use network_v4 class.) Determine whether the address is a class B address. More...
|
|
ASIO_DECL bool | is_class_c () const |
| (Deprecated: Use network_v4 class.) Determine whether the address is a class C address. More...
|
|
ASIO_DECL bool | is_multicast () const ASIO_NOEXCEPT |
| Determine whether the address is a multicast address.
|
|
|
(Note that these are not member functions.)
|
address_v4 | make_address_v4 (const address_v4::bytes_type &bytes) |
| Create an IPv4 address from raw bytes in network order.
|
|
address_v4 | make_address_v4 (address_v4::uint_type addr) |
| Create an IPv4 address from an unsigned integer in host byte order.
|
|
ASIO_DECL address_v4 | make_address_v4 (const char *str) |
| Create an IPv4 address from an IP address string in dotted decimal form.
|
|
ASIO_DECL address_v4 | make_address_v4 (const char *str, asio::error_code &ec) ASIO_NOEXCEPT |
| Create an IPv4 address from an IP address string in dotted decimal form.
|
|
ASIO_DECL address_v4 | make_address_v4 (const std::string &str) |
| Create an IPv4 address from an IP address string in dotted decimal form.
|
|
ASIO_DECL address_v4 | make_address_v4 (const std::string &str, asio::error_code &ec) ASIO_NOEXCEPT |
| Create an IPv4 address from an IP address string in dotted decimal form.
|
|
template<typename Elem , typename Traits > |
std::basic_ostream< Elem, Traits > & | operator<< (std::basic_ostream< Elem, Traits > &os, const address_v4 &addr) |
| Output an address as a string. More...
|
|
ASIO_DECL address_v4 | make_address_v4 (v4_mapped_t, const address_v6 &v6_addr) |
| Create an IPv4 address from a IPv4-mapped IPv6 address.
|
|
network_v4 | make_network_v4 (const address_v4 &addr, unsigned short prefix_len) |
| Create an IPv4 network from an address and prefix length.
|
|
network_v4 | make_network_v4 (const address_v4 &addr, const address_v4 &mask) |
| Create an IPv4 network from an address and netmask.
|
|
template<typename Elem , typename Traits > |
std::basic_ostream< Elem, Traits > & | operator<< (std::basic_ostream< Elem, Traits > &os, const network_v4 &net) |
| Output a network as a string. More...
|
|
Implements IP version 4 style addresses.
The asio::ip::address_v4 class provides the ability to use and manipulate IP version 4 addresses.
- Thread Safety
- Distinct objects: Safe.
Shared objects: Unsafe.
◆ bytes_type
The type used to represent an address as an array of bytes.
- Note
- This type is defined in terms of the C++0x template
std::array
when it is available. Otherwise, it uses boost:array
.
◆ broadcast()
(Deprecated: Use network_v4 class.) Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask.
◆ from_string() [1/4]
address_v4 asio::ip::address_v4::from_string |
( |
const char * |
str | ) |
|
|
inlinestatic |
(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form.
◆ from_string() [2/4]
(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form.
◆ from_string() [3/4]
address_v4 asio::ip::address_v4::from_string |
( |
const std::string & |
str | ) |
|
|
inlinestatic |
(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form.
◆ from_string() [4/4]
(Deprecated: Use make_address_v4().) Create an address from an IP address string in dotted decimal form.
◆ is_class_a()
bool asio::ip::address_v4::is_class_a |
( |
| ) |
const |
(Deprecated: Use network_v4 class.) Determine whether the address is a class A address.
◆ is_class_b()
bool asio::ip::address_v4::is_class_b |
( |
| ) |
const |
(Deprecated: Use network_v4 class.) Determine whether the address is a class B address.
◆ is_class_c()
bool asio::ip::address_v4::is_class_c |
( |
| ) |
const |
(Deprecated: Use network_v4 class.) Determine whether the address is a class C address.
◆ netmask()
(Deprecated: Use network_v4 class.) Obtain the netmask that corresponds to the address, based on its address class.
◆ to_string()
(Deprecated: Use other overload.) Get the address as a string in dotted decimal format.
◆ operator<<() [1/2]
template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & operator<< |
( |
std::basic_ostream< Elem, Traits > & |
os, |
|
|
const network_v4 & |
net |
|
) |
| |
|
related |
Output a network as a string.
Used to output a human-readable string for a specified network.
- Parameters
-
os | The output stream to which the string will be written. |
net | The network to be written. |
- Returns
- The output stream.
◆ operator<<() [2/2]
template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & operator<< |
( |
std::basic_ostream< Elem, Traits > & |
os, |
|
|
const address_v4 & |
addr |
|
) |
| |
|
related |
Output an address as a string.
Used to output a human-readable string for a specified address.
- Parameters
-
os | The output stream to which the string will be written. |
addr | The address to be written. |
- Returns
- The output stream.
The documentation for this class was generated from the following files: