File indexing completed on 2025-01-18 09:29:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_WRITE_OSTREAM_HPP
0011 #define BOOST_BEAST_WRITE_OSTREAM_HPP
0012
0013 #include <boost/beast/core/detail/config.hpp>
0014 #include <boost/beast/core/detail/ostream.hpp>
0015 #include <type_traits>
0016 #include <streambuf>
0017 #include <utility>
0018
0019 #ifdef BOOST_BEAST_ALLOW_DEPRECATED
0020 #include <boost/beast/core/make_printable.hpp>
0021 #endif
0022
0023 namespace boost {
0024 namespace beast {
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 template<class DynamicBuffer>
0051 #if BOOST_BEAST_DOXYGEN
0052 __implementation_defined__
0053 #else
0054 detail::ostream_helper<
0055 DynamicBuffer, char, std::char_traits<char>,
0056 detail::basic_streambuf_movable::value>
0057 #endif
0058 ostream(DynamicBuffer& buffer)
0059 {
0060 static_assert(
0061 net::is_dynamic_buffer<DynamicBuffer>::value,
0062 "DynamicBuffer type requirements not met");
0063 return detail::ostream_helper<
0064 DynamicBuffer, char, std::char_traits<char>,
0065 detail::basic_streambuf_movable::value>{buffer};
0066 }
0067
0068
0069
0070 #ifdef BOOST_BEAST_ALLOW_DEPRECATED
0071 template<class T>
0072 detail::make_printable_adaptor<T>
0073 buffers(T const& t)
0074 {
0075 return make_printable(t);
0076 }
0077 #else
0078 template<class T>
0079 void buffers(T const&)
0080 {
0081 static_assert(sizeof(T) == 0,
0082 "The function buffers() is deprecated, use make_printable() instead, "
0083 "or define BOOST_BEAST_ALLOW_DEPRECATED to silence this error.");
0084 }
0085 #endif
0086
0087 }
0088 }
0089
0090 #endif