[#BloombergLP-baljsn-JsonFormatter_Util-valueAsJson-00] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/JsonFormatter_Util.adoc[JsonFormatter_Util]::valueAsJson :relfileprefix: ../../../ :mrdocs: Load the JSON representation of `value` into the specified `json`. == Synopsis Declared in `<baljsn_jsonformatter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> static int valueAsJson( xref:BloombergLP/bdljsn/Json.adoc[bdljsn::Json]* json, TYPE const& value, xref:BloombergLP/baljsn/EncoderOptions.adoc[EncoderOptions] const* options); ---- == Description Optionally use the specified `options`. Return 0 on success and a non‐zero value otherwise. == Specializations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-025.adoc[`valueAsJson<Date>`] | Load the JSON representation of the `Date` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-045.adoc[`valueAsJson<DateTz>`] | Load the JSON representation of the `DateTz` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-0bc8.adoc[`valueAsJson<Datetime>`] | Load the JSON representation of the `Datetime` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-0d.adoc[`valueAsJson<DatetimeTz>`] | Load the JSON representation of the `DatetimeTz` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-0a.adoc[`valueAsJson<Decimal_Type64>`] | Load the JSON representation of the `Decimal64` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-066.adoc[`valueAsJson<Time>`] | Load the JSON representation of the `Time` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-02f.adoc[`valueAsJson<TimeTz>`] | Load the JSON representation of the `TimeTz` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-068.adoc[`valueAsJson<double>`] | Load the JSON representation of the `double` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-05.adoc[`valueAsJson<float>`] | Load the JSON representation of the `float` `value` into `json`. | xref:BloombergLP/baljsn/JsonFormatter_Util/valueAsJson-0bcb.adoc[`valueAsJson<basic_string<char>>`] | Load the JSON representation of the `bsl::string` `value` into `json`. |=== == Return Value 0 on success and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *json* | JSON object to receive the encoded value | *value* | value to encode as JSON | *options* | optional encoding options; null uses defaults |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#