[#BloombergLP-balxml-Decoder-decode-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Decoder.adoc[Decoder]::decode
:relfileprefix: ../../../
:mrdocs:

`decode` overloads

== Synopses

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

Decode the specified `object` of parameterized `TYPE` from the input source specified by a previous call to `open` and leave the reader in an open state&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; A compilation error will result unless `TYPE` conforms to the requirements of a bdlat sequence or choice, as described in `bdlat&lowbar;sequencefunctions` and `bdlat&lowbar;choicefunctions`&period; The behavior is undefined unless this call was preceded by a prior successful call to `open`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
int
xref:BloombergLP/balxml/Decoder/decode-0b.adoc[decode](TYPE* object);
----

[.small]#xref:BloombergLP/balxml/Decoder/decode-0b.adoc[_» more&period;&period;&period;_]#

Decode the specified `object` of parameterized `TYPE` from the file with the specified `filename`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; A compilation error will result unless `TYPE` conforms to the requirements of a bdlat sequence or choice, as described in `bdlat&lowbar;sequencefunctions` and `bdlat&lowbar;choicefunctions`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
int
xref:BloombergLP/balxml/Decoder/decode-00d.adoc[decode](
    char const* filename,
    TYPE* object);
----

[.small]#xref:BloombergLP/balxml/Decoder/decode-00d.adoc[_» more&period;&period;&period;_]#

Decode the specified `object` of parameterized `TYPE` from the specified input `stream`&period; Return a reference to the modifiable `stream`&period; If a decoding error is detected, `stream&period;fail()` will be `true` after this method returns&period; The (optionally) specified `uri` is used for identifying the input document in error messages&period; A compilation error will result unless `TYPE` conforms to the requirements of a `bdlat` sequence or choice, as described in `bdlat&lowbar;sequencefunctions` and `bdlat&lowbar;choicefunctions`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
std::istream&
xref:BloombergLP/balxml/Decoder/decode-0c.adoc[decode](
    std::istream& stream,
    TYPE* object,
    char const* uri = 0);
----

[.small]#xref:BloombergLP/balxml/Decoder/decode-0c.adoc[_» more&period;&period;&period;_]#

Decode the specified `object` of parameterized `TYPE` from the specified stream `buffer`&period; The (optionally) specified `uri` is used for identifying the input document in error messages&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; A compilation error will result unless `TYPE` conforms to the requirements of a bdlat sequence or choice, as described in `bdlat&lowbar;sequencefunctions` and `bdlat&lowbar;choicefunctions`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
int
xref:BloombergLP/balxml/Decoder/decode-009.adoc[decode](
    std::streambuf* buffer,
    TYPE* object,
    char const* uri = 0);
----

[.small]#xref:BloombergLP/balxml/Decoder/decode-009.adoc[_» more&period;&period;&period;_]#

Decode the specified `object` of parameterized `TYPE` from the memory at the specified `buffer` address, having the specified `length`&period; The (optionally) specified `uri` is used for identifying the input document in error messages&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; A compilation error will result unless `TYPE` conforms to the requirements of a bdlat sequence or choice, as described in `bdlat&lowbar;sequencefunctions` and `bdlat&lowbar;choicefunctions`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
int
xref:BloombergLP/balxml/Decoder/decode-07.adoc[decode](
    char const* buffer,
    std::size&lowbar;t length,
    TYPE* object,
    char const* uri = 0);
----

[.small]#xref:BloombergLP/balxml/Decoder/decode-07.adoc[_» more&period;&period;&period;_]#


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