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);
Same as the preceding overload, accepting a nullable options pointer.
int
encodeAny(
std::ostream& stream,
bdlar::AnyConstRef const& any,
EncoderOptions const* options = 0);
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);
Same as the preceding overload, accepting a nullable options pointer.
int
encodeAny(
std::streambuf* streamBuf,
bdlar::AnyConstRef const& any,
EncoderOptions const* options = 0);
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);
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);
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);
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);
Return Value
0 on success, and a non‐zero value otherwise
Parameters
Name |
Description |
stream |
output stream for JSON |
any |
type‐erased value to encode |
options |
encoding options |
streamBuf |
output buffer for JSON |
value |
value to encode |
Created with MrDocs