Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:34:42

0001 //
0002 // Copyright (c) 2023 Dmitry Arkhipov (grisumbras@yandex.ru)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/json
0008 //
0009 
0010 #ifndef BOOST_JSON_DETAIL_WRITER_HPP
0011 #define BOOST_JSON_DETAIL_WRITER_HPP
0012 
0013 #include <boost/json/detail/literals.hpp>
0014 #include <boost/json/detail/stack.hpp>
0015 #include <boost/json/detail/stream.hpp>
0016 #include <boost/json/conversion.hpp>
0017 #include <boost/json/serialize_options.hpp>
0018 #include <boost/json/value.hpp>
0019 
0020 namespace boost {
0021 namespace json {
0022 namespace detail {
0023 
0024 struct writer
0025 {
0026     enum class state : char;
0027 
0028     stack st_;
0029     serialize_options opts_;
0030     const_stream cs0_;
0031     void const* p_ = nullptr;
0032     char buf_[detail::max_number_chars + 1];
0033 
0034     writer(
0035         storage_ptr sp,
0036         unsigned char* buf,
0037         std::size_t buf_size,
0038         serialize_options const& opts) noexcept;
0039 
0040     inline
0041     bool
0042     suspend(state st);
0043 
0044     template<class U, class T>
0045     bool
0046     suspend(state st, U u, T const* po);
0047 };
0048 
0049 bool
0050 BOOST_JSON_DECL
0051 write_true(writer& w, stream& ss);
0052 
0053 bool
0054 BOOST_JSON_DECL
0055 write_false(writer& w, stream& ss);
0056 
0057 bool
0058 BOOST_JSON_DECL
0059 write_null(writer& w, stream& ss);
0060 
0061 bool
0062 BOOST_JSON_DECL
0063 write_int64(writer&, stream& ss, std::int64_t i);
0064 
0065 bool
0066 BOOST_JSON_DECL
0067 write_uint64(writer&, stream& ss, std::uint64_t i);
0068 
0069 bool
0070 BOOST_JSON_DECL
0071 write_double(writer&, stream& ss, double d);
0072 
0073 bool
0074 BOOST_JSON_DECL
0075 resume_buffer(writer&, stream& ss);
0076 
0077 bool
0078 BOOST_JSON_DECL
0079 write_string(writer& w, stream& ss);
0080 
0081 bool
0082 BOOST_JSON_DECL
0083 resume_string(writer& w, stream& ss);
0084 
0085 } // namespace detail
0086 } // namespace json
0087 } // namespace boost
0088 
0089 #endif // BOOST_JSON_DETAIL_WRITER_HPP