[#BloombergLP-baljsn-SimpleFormatter-addValue-08]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/SimpleFormatter.adoc[SimpleFormatter]::addValue
:relfileprefix: ../../../
:mrdocs:

Print the specified `name` and `value` onto the stream&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
int
addValue(
    std::string&lowbar;view const& name,
    TYPE const& value);
----

== Description

Print onto the stream supplied at construction the specified `name` and the specified `value`, preceded, if necessary, by a comma, passing the optionally specified `options` through to the rendering routines&period; Return 0 on success and a non&hyphen;zero value otherwise&period; The behavior is undefined unless `isNameNeeded()` is `true`&period;

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *name*
| member name for the value
| *value*
| value to encode as JSON
|===


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