Zserio C++ runtime library  1.1.0
Built for Zserio 2.15.0
zserio::JsonEncoder Class Reference

#include <JsonEncoder.h>

Static Public Member Functions

static void encodeNull (std::ostream &stream)
 
static void encodeBool (std::ostream &stream, bool value)
 
template<typename T >
static void encodeIntegral (std::ostream &stream, T value)
 
static void encodeFloatingPoint (std::ostream &stream, double value)
 
static void encodeString (std::ostream &stream, StringView value)
 

Detailed Description

Converts zserio values to Json string representation.

Definition at line 18 of file JsonEncoder.h.

Member Function Documentation

◆ encodeBool()

void zserio::JsonEncoder::encodeBool ( std::ostream &  stream,
bool  value 
)
static

Encodes JSON boolean value to the given stream.

Parameters
streamStream to use.
valueValue to encode.

Definition at line 16 of file JsonEncoder.cpp.

◆ encodeFloatingPoint()

void zserio::JsonEncoder::encodeFloatingPoint ( std::ostream &  stream,
double  value 
)
static

Encodes JSON floating-point value to the given stream.

Parameters
streamStream to use.
valueValue to encode.

Definition at line 21 of file JsonEncoder.cpp.

◆ encodeIntegral()

template<typename T >
void zserio::JsonEncoder::encodeIntegral ( std::ostream &  stream,
value 
)
static

Encodes JSON integral value to the given stream.

Parameters
streamStream to use.
valueValue to encode.

Definition at line 65 of file JsonEncoder.h.

◆ encodeNull()

void zserio::JsonEncoder::encodeNull ( std::ostream &  stream)
static

Encodes JSON null value to the given stream.

Parameters
streamStream to use.

Definition at line 11 of file JsonEncoder.cpp.

◆ encodeString()

void zserio::JsonEncoder::encodeString ( std::ostream &  stream,
StringView  value 
)
static

Encodes JSON string value to the given stream.

Note that this method performs escaping necessary to get a proper JSON string.

Parameters
streamStream to use.
valueValue to encode.

Definition at line 51 of file JsonEncoder.cpp.


The documentation for this class was generated from the following files: