[#BloombergLP-baljsn-Decoder-decode-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/Decoder.adoc[Decoder]::decode
:relfileprefix: ../../../
:mrdocs:

Decode JSON from `streamBuf` into `value` using default options&period;

== Synopsis

Declared in `&lt;baljsn&lowbar;decoder&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
int
decode(
    std::streambuf* streamBuf,
    TYPE* value);
----

== Description

Decode an object of (template parameter) `TYPE` from the specified `streamBuf` and load the result into the specified modifiable `value`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period;

DEPRECATED&colon; Use the `decode` function passed a reference to a non&hyphen;modifiable `DecoderOptions` object instead&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *streamBuf*
| input buffer supplying JSON
| *value*
| object to decode into
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
