File indexing completed on 2025-09-17 08:34:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_JSON_IMPL_SERIALIZE_HPP
0011 #define BOOST_JSON_IMPL_SERIALIZE_HPP
0012
0013 #include <boost/json/serializer.hpp>
0014
0015 namespace boost {
0016 namespace json {
0017 namespace detail {
0018
0019 BOOST_JSON_DECL
0020 void
0021 serialize_impl(std::string& s, serializer& sr);
0022
0023 }
0024
0025 template<class T>
0026 std::string
0027 serialize(T const& t, serialize_options const& opts)
0028 {
0029 unsigned char buf[256];
0030 serializer sr(
0031 storage_ptr(),
0032 buf,
0033 sizeof(buf),
0034 opts);
0035 std::string s;
0036 sr.reset(&t);
0037 detail::serialize_impl(s, sr);
0038 return s;
0039 }
0040
0041 }
0042 }
0043
0044 #endif