This component‐private struct provides a namespace for a suite of functions used by BerUtil to implement BER encoding and decoding operations for date values. Within the definition of this struct:

Synopsis

Declared in <balber_berutil.h>

struct BerUtil_DateImpUtil;

Description

* the specification: > Refers to the August 2015 revision of the ITU‐T Recommendation X.690.

* the default set of options: > Refers to a balber::BerEncoderOptions value having a > datetimeFractionalSecondPrecision attribute of 3 and a > encodeDateAndTimeTypesAsBinary attribute of false.

See the package level documentation of balber for a definition of the compact and extended binary formats for date and time values.

Type Aliases

Name

Description

DateAndTimeHeaderUtil

DateAndTimeHeaderUtil is an alias to a namespace for a suite of functions used to implement encoding and decoding operations for the 2‐byte header of an extended‐binary‐encoding formatted date‐and‐time value.

DateEncoding

DateEncoding is an alias to a namespace for enumerating the set of formats that may be used by BerUtil to encode and decode values of bdlt::Date type.

DateOrDateTz

DateOrDateTz is a convenient alias for bdlb::Variant2<bdlt::Date, bdlt::DateTz>.

DateOrDateTzEncoding

DateEncoding is an alias to a namespace for enumerating the set of formats that may be used by BerUtil to decode to values of bdlb::Variant2<bdlt::Date, bdlt::DateTz> type.

DateTzEncoding

DateEncoding is an alias to a namespace for enumerating the set of formats that may be used by BerUtil to encode and decode values of bdlt::DateTz type.

IntegerUtil

IntegerUtil is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for integer values.

Iso8601Util

Iso8601Util is an alias to a namespace for a suite of functions used to implementing the encoding and decoding of date and time values using the ISO 8601 format.

LengthUtil

LengthUtil is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for length quantities.

StreambufUtil

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

StringUtil

StringUtil is an alias to a namespace for a suite of functions used by BerUtil to implement BER encoding and decoding operations for string values.

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.

Enums

Name

Description

Unnamed enum

Constants used when encoding dates in compact binary format.

Static Member Functions

Name

Description

dateToDaysSinceEpoch

Load to the specified daysSinceEpoch the number of days between the compact‐binary date epoch and the specified date. The compact‐binary date epoch is the date defined by the k_COMPACT_BINARY_DATE_EPOCH serial date. Note that this quantity may be negative if the specified date occurs before the compact‐binary date epoch.

daysSinceEpochToDate

Load to the specified date the date represented by the serial date indicated by adding the specified daysSinceEpoch to k_COMPACT_BINARY_DATE_EPOCH. Return 0 on success, and a non‐zero value otherwise. This operation succeeds if the resulting value represents a date in the range [0001JAN01 .. 9999DEC31]. Note that daysSinceEpoch may be negative to indicate a serial date that occurs before k_COMPACT_BINARY_DATE_EPOCH.

getDateOrDateTzValue

Read the specified length number of bytes from the input sequence of the specified streamBuf and load to the specified value the date and optional time zone value represented by those bytes. Return 0 on success, and a non‐zero value otherwise. The operation succeeds if length bytes are successfully read from the input sequence of the streamBuf without the read position becoming unavailable, and the bytes contain a valid representation of a date and optional time zone value. See the package‐level documentation of {`balber`} for a description of the decision procedure used to detect the encoding format for a DateOrDateTz value.

getDateTzValue

Read the specified length number of bytes from the input sequence of the specified streamBuf and load to the specified value the date and time zone value represented by those bytes. Return 0 on success, and a non‐zero value otherwise. The operation succeeds if length bytes are successfully read from the input sequence of the streamBuf without the read position becoming unavailable, and the bytes contain a valid representation of a date and time zone value. See the package‐level documentation of {`balber`} for a description of the decision procedure used to detect the encoding format for a bdlt::DateTz value.

getDateValue

Read the specified length number of bytes from the input sequence of the specified streamBuf and load to the specified value the date value represented those bytes. Return 0 on success, and a non‐zero value otherwise. The operation succeeds if length bytes are successfully read from the input sequence of the streamBuf without the read position becoming unavailable, and the bytes contain a valid representation of a date value. See the package‐level documentation of {`balber`} for a description of the decision procedure used to detect the encoding format for a bdlt::Date value.

putDateTzValue

Write a representation of the specified value date and time zone to the output sequence of the specified streamBuf according to the specified options. If options is 0, the default set of options is used. Return 0 on success, and a non‐zero value otherwise. This operation succeeds if all bytes in the representation of the value are written to the output sequence of the streamBuf without the write position becoming unavailable. See the class documentation for a description of the default options. See the package‐level documentation of {`balber`} for a description of the decision procedure used to select an encoding format for the value.

putDateValue

Write a representation of the specified value date to the output sequence of the specified streamBuf according to the specified options. If options is 0, the default set of options is used. Return 0 on success, and a non‐zero value otherwise. This operation succeeds if all bytes in the representation of the value are written to the output sequence of the streamBuf without the write position becoming unavailable. See the class documentation for a description of the default options. See the package‐level documentation of {`balber`} for a description of the decision procedure used to select an encoding format for the value.

Created with MrDocs