Encode value as JSON onto streamBuf using options.
Declared in <baljsn_encoder.h>
template<class TYPE>
int
encode(
std::streambuf* streamBuf,
TYPE const& value,
EncoderOptions const& options);
Encode the specified value, of (template parameter) TYPE, in the JSON format using the specified options and output it onto the specified streamBuf. Specifying a nullptr options is equivalent to passing a default-constructed EncoderOptions in options. TYPE shall be a bdlat-compatible sequence, choice, or array type, or a bdlat-compatible dynamic type referring to one of those types. Return 0 on success, and a non-zero value otherwise.
0 on success, and a non-zero value otherwise
| Name | Description |
|---|---|
| streamBuf | output buffer for JSON |
| value | value to encode |
| options | encoding options |