BloombergLP::baljsn::Encoder::encodeAny

encodeAny overloads

Synopses

Declared in <baljsn_encoder.h>

Encode the specified any without instantiating templates at compile time. Return 0 on success, and a non-zero value otherwise.

int
encodeAny(
    std::ostream& stream,
    bdlar::AnyConstRef const& any,
    EncoderOptions const& options);
» more...

Same as the preceding overload, accepting a nullable options pointer.

int
encodeAny(
    std::ostream& stream,
    bdlar::AnyConstRef const& any,
    EncoderOptions const* options = 0);
» more...

Encode the specified any without instantiating templates at compile time. Return 0 on success, and a non-zero value otherwise.

int
encodeAny(
    std::streambuf* streamBuf,
    bdlar::AnyConstRef const& any,
    EncoderOptions const& options);
» more...

Same as the preceding overload, accepting a nullable options pointer.

int
encodeAny(
    std::streambuf* streamBuf,
    bdlar::AnyConstRef const& any,
    EncoderOptions const* options = 0);
» more...

Encode value as JSON onto stream using options without instantiating templates at compile time.

template<class TYPE>
int
encodeAny(
    std::ostream& stream,
    TYPE const& value,
    EncoderOptions const& options);
» more...

Same as the preceding overload, accepting a nullable options pointer.

template<class TYPE>
int
encodeAny(
    std::ostream& stream,
    TYPE const& value,
    EncoderOptions const* options = 0);
» more...

Encode value as JSON onto streamBuf using options without instantiating templates at compile time.

template<class TYPE>
int
encodeAny(
    std::streambuf* streamBuf,
    TYPE const& value,
    EncoderOptions const& options);
» more...

Same as the preceding overload, accepting a nullable options pointer.

template<class TYPE>
int
encodeAny(
    std::streambuf* streamBuf,
    TYPE const& value,
    EncoderOptions const* options = 0);
» more...

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
streamoutput stream for JSON
anytype-erased value to encode
optionsencoding options
streamBufoutput buffer for JSON
valuevalue to encode