19 virtual void write_character(CharType c) = 0;
20 virtual void write_characters(
const CharType* s, std::size_t length) = 0;
25 template<
typename CharType>
29 template<
typename CharType>
35 void write_character(CharType c)
override 40 void write_characters(
const CharType* s, std::size_t length)
override 42 std::copy(s, s + length, std::back_inserter(v));
46 std::vector<CharType>& v;
50 template<
typename CharType>
56 void write_character(CharType c)
override 61 void write_characters(
const CharType* s, std::size_t length)
override 63 stream.write(s, static_cast<std::streamsize>(length));
67 std::basic_ostream<CharType>& stream;
71 template<
typename CharType>
77 void write_character(CharType c)
override 82 void write_characters(
const CharType* s, std::size_t length)
override 84 str.append(s, length);
88 std::basic_string<CharType>& str;
91 template<
typename CharType>
Definition: output_adapters.hpp:92
output adapter for byte vectors
Definition: output_adapters.hpp:30
abstract output adapter interface
Definition: output_adapters.hpp:17
namespace for Niels Lohmann
Definition: adl_serializer.hpp:8
output adapter for basic_string
Definition: output_adapters.hpp:72
std::shared_ptr< output_adapter_protocol< CharType > > output_adapter_t
a type to simplify interfaces
Definition: output_adapters.hpp:26
output adapter for output streams
Definition: output_adapters.hpp:51