[#BloombergLP-baljsn-Decoder-decode-04] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/Decoder.adoc[Decoder]::decode :relfileprefix: ../../../ :mrdocs: `decode` overloads == Synopses Declared in `<baljsn_decoder.h>` Decode an object of (template parameter) `TYPE` from the specified `stream` and load the result into the specified modifiable `value`. Return 0 on success, and a non‐zero value otherwise. Note that `stream` will be invalidated if the decoding fails. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int xref:BloombergLP/baljsn/Decoder/decode-02.adoc[decode]( std::istream& stream, TYPE* value); ---- [.small]#xref:BloombergLP/baljsn/Decoder/decode-02.adoc[_» more..._]# Decode an object of (template parameter) `TYPE` from the specified `streamBuf` and load the result into the specified modifiable `value`. Return 0 on success, and a non‐zero value otherwise. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int xref:BloombergLP/baljsn/Decoder/decode-0d.adoc[decode]( std::streambuf* streamBuf, TYPE* value); ---- [.small]#xref:BloombergLP/baljsn/Decoder/decode-0d.adoc[_» more..._]# Decode into the specified `value`, of a (template parameter) `TYPE`, the JSON data read from the specified `stream` and using the specified `options`. `TYPE` shall be a `bdeat`‐compatible sequence, choice, or array type, or a `bdeat`‐compatible dynamic type referring to one of those types. Specifying a nullptr `options` is equivalent to passing a default‐constructed DecoderOptions in `options`. Return 0 on success, and a non‐zero value otherwise. Note that this operation internally buffers input from `stream`, and if decoding is successful, will attempt to update the input position of `stream` to the last unprocessed byte. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int xref:BloombergLP/baljsn/Decoder/decode-0f.adoc[decode]( std::istream& stream, TYPE* value, xref:BloombergLP/baljsn/DecoderOptions.adoc[DecoderOptions] const& options); ---- [.small]#xref:BloombergLP/baljsn/Decoder/decode-0f.adoc[_» more..._]# Same as the preceding overload, accepting a nullable `options` pointer. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int xref:BloombergLP/baljsn/Decoder/decode-03.adoc[decode]( std::istream& stream, TYPE* value, xref:BloombergLP/baljsn/DecoderOptions.adoc[DecoderOptions] const* options); ---- [.small]#xref:BloombergLP/baljsn/Decoder/decode-03.adoc[_» more..._]# Decode into the specified `value`, of a (template parameter) `TYPE`, the JSON data read from the specified `streamBuf` and using the specified `options`. Specifying a nullptr `options` is equivalent to passing a default‐constructed DecoderOptions in `options`. `TYPE` shall be a `bdeat`‐compatible sequence, choice, or array type, or a `bdeat`‐compatible dynamic type referring to one of those types. Return 0 on success, and a non‐zero value otherwise. Note that this operation internally buffers input from `streambuf`, and if decoding is successful, will attempt to update the input position of `streambuf` to the last unprocessed byte. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int xref:BloombergLP/baljsn/Decoder/decode-00.adoc[decode]( std::streambuf* streamBuf, TYPE* value, xref:BloombergLP/baljsn/DecoderOptions.adoc[DecoderOptions] const& options); ---- [.small]#xref:BloombergLP/baljsn/Decoder/decode-00.adoc[_» more..._]# Same as the preceding overload, accepting a nullable `options` pointer. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int xref:BloombergLP/baljsn/Decoder/decode-0c.adoc[decode]( std::streambuf* streamBuf, TYPE* value, xref:BloombergLP/baljsn/DecoderOptions.adoc[DecoderOptions] const* options); ---- [.small]#xref:BloombergLP/baljsn/Decoder/decode-0c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#