123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #ifndef BOOST_BEAST_HTTP_EMPTY_BODY_HPP
- #define BOOST_BEAST_HTTP_EMPTY_BODY_HPP
- #include <boost/beast/core/detail/config.hpp>
- #include <boost/beast/http/error.hpp>
- #include <boost/beast/http/message.hpp>
- #include <boost/optional.hpp>
- namespace boost {
- namespace beast {
- namespace http {
- struct empty_body
- {
-
- struct value_type
- {
- };
-
- static
- std::uint64_t
- size(value_type)
- {
- return 0;
- }
-
- #if BOOST_BEAST_DOXYGEN
- using reader = __implementation_defined__;
- #else
- struct reader
- {
- template<bool isRequest, class Fields>
- explicit
- reader(header<isRequest, Fields>&, value_type&)
- {
- }
- void
- init(boost::optional<std::uint64_t> const&, error_code& ec)
- {
- ec = {};
- }
- template<class ConstBufferSequence>
- std::size_t
- put(ConstBufferSequence const&,
- error_code& ec)
- {
- ec = error::unexpected_body;
- return 0;
- }
- void
- finish(error_code& ec)
- {
- ec = {};
- }
- };
- #endif
-
- #if BOOST_BEAST_DOXYGEN
- using writer = __implementation_defined__;
- #else
- struct writer
- {
- using const_buffers_type =
- net::const_buffer;
- template<bool isRequest, class Fields>
- explicit
- writer(header<isRequest, Fields> const&, value_type const&)
- {
- }
- void
- init(error_code& ec)
- {
- ec = {};
- }
- boost::optional<std::pair<const_buffers_type, bool>>
- get(error_code& ec)
- {
- ec = {};
- return boost::none;
- }
- };
- #endif
- };
- }
- }
- }
- #endif
|