LCOV - code coverage report
Current view: top level - json/impl - serialize.hpp (source / functions) Coverage Total Hit
Test: coverage_filtered.info Lines: 100.0 % 8 8
Test Date: 2025-12-23 17:20:51 Functions: 100.0 % 11 11

            Line data    Source code
       1              : //
       2              : // Copyright (c) 2023 Dmitry Arkhipov (grisumbras@yandex.ru)
       3              : //
       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)
       6              : //
       7              : // Official repository: https://github.com/boostorg/json
       8              : //
       9              : 
      10              : #ifndef BOOST_JSON_IMPL_SERIALIZE_HPP
      11              : #define BOOST_JSON_IMPL_SERIALIZE_HPP
      12              : 
      13              : #include <boost/json/serializer.hpp>
      14              : 
      15              : namespace boost {
      16              : namespace json {
      17              : namespace detail {
      18              : 
      19              : BOOST_JSON_DECL
      20              : void
      21              : serialize_impl(std::string& s, serializer& sr);
      22              : 
      23              : } // namespace detail
      24              : 
      25              : template<class T>
      26              : std::string
      27           40 : serialize(T const& t, serialize_options const& opts)
      28              : {
      29              :     unsigned char buf[256];
      30           40 :     serializer sr(
      31           80 :         storage_ptr(),
      32              :         buf,
      33              :         sizeof(buf),
      34              :         opts);
      35           40 :     std::string s;
      36           40 :     sr.reset(&t);
      37           40 :     detail::serialize_impl(s, sr);
      38           80 :     return s;
      39           40 : }
      40              : 
      41              : } // namespace json
      42              : } // namespace boost
      43              : 
      44              : #endif // BOOST_JSON_IMPL_SERIALIZE_HPP
        

Generated by: LCOV version 2.1