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_PARSER_IPP
11 #define BOOST_JSON_IMPL_PARSER_IPP
13 #include <boost/json/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);
65 auto const n = p_.write_some(
66 false, data, size, ec);
67 BOOST_ASSERT(ec || p_.done());
78 auto const n = write_some(
81 detail::throw_system_error(ec,
82 BOOST_CURRENT_LOCATION);
93 auto const n = write_some(
97 ec = error::extra_data;
110 auto const n = write(
113 detail::throw_system_error(ec,
114 BOOST_CURRENT_LOCATION);
124 // prevent undefined behavior
125 if(! p_.last_error())
126 p_.fail(error::incomplete);
127 detail::throw_system_error(
129 BOOST_CURRENT_LOCATION);
131 return p_.handler().st.release();