File indexing completed on 2025-01-18 09:29:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_HTTP_IMPL_PARSER_HPP
0011 #define BOOST_BEAST_HTTP_IMPL_PARSER_HPP
0012
0013 #include <boost/throw_exception.hpp>
0014 #include <stdexcept>
0015
0016 namespace boost {
0017 namespace beast {
0018 namespace http {
0019
0020 template<bool isRequest, class Body, class Allocator>
0021 parser<isRequest, Body, Allocator>::
0022 parser()
0023 : rd_(m_.base(), m_.body())
0024 {
0025 }
0026
0027 template<bool isRequest, class Body, class Allocator>
0028 template<class Arg1, class... ArgN, class>
0029 parser<isRequest, Body, Allocator>::
0030 parser(Arg1&& arg1, ArgN&&... argn)
0031 : m_(
0032 std::forward<Arg1>(arg1),
0033 std::forward<ArgN>(argn)...)
0034 , rd_(m_.base(), m_.body())
0035 {
0036 m_.clear();
0037 }
0038
0039 template<bool isRequest, class Body, class Allocator>
0040 template<class OtherBody, class... Args, class>
0041 parser<isRequest, Body, Allocator>::
0042 parser(
0043 parser<isRequest, OtherBody, Allocator>&& other,
0044 Args&&... args)
0045 : basic_parser<isRequest>(std::move(other))
0046 , m_(other.release(), std::forward<Args>(args)...)
0047 , rd_(m_.base(), m_.body())
0048 {
0049 if(other.rd_inited_)
0050 BOOST_THROW_EXCEPTION(std::invalid_argument{
0051 "moved-from parser has a body"});
0052 }
0053
0054 }
0055 }
0056 }
0057
0058 #endif