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