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

`decode` overloads

== Synopses

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

Decode the specified `json` into the specified `result`&period; If the optionally specified `errorStream` is non&hyphen;null, a description of any errors that occur during parsing will be output to this stream&period; If the optionally specified `options` argument is not present, treat it as a default&hyphen;constructed `DatumDecoderOptions`&period; Return 0 on success, and a negative value if `json` could not be decoded (either because it is ill&hyphen;formed, or if a constraint imposed by `option` is violated)&period; An error status will be returned if `json` contains arrays or objects that are nested beyond a depth configured by `options&period;maxNestedDepth()`&period; The mapping of types in JSON to the types supported by `Datum` is described in &lsqb;&rsqb;Types)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-0e.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::string&lowbar;view const& json);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-0e.adoc[_» more&period;&period;&period;_]#

Decode the JSON string provided by the specified `jsonBuffer` into the specified `result`&period; If the optionally specified `errorStream` is non&hyphen;null, a description of any errors that occur during parsing will be output to this stream&period; If the optionally specified `options` argument is not present, treat it as a default&hyphen;constructed `DatumDecoderOptions`&period; Return 0 on success, and a negative value if `json` could not be decoded (either because it is ill&hyphen;formed, or if a constraint imposed by `option` is violated)&period; An error status will be returned if `json` contains arrays or objects that are nested beyond a depth configured by `options&period;maxNestedDepth()`&period; The mapping of types in JSON to the types supported by `Datum` is described in &lsqb;&rsqb;Types)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-01c.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::streambuf* jsonBuffer);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-01c.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified `options`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-0b4.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::string&lowbar;view const& json,
    xref:BloombergLP/baljsn/DatumDecoderOptions.adoc[DatumDecoderOptions] const& options);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-0b4.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, writing errors to `errorStream`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-00.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::ostream* errorStream,
    std::string&lowbar;view const& json);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-00.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, writing errors to `errorStream`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-017.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::ostream* errorStream,
    std::streambuf* jsonBuffer);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-017.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified `options`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-0f.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::streambuf* jsonBuffer,
    xref:BloombergLP/baljsn/DatumDecoderOptions.adoc[DatumDecoderOptions] const& options);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-0f.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified `options`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-09.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::ostream* errorStream,
    std::string&lowbar;view const& json,
    xref:BloombergLP/baljsn/DatumDecoderOptions.adoc[DatumDecoderOptions] const& options);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-09.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified `options`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/baljsn/DatumUtil/decode-0a.adoc[decode](
    xref:BloombergLP/bdld/ManagedDatum.adoc[bdld::ManagedDatum]* result,
    std::ostream* errorStream,
    std::streambuf* jsonBuffer,
    xref:BloombergLP/baljsn/DatumDecoderOptions.adoc[DatumDecoderOptions] const& options);
----

[.small]#xref:BloombergLP/baljsn/DatumUtil/decode-0a.adoc[_» more&period;&period;&period;_]#


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