|
BDE 4.39.x Production Release
|
Provide options for conversion of bdlat to Json objects.
Provide options for conversion of bdlat to Json objects.
bdlat to bdljsn::JsonThis component provides a single, (value-semantic) attribute class, baljsn::ConvertToJsonOptions, that is used to specify options for converting bdlat-compliant objects to bdljsn::Json objects.
convertEmptyArrays: whether empty arrays should be converted to bdljsn::JsonArray() objects. Note that empty arrays that occur as selections of choices are always converted regardless of this option setting.convertNullElements: whether null elements in arrays should be converted as bdljsn::JsonNull() objects.The default values of these options are the opposite of the default values of the similarly named baljsn::EncoderOptions options.
This section illustrates intended use of this component.
This component is designed to be used at a higher level to set the options for JSON conversion of bdlat objects. This example shows how to create and populate an options object.
First, we default-construct a baljsn::ConvertToJsonOptions object:
Next, we populate that object with custom values: