BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balber_berencoderoptionsutil

Detailed Description

Provide a utility for configuring balber::BerEncoderOptions.

Outline

Purpose

Provide a utility for configuring balber::BerEncoderOptions.

Classes

See also
balber_berencoder, balber_berencoderoptions

Description

This component provides a struct of utility functions, balber::BerEncoderOptionsUtil, for configuring balber::BerEncoderOptions object. In particular, this utility can be used to set the recommended options needed for encoding BER messages that are time-efficient to decode. This utility can also be used to set a balber::BerEncoderOptions object to its default state.

Modes

This utility defines the mode balber::BerEncoderOptionsUtil::e_DEFAULT that sets the attributes to the values used in balber::BerEncoderOptions().

This utility defines the mode balber::BerEncoderOptionsUtil::e_FAST_20250615 that applies the default attribute values except for the following overrides:

encodeDateAndTimeTypesAsBinary true
encodeArrayLengthHints true

WARNING: It is only safe to use this mode when communicating with a balber BER decoder built after June 15, 2025.

Usage

This section illustrates intended use of this component.

Example 1: Setting balber::EncoderOptions for Efficiency

Every call to one of the encode functions of balber::BerEncoder requires the user to provide a balber::BerEncoderOptions object. The setMode function of this utility provides a convenient way to set the option attributes to a combination that is deemed efficient for future decoding of the message.

First, create a balber::BerEncoderOptions object:

Definition balber_berencoderoptions.h:70

Now, set the option values for efficiency:

&options,
@ e_FAST_20250615
Definition balber_berencoderoptionsutil.h:130
static void setMode(BerEncoderOptions *options, Mode mode)

Finally, options can be adjusted to the set of default attributes: