BloombergLP::baljsn::Encoder

This class provides a mechanism for encoding value-semantic objects in the JSON format.

Synopsis

Declared in <baljsn_encoder.h>

class Encoder;

Description

The encode methods are function templates that will encode any object that meets the requirements of a sequence, choice, or array object as defined in the bdlat_sequencefunctions, bdlat_choicefunctions, and bdlat_choicefunctions components respectively. These generic frameworks provide a common compile-time interface for accessing struct-like and union-like objects. In particular, the types generated by bas_codegen.pl provide the necessary interface and can be encoded using this component.

Member Functions

NameDescription
Encoder [constructor]Create a encoder object. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
encode encode overloads
encodeAny encodeAny overloads
loggedMessages Return messages logged during the last call to the encode method.