BDE 4.14.0 Production release
Loading...
Searching...
No Matches
baljsn_datumdecoderoptions

Detailed Description

Outline

Purpose

Provide options for decoding JSON into a Datum object.

Classes

See also
baljsn_datumutil

Description

This component provides a single, simply constrained (value-semantic) attribute class, baljsn::DatumDecoderOptions, that is used to specify options for decoding Datum objects in the JSON format (see baljsn::DatumUtil).

Attributes

Name Type Default Simple Constraints
------------------ ----------- ------- ------------------
maxNestedDepth int 64 > 0

Usage

This section illustrates intended use of this component.

Example 1: Creating and Populating an Options Object

This component is designed to be used at a higher level to set the options for decoding Datum objects in the JSON format. This example shows how to create and populate an options object.

First, we default-construct a baljsn::DatumDecoderOptions object:

const int MAX_NESTED_DEPTH = 16;
assert(64 == options.maxNestedDepth());
Definition baljsn_datumdecoderoptions.h:126
int maxNestedDepth() const
Return the "maxNestedDepth" attribute of this object.
Definition baljsn_datumdecoderoptions.h:226

Finally, we populate that object to limit the maximum nested depth using a pre-defined limit:

options.setMaxNestedDepth(MAX_NESTED_DEPTH);
assert(MAX_NESTED_DEPTH == options.maxNestedDepth());
void setMaxNestedDepth(int value)
Definition baljsn_datumdecoderoptions.h:217