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

This class provides a mechanism for decoding JSON data into value&hyphen;semantic objects&period; The `decode` methods are function templates that will decode any object that meets the requirements of a sequence, choice, or array object as defined in the `bdlat&lowbar;sequencefunctions`, `bdlat&lowbar;choicefunctions`, and `bdlat&lowbar;choicefunctions` components respectively&period; These generic frameworks provide a common compile&hyphen;time interface for manipulating struct&hyphen;like and union&hyphen;like objects&period; In particular, the types generated by `bas&lowbar;codegen&period;pl` provide the necessary interface and can be decoded using this component&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Decoder;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baljsn/Decoder/2constructor.adoc[`Decoder`]         [.small]#[constructor]#
| Construct a decoder object using the optionally specified `basicAllocator`&period; If `basicAllocator` is 0, the default allocator is used&period;
| xref:BloombergLP/baljsn/Decoder/decode-04.adoc[`decode`] 
| `decode` overloads
| xref:BloombergLP/baljsn/Decoder/decodeAny-038.adoc[`decodeAny`] 
| `decodeAny` overloads
| xref:BloombergLP/baljsn/Decoder/loggedMessages.adoc[`loggedMessages`] 
| Return a string containing any error, warning, or trace messages that were logged during the last call to the `decode` method&period; The log is reset each time `decode` is called&period;
| xref:BloombergLP/baljsn/Decoder/numUnknownElementsSkipped.adoc[`numUnknownElementsSkipped`] 
| Return the number of unknown elements that were skipped during the previous decoding operation&period; Note that unknown elements are skipped only if `options&period;skipUnknownElements() &equals;&equals; true`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/baljsn/Decoder_ElementVisitor.adoc[BloombergLP::baljsn::Decoder&lowbar;ElementVisitor]`
| This `class` implements a visitor for decoding elements within a sequence, choice, or array type&period; This is a component&hyphen;private class and should not be used outside of this component&period; Note that the operators provided in this `class` match the function signatures required of visitors decoding into elements of compatible types&period;
| `xref:BloombergLP/baljsn/Decoder_DecodeImpProxy.adoc[BloombergLP::baljsn::Decoder&lowbar;DecodeImpProxy]`
| This class provides a functor that dispatches the appropriate `decodeImp` method for a `bdeat` Dynamic type&period; Note that the operators provided in this `class` match the function signatures required of visitors decoding into compatible types&period;
|===


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