This component‐private utility struct provides a namespace for a suite of functions used by BerUtil to implement encoding and decoding operations for the 2‐byte header of extended‐binary‐encoding formatted date‐and‐time value.

Synopsis

Declared in <balber_berutil.h>

struct BerUtil_DateAndTimeHeaderImpUtil;

Type Aliases

Name

Description

Header

Header is an alias to an in‐core, value‐semantic attribute class that represents the range of valid values of the 2‐byte header of extended‐binary‐encoding formatted date‐and‐time values.

StreambufUtil

StreambufUtil is an alias to a namespace for a suite of functions used to implement input and output operations on bsl::streambuf objects.

TimezoneUtil

TimezoneUtil is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for time‐zone offset values.

Type

Type is an alias to a namespace for enumerating the set of "header type" values that may be encoded in the 2‐byte header of an extended‐binary‐encoding formatted date‐and‐time value.

Static Member Functions

Name

Description

detectType

If the specified firstByte of an encoded date‐and‐time value indicates it is in a compact‐binary‐encoding format or an ISO 8601 format, load the value Type::e_NOT_EXTENDED_BINARY to the specified type. If it indicates it is in an extended‐binary format that carries a time‐zone offset value, load the value Type::e_EXTENDED_BINARY_WITH_TIMEZONE to the type. If it indicates it is in an extended‐binary format that does not carry a time‐zone offset value, load the value Type::e_EXTENDED_BINARY_WITHOUT_TIMEZONE to the type. The behavior is undefined unless isReserved(firstByte) returns false.

detectTypeIfNotReserved

If the specified firstByte of an encoded date‐and‐time value indicates it is in a compact‐binary‐encoding format or an ISO 8601 format, load the value Type::e_NOT_EXTENDED_BINARY to the specified type and false to the specified reserved flag. If it indicates it is in an extended‐binary format that carries a time‐zone offset value, load the value Type::e_EXTENDED_BINARY_WITH_TIMEZONE to the type and false to reserved. If it indicates it is in an extended‐binary format that does not carry a time‐zone offset value, load the value Type::e_EXTENDED_BINARY_WITHOUT_TIMEZONE to the type and false to reserved. Otherwise, load the value true to reserved and leave the type in a valid but unspecified state. Note that this operation has a wide contract because all possible values of firstByte can be interpreted to indicate one of the conditions described above.

getValue

getValue overloads

getValueIfNotReserved

getValueIfNotReserved overloads

isExtendedBinary

Return true if the specified firstByte of an encoded date‐and‐time value indicates it is in the extended‐binary‐encoding format, and return false otherwise.

isExtendedBinaryWithTimezone

Return true if the specified firstByte if an encoded date‐and‐time value indicates is is in the extended‐binary‐encoding format and carries a time‐zone offset value, and return false otherwise.

isExtendedBinaryWithoutTimezone

Return true if the specified firstByte of an encoded date‐and‐time value indicates it is in the extended‐binary‐encoding format and does not carry a time‐zone offset value, and return false otherwise.

isReserved

Return true if the specified firstByte of an encoded date‐and‐time value indicates it is in a format reserved for future use, and return false otherwise. Note that this may indicate the value was encoded incorrectly or using a newer version of this component.

putExtendedBinaryWithTimezoneValue

Write a representation of an extended‐binary header value that carries the specified timezoneOffsetInMinutes time‐zone offset value to the specified streamBuf. Return 0 on success, and a non‐zero value otherwise.

putExtendedBinaryWithoutTimezoneValue

Write a representation of an extended‐binary header value that does not carry a time‐zone offset value to the specified streamBuf. Return 0 on success, and a non‐zero value otherwise.

Static Data Members

Name

Description

k_HEADER_LENGTH

Number of octets used to encode an extended‐binary‐encoding header.

Created with MrDocs