#include <src/vt/utils/json/output_adaptor.h>
template<typename StreamLike, typename CharType = char>
OutputAdaptor struct
A custom output adaptor for optionally compressing the data before outputting to a stream.
Constructors, destructors, conversion operators
- OutputAdaptor(StreamLike& in_os, bool compress)
- Construct with a stream.
- ~OutputAdaptor() virtual
- Finalize output, flush, and finish compression if need be.
Public functions
- void write_character(CharType c) override
- Write a single character to the output.
- void write_characters(CharType const* s, std::size_t length) override
- Write an array of characters to the output.
Function documentation
template<typename StreamLike, typename CharType>
vt:: util:: json:: OutputAdaptor<StreamLike, CharType>:: OutputAdaptor(StreamLike& in_os,
bool compress)
Construct with a stream.
Parameters | |
---|---|
in_os in | the stream |
compress in | whether to compress the output |
template<typename StreamLike, typename CharType>
void vt:: util:: json:: OutputAdaptor<StreamLike, CharType>:: write_character(CharType c) override
Write a single character to the output.
Parameters | |
---|---|
c in | the character |
template<typename StreamLike, typename CharType>
void vt:: util:: json:: OutputAdaptor<StreamLike, CharType>:: write_characters(CharType const* s,
std::size_t length) override
Write an array of characters to the output.
Parameters | |
---|---|
s in | the array |
length in | length of the array |