Implements IP version 4 style addresses.
More...
#include <address_v4.hpp>
|
typedef
boost::asio::detail::array
< unsigned char, 4 > | bytes_type |
| The type used to represent an address as an array of bytes. More...
|
|
|
(Note that these are not member functions.)
|
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...
|
|
Implements IP version 4 style addresses.
The boost::asio::ip::address_v4 class provides the ability to use and manipulate IP version 4 addresses.
- Thread Safety
- Distinct objects: Safe.
Shared objects: Unsafe.
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
.
boost::asio::ip::address_v4::address_v4 |
( |
| ) |
|
|
inline |
BOOST_ASIO_DECL boost::asio::ip::address_v4::address_v4 |
( |
const bytes_type & |
bytes | ) |
|
|
explicit |
Construct an address from raw bytes.
BOOST_ASIO_DECL boost::asio::ip::address_v4::address_v4 |
( |
unsigned long |
addr | ) |
|
|
explicit |
Construct an address from a unsigned long in host byte order.
boost::asio::ip::address_v4::address_v4 |
( |
const address_v4 & |
other | ) |
|
|
inline |
static address_v4 boost::asio::ip::address_v4::any |
( |
| ) |
|
|
inlinestatic |
Obtain an address object that represents any address.
References address_v4().
static address_v4 boost::asio::ip::address_v4::broadcast |
( |
| ) |
|
|
inlinestatic |
Obtain an address object that represents the broadcast address.
References address_v4().
Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask.
static BOOST_ASIO_DECL address_v4 boost::asio::ip::address_v4::from_string |
( |
const char * |
str | ) |
|
|
static |
Create an address from an IP address string in dotted decimal form.
Create an address from an IP address string in dotted decimal form.
static BOOST_ASIO_DECL address_v4 boost::asio::ip::address_v4::from_string |
( |
const std::string & |
str | ) |
|
|
static |
Create an address from an IP address string in dotted decimal form.
Create an address from an IP address string in dotted decimal form.
BOOST_ASIO_DECL bool boost::asio::ip::address_v4::is_class_a |
( |
| ) |
const |
Determine whether the address is a class A address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v4::is_class_b |
( |
| ) |
const |
Determine whether the address is a class B address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v4::is_class_c |
( |
| ) |
const |
Determine whether the address is a class C address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v4::is_loopback |
( |
| ) |
const |
Determine whether the address is a loopback address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v4::is_multicast |
( |
| ) |
const |
Determine whether the address is a multicast address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v4::is_unspecified |
( |
| ) |
const |
Determine whether the address is unspecified.
static address_v4 boost::asio::ip::address_v4::loopback |
( |
| ) |
|
|
inlinestatic |
Obtain an address object that represents the loopback address.
References address_v4().
Obtain the netmask that corresponds to the address, based on its address class.
Assign from another address.
BOOST_ASIO_DECL bytes_type boost::asio::ip::address_v4::to_bytes |
( |
| ) |
const |
Get the address in bytes, in network byte order.
BOOST_ASIO_DECL std::string boost::asio::ip::address_v4::to_string |
( |
| ) |
const |
Get the address as a string in dotted decimal format.
Get the address as a string in dotted decimal format.
BOOST_ASIO_DECL unsigned long boost::asio::ip::address_v4::to_ulong |
( |
| ) |
const |
Get the address as an unsigned long in host byte order.
Compare two addresses for inequality.
Compare addresses for ordering.
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.
Compare addresses for ordering.
Compare two addresses for equality.
Compare addresses for ordering.
Compare addresses for ordering.
The documentation for this class was generated from the following file: