Encode the JSON representation of value to jsonStream, logging errors to logStream.
Declared in <baljsn_encodeimplutil.h>
template<class TYPE>
static
int
encode(
std::ostream* logStream,
std::ostream* jsonStream,
TYPE const& value,
EncoderOptions const& options = EncoderOptions());
Encode the JSON representation of the specified value to the specified jsonStream. If this operation is not successful, load an unspecified, human-readable description of the error condition to the specified logStream. Optionally specify options to configure aspects of the JSON representation of the value. If options is not specified, the default EncoderOptions value is used. Return 0 on success, and a non-zero value otherwise. The behavior is undefined unless the specified TYPE satisfies both the static and dynamic requirements of one bdlat type-category concept. See baljsn_encoderoptions for a description of the effects, if any, of each option in the options on the JSON representation of the value. See the package-level documentation of bdlat for an introduction to the requirements of bdlat type-category concepts.
0 on success, and a non-zero value otherwise
| Name | Description |
|---|---|
| logStream | stream for human-readable error descriptions |
| jsonStream | stream that receives the JSON representation |
| value | value to encode |
| options | encoding options |