File indexing completed on 2025-09-15 08:30:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_HTTP_EMPTY_BODY_HPP
0011 #define BOOST_BEAST_HTTP_EMPTY_BODY_HPP
0012
0013 #include <boost/beast/http/empty_body_fwd.hpp>
0014
0015 #include <boost/beast/core/detail/config.hpp>
0016 #include <boost/beast/http/error.hpp>
0017 #include <boost/beast/http/message.hpp>
0018 #include <boost/optional.hpp>
0019
0020 #include <cstdint>
0021
0022 namespace boost {
0023 namespace beast {
0024 namespace http {
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 struct empty_body
0036 {
0037
0038
0039
0040
0041
0042 struct value_type
0043 {
0044 };
0045
0046
0047
0048
0049
0050
0051
0052 static
0053 std::uint64_t
0054 size(value_type)
0055 {
0056 return 0;
0057 }
0058
0059
0060
0061
0062
0063 #if BOOST_BEAST_DOXYGEN
0064 using reader = __implementation_defined__;
0065 #else
0066 struct reader
0067 {
0068 template<bool isRequest, class Fields>
0069 explicit
0070 reader(header<isRequest, Fields>&, value_type&)
0071 {
0072 }
0073
0074 void
0075 init(boost::optional<std::uint64_t> const&, error_code& ec)
0076 {
0077 ec = {};
0078 }
0079
0080 template<class ConstBufferSequence>
0081 std::size_t
0082 put(ConstBufferSequence const&,
0083 error_code& ec)
0084 {
0085 BOOST_BEAST_ASSIGN_EC(ec, error::unexpected_body);
0086 return 0;
0087 }
0088
0089 void
0090 finish(error_code& ec)
0091 {
0092 ec = {};
0093 }
0094 };
0095 #endif
0096
0097
0098
0099
0100
0101 #if BOOST_BEAST_DOXYGEN
0102 using writer = __implementation_defined__;
0103 #else
0104 struct writer
0105 {
0106 using const_buffers_type =
0107 net::const_buffer;
0108
0109 template<bool isRequest, class Fields>
0110 explicit
0111 writer(header<isRequest, Fields> const&, value_type const&)
0112 {
0113 }
0114
0115 void
0116 init(error_code& ec)
0117 {
0118 ec = {};
0119 }
0120
0121 boost::optional<std::pair<const_buffers_type, bool>>
0122 get(error_code& ec)
0123 {
0124 ec = {};
0125 return boost::none;
0126 }
0127 };
0128 #endif
0129 };
0130
0131 }
0132 }
0133 }
0134
0135 #endif