BloombergLP::baljsn::JsonConverter

This class provides a mechanism for copying the constituent values of certain bdlat-compatible objects to bdljsn::Json objects, and vice versa. In each case, the resulting object is a different representation of the data in the original. This conversion is analogous to the encoding and decoding operations provided elsewhere in this package; however, the convert methods here avoid the creation of any textual representation of the data.

Synopsis

Declared in <baljsn_jsonconverter.h>

class JsonConverter;

Description

The bdlat objects must meet the requirements of a sequence, choice, or array as defined in bdlat_sequencefunctions, bdlat_choicefunctions, and bdlat_arrayfunctions components, respectively.

Type Aliases

NameDescription
allocator_type This typedef is an alias for allocator_type.

Member Functions

NameDescription
JsonConverter [constructor]Constructors
convert convert overloads
get_allocator Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used.
loggedMessages Return a string containing any error, warning, or trace messages that were logged during the last call to the convert method. The log is reset each time convert is called.

Friends

NameDescription
BloombergLP::baljsn::JsonConverter_ElementVisitorThis class implements a visitor for decoding elements within a sequence, choice, or array type. This is a component-private class and should not be used outside of this component. Note that the operators provided in this class match the function signatures required of visitors decoding into elements of compatible types.