BDE 4.9.0 Release

Schedule

  • The BDE team announces that the BDE 4.9.0 production release was completed on Friday, May 31, 2024.

BDE 4.9.0 Release Highlights

Support for Range Based For-Loops Added to bdld::Datum

Support has been added for range-based-for loops for loops over containers of types bdlb::DatumMapRef, bdlb::DatumIntMapRef, and bdlb::DatumArrayRef.

Processing an array with range based for-loop
 int processArray(const bdldd::Datum& data)
 {
     BSLS_ASSERT(data.isArray());
     for (Datum element: data.arrayRef()) {
         // process element
     }
 }

balxml::DecoderOptions: Has New Option: ValidateRootTag

Sometimes, two XML documents have compatible structures that differ only in their top-most (root) tag name. For example, the “HealthInfo” document:

<HealthInfo>
    <name>Bob</name>
    <homeAddress>
        ...
    </homeAddress>
    <age>21</age>
</HealthInfo>

may have the same layout as a document that describes “Employee” information. By default, balxml::Decoder ignores the top-level and will load the content of the above document to an Employee class object.

In this release, the balxml::DecoderOptions class, passed to balxml::Decoder on construction, has an additional option, ValidateRootTag (false by default). If set to true, a successful decode performs an addition check: The top-level node in XML document being decoded must have the same name as the class name (if available) of the object being set from the document. For example, if we are trying to load an Employee object:

balxml::DecoderOptions decoderOptions;
decoderOptions.setValidateRootTag(true);  // NEW OPTION

balxml::Decoder decoder(&decoderOptions, /* ... */);

Empolyee employee;
int rc = decoder.decode(buffer, sizeof buffer -1, &employee);

the decode operation fails if the document has a top-level tag other than Employee.

baljsn JSON Decoder Now Supports “Strict” JSON Validation

The baljsn::Decoder class allows (by default) several variances to the JSON grammar that are found convenient by most users. These exceptions to the rules are described by several of the attributes of the baljsn::DecoderOptions class (several added recently):

Attribute                       Default Strict
------------------------------- ------- ------
validateInputIsUtf8             false   true
allowConsecutiveSeparators      true    false
allowFormFeedAsWhitespace       true    false
allowUnescapedControlCharacters true    false

If stricter behavior is needed, users can flip one or more of these attributes to enforce stricter conformance to the JSON standard. To facilitate setting all strictness options in a single operation, this release introduces baljsn::DecoderOptionsUtil.

The baljsn::DecoderOptionsUtil::setMode function currently supports two modes:

e_DEFAULT           // Set all attributes (strict and others) to defaults.
e_STRICT_20240423   // Set the "strict" attributes as shown above.

Notice that the “strict” mode name features a date. Doing so allows us to refine the definition of “strictness”, should the need arise, by adding new modes (named with later dates) without triggering any behavior changes to users of the mode named above. Users can opt-in to the later strictness rules when/if they choose.

Fixed DRQSs:

Summary

bdljsn_numberutil: improve usage example

Reintroduce changes to balxml::Decoder to error on incorrect root tag

Remove dependencies on old bdlat specializations (parent ticket)

dependers-of-changes fails to select the test driver for the header that was modified

Fix clang warning in bdlb_variant.h

Support range-based-for for ‘bdld::Datum’

bdlf_bind.h: improve commenting

Please include <cstdint> in <bsl_cstdint.h>

Support const-qualifier overloads in ‘bsls_protocoltest’

Provide ‘balst::StackTraceTestAllocator::numAllocations’ similar to ‘bslma::TestAllocator’

Address UB in balber_berutil

Update MetricRegistry to avoid singleton lifetime issues

bsl::shared_ptr c++20 array forms fail to compile

Please remove noexcept from bsl_span.h that aren’t reqd by the standard

Create bdld::Datumutil with typedPrint for bdld::Datum

BdeToolchain64 duplicates -fno-strict-aliasing for Linux

PR 4715 - balb_controlmanager private members are now private

Remove length() declaration from Datum*MapRef

bslh_hash long double test failures

bsl::list: add ‘size_type’ return to remove* methods

bdlb_nullablevalue.t.cpp fails on clang 15 cpp20

Inconsistency of Request Validation Via BEG Between Dev and Prod

ball::UserFields::append() is not implemented

bsls_nameof: cope with std::pmr::string

Signed integer overflow in ball_rule.cpp

balber SAFE assert during DatetimeTz decoding

Please provide baljsn::DecoderOptionsUtil

PARENT: improve bdlm documentaion

improve package level documentation

improve MetricDescriptor documentation

improve Metric documentation

balber_berdecoder.t.cpp: formatting, consistency, brevity

Please test erroneously specified date/time lengths in balber_berutil

Please test balber_berdecoder’s ability to reject overlong date/times

Improve bsl::ranges gcc-11 documentation

Add support for Linux on ARM

Regression in balxml_encoderoptions.