11 #ifndef ASIO_IP_ADDRESS_HPP 12 #define ASIO_IP_ADDRESS_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 20 #include "asio/detail/throw_exception.hpp" 21 #include "asio/detail/string_view.hpp" 22 #include "asio/detail/type_traits.hpp" 23 #include "asio/error_code.hpp" 24 #include "asio/ip/address_v4.hpp" 25 #include "asio/ip/address_v6.hpp" 26 #include "asio/ip/bad_address_cast.hpp" 28 #if !defined(ASIO_NO_IOSTREAM) 30 #endif // !defined(ASIO_NO_IOSTREAM) 32 #include "asio/detail/push_options.hpp" 50 ASIO_DECL
address() ASIO_NOEXCEPT;
63 #if defined(ASIO_HAS_MOVE) 66 #endif // defined(ASIO_HAS_MOVE) 71 #if defined(ASIO_HAS_MOVE) 74 #endif // defined(ASIO_HAS_MOVE) 85 bool is_v4() const ASIO_NOEXCEPT
91 bool is_v6() const ASIO_NOEXCEPT
105 #if !defined(ASIO_NO_DEPRECATED) 129 #endif // !defined(ASIO_NO_DEPRECATED) 142 const address& a2) ASIO_NOEXCEPT;
146 const address& a2) ASIO_NOEXCEPT
153 const address& a2) ASIO_NOEXCEPT;
157 const address& a2) ASIO_NOEXCEPT
164 const address& a2) ASIO_NOEXCEPT
171 const address& a2) ASIO_NOEXCEPT
178 enum { ipv4, ipv6 } type_;
217 #if defined(ASIO_HAS_STRING_VIEW) \ 218 || defined(GENERATING_DOCUMENTATION) 235 #endif // defined(ASIO_HAS_STRING_VIEW) 238 #if !defined(ASIO_NO_IOSTREAM) 252 template <
typename Elem,
typename Traits>
254 std::basic_ostream<Elem, Traits>& os,
const address& addr);
256 #endif // !defined(ASIO_NO_IOSTREAM) 261 #include "asio/detail/pop_options.hpp" 263 #include "asio/ip/impl/address.hpp" 264 #if defined(ASIO_HEADER_ONLY) 265 # include "asio/ip/impl/address.ipp" 266 #endif // defined(ASIO_HEADER_ONLY) 268 #endif // ASIO_IP_ADDRESS_HPP ASIO_DECL std::string to_string() const
Get the address as a string.
Definition: address.ipp:177
ASIO_DECL bool is_unspecified() const ASIO_NOEXCEPT
Determine whether the address is unspecified.
Definition: address.ipp:200
friend bool operator>(const address &a1, const address &a2) ASIO_NOEXCEPT
Compare addresses for ordering.
Definition: address.hpp:156
bool is_v4() const ASIO_NOEXCEPT
Get whether the address is an IP version 4 address.
Definition: address.hpp:85
std::basic_ostream< Elem, Traits > & operator<<(std::basic_ostream< Elem, Traits > &os, const address &addr)
Output an address as a string.
Definition: address.hpp:54
ASIO_DECL asio::ip::address_v6 to_v6() const
Get the address as an IP version 6 address.
Definition: address.ipp:167
Implements IP version 4 style addresses.
Definition: address_v4.hpp:45
static address from_string(const char *str)
(Deprecated: Use make_address().) Create an address from an IPv4 address string in dotted decimal for...
Definition: address.hpp:29
ASIO_DECL bool is_multicast() const ASIO_NOEXCEPT
Determine whether the address is a multicast address.
Definition: address.ipp:207
ASIO_DECL address & operator=(const address &other) ASIO_NOEXCEPT
Assign from another address.
Definition: address.ipp:71
friend bool operator!=(const address &a1, const address &a2) ASIO_NOEXCEPT
Compare two addresses for inequality.
Definition: address.hpp:145
ASIO_DECL address() ASIO_NOEXCEPT
Default constructor.
Definition: address.ipp:32
Implements version-independent IP addresses.
Definition: address.hpp:46
friend bool operator>=(const address &a1, const address &a2) ASIO_NOEXCEPT
Compare addresses for ordering.
Definition: address.hpp:170
Class to represent an error code value.
Definition: error_code.hpp:80
Implements IP version 6 style addresses.
Definition: address_v6.hpp:47
ASIO_DECL friend bool operator<(const address &a1, const address &a2) ASIO_NOEXCEPT
Compare addresses for ordering.
Definition: address.ipp:223
ASIO_DECL address make_address(const char *str)
Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexa...
Definition: address.ipp:107
ASIO_DECL asio::ip::address_v4 to_v4() const
Get the address as an IP version 4 address.
Definition: address.ipp:157
ASIO_DECL bool is_loopback() const ASIO_NOEXCEPT
Determine whether the address is a loopback address.
Definition: address.ipp:193
bool is_v6() const ASIO_NOEXCEPT
Get whether the address is an IP version 6 address.
Definition: address.hpp:91
ASIO_DECL friend bool operator==(const address &a1, const address &a2) ASIO_NOEXCEPT
Compare two addresses for equality.
Definition: address.ipp:214
Definition: any_io_executor.hpp:28
friend bool operator<=(const address &a1, const address &a2) ASIO_NOEXCEPT
Compare addresses for ordering.
Definition: address.hpp:163