2 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/json
10 #ifndef BOOST_JSON_IMPL_STREAM_PARSER_IPP
11 #define BOOST_JSON_IMPL_STREAM_PARSER_IPP
13 #include <boost/json/stream_parser.hpp>
14 #include <boost/json/basic_parser_impl.hpp>
15 #include <boost/json/error.hpp>
25 parse_options const& opt,
26 unsigned char* buffer,
27 std::size_t size) noexcept
40 parse_options const& opt) noexcept
52 reset(storage_ptr sp) noexcept
55 p_.handler().st.reset(sp);
66 true, data, size, ec);
76 auto const n = write_some(
79 detail::throw_system_error(ec,
80 BOOST_CURRENT_LOCATION);
91 auto const n = write_some(
95 ec = error::extra_data;
108 auto const n = write(
111 detail::throw_system_error(ec,
112 BOOST_CURRENT_LOCATION);
118 finish(error_code& ec)
120 p_.write_some(false, nullptr, 0, ec);
130 detail::throw_system_error(ec,
131 BOOST_CURRENT_LOCATION);
140 // prevent undefined behavior
143 return p_.handler().st.release();