[#BloombergLP-baljsn-EncodeImplUtil-encode-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/EncodeImplUtil.adoc[EncodeImplUtil]::encode :relfileprefix: ../../../ :mrdocs: `encode` overloads == Synopses Declared in `<baljsn_encodeimplutil.h>` Encode the JSON representation of `value` to `jsonStream`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> static int xref:BloombergLP/baljsn/EncodeImplUtil/encode-0e.adoc[encode]( std::ostream* jsonStream, TYPE const& value, xref:BloombergLP/baljsn/EncoderOptions.adoc[EncoderOptions] const& options = EncoderOptions()); ---- [.small]#xref:BloombergLP/baljsn/EncodeImplUtil/encode-0e.adoc[_» more..._]# Encode the JSON representation of `value` to `jsonStream`, logging errors to `logStream`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> static int xref:BloombergLP/baljsn/EncodeImplUtil/encode-0b1.adoc[encode]( std::ostream* logStream, std::ostream* jsonStream, TYPE const& value, xref:BloombergLP/baljsn/EncoderOptions.adoc[EncoderOptions] const& options = EncoderOptions()); ---- [.small]#xref:BloombergLP/baljsn/EncodeImplUtil/encode-0b1.adoc[_» more..._]# Encode the JSON representation of `value` to `formatter`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> static int xref:BloombergLP/baljsn/EncodeImplUtil/encode-0be.adoc[encode]( bool* isValueEmpty, FORMATTER* formatter, std::ostream* logStream, TYPE const& value, xref:BloombergLP/baljsn/EncodeImplUtil/FormattingMode.adoc[FormattingMode] formattingMode, xref:BloombergLP/baljsn/EncoderOptions.adoc[EncoderOptions] const& options, bool isFirstMember); ---- [.small]#xref:BloombergLP/baljsn/EncodeImplUtil/encode-0be.adoc[_» more..._]# == Return Value 0 on success, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *jsonStream* | stream that receives the JSON representation | *value* | value to encode | *options* | encoding options | *logStream* | stream for human‐readable error descriptions | *isValueEmpty* | receives whether the representation is empty | *formatter* | JSON formatter that receives the encoded tokens | *formattingMode* | formatting‐mode bit‐field for the value | *isFirstMember* | if `true`, omit a leading sequence delimiter |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#