| 840 | } |
| 841 | |
| 842 | clock_type::duration |
| 843 | serialize_string(file_item const& fi, std::size_t repeat) const override |
| 844 | { |
| 845 | using namespace rapidjson; |
| 846 | Allocator alloc; |
| 847 | GenericDocument<UTF8<>, Allocator> d(&alloc); |
| 848 | d.template Parse<rapidjson_impl::parse_flags>( fi.text.data(), fi.text.size() ); |
| 849 | |
| 850 | auto const start = clock_type::now(); |
| 851 | rapidjson::StringBuffer st; |
| 852 | while(repeat--) |
| 853 | { |
| 854 | st.Clear(); |
| 855 | rapidjson::Writer<rapidjson::StringBuffer> wr(st); |
| 856 | d.Accept(wr); |
| 857 | } |
| 858 | return clock_type::now() - start; |
| 859 | } |
| 860 | }; |
| 861 | #endif // BOOST_JSON_HAS_RAPIDJSON |
| 862 | |