File indexing completed on 2025-01-18 09:28:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_ASIO_IP_IMPL_NETWORK_V4_HPP
0013 #define BOOST_ASIO_IP_IMPL_NETWORK_V4_HPP
0014
0015 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0016 # pragma once
0017 #endif
0018
0019 #if !defined(BOOST_ASIO_NO_IOSTREAM)
0020
0021 #include <boost/asio/detail/throw_error.hpp>
0022
0023 #include <boost/asio/detail/push_options.hpp>
0024
0025 namespace boost {
0026 namespace asio {
0027 namespace ip {
0028
0029 template <typename Elem, typename Traits>
0030 std::basic_ostream<Elem, Traits>& operator<<(
0031 std::basic_ostream<Elem, Traits>& os, const network_v4& addr)
0032 {
0033 boost::system::error_code ec;
0034 std::string s = addr.to_string(ec);
0035 if (ec)
0036 {
0037 if (os.exceptions() & std::basic_ostream<Elem, Traits>::failbit)
0038 boost::asio::detail::throw_error(ec);
0039 else
0040 os.setstate(std::basic_ostream<Elem, Traits>::failbit);
0041 }
0042 else
0043 for (std::string::iterator i = s.begin(); i != s.end(); ++i)
0044 os << os.widen(*i);
0045 return os;
0046 }
0047
0048 }
0049 }
0050 }
0051
0052 #include <boost/asio/detail/pop_options.hpp>
0053
0054 #endif
0055
0056 #endif