Quick Links: |
#include <balber_berutil.h>
This component-private struct
provides a namespace for a suite of functions used by BerUtil
to implement BER encoding and decoding operations for time values. Within the definition of this struct
:
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.
static void balber::BerUtil_TimeImpUtil::timeToMillisecondsSinceMidnight | ( | int * | millisecondsSinceMidnight, | |
const bdlt::Time & | time | |||
) | [static] |
Load to the specified millisecondsSinceMidnight
the number of milliseconds in the specified time
value.
static void balber::BerUtil_TimeImpUtil::timeToMicrosecondsSinceMidnight | ( | bsls::Types::Int64 * | microsecondsSinceMidnight, | |
const bdlt::Time & | time | |||
) | [static] |
Load to the specified microsecondsSinceMidnight
the number of microseconds in the specified time
value.
static int balber::BerUtil_TimeImpUtil::millisecondsSinceMidnightToTime | ( | bdlt::Time * | time, | |
int | millisecondsSinceMidnight | |||
) | [static] |
Load to the specified time
the time value represented by the specified millisecondsSinceMidnight
.
static int balber::BerUtil_TimeImpUtil::microsecondsSinceMidnightToTime | ( | bdlt::Time * | time, | |
bsls::Types::Int64 | microsecondsSinceMidnight | |||
) | [static] |
Load to the specified time
the time value represented by the specified microsecondsSinceMidnight
.
static int balber::BerUtil_TimeImpUtil::getTimeValue | ( | bdlt::Time * | value, | |
bsl::streambuf * | streamBuf, | |||
int | length | |||
) | [static] |
Read the specified length
number of bytes from the input sequence of the specified streamBuf
and load to the specified value
the time 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 time value. See the package-level documentation of balber
for a description of the decision procedure used to detect the encoding format for a bdlt::Time
value.
static int balber::BerUtil_TimeImpUtil::putTimeValue | ( | bsl::streambuf * | streamBuf, | |
const bdlt::Time & | value, | |||
const BerEncoderOptions * | options | |||
) | [static] |
Write a representation of the specified time value
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
.
static int balber::BerUtil_TimeImpUtil::getTimeTzValue | ( | bdlt::TimeTz * | value, | |
bsl::streambuf * | streamBuf, | |||
int | length | |||
) | [static] |
Read the specified length
number of bytes from the input sequence of the specified streamBuf
and load to the specified value
the time 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 time 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::TimeTz
value.
static int balber::BerUtil_TimeImpUtil::putTimeTzValue | ( | bsl::streambuf * | streamBuf, | |
const bdlt::TimeTz & | value, | |||
const BerEncoderOptions * | options | |||
) | [static] |
Write a representation of the specified time and time-zone value
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
.
static int balber::BerUtil_TimeImpUtil::getTimeOrTimeTzValue | ( | TimeOrTimeTz * | value, | |
bsl::streambuf * | streamBuf, | |||
int | length | |||
) | [static] |
Read the specified length
number of bytes from the input sequence of the specified streamBuf
and load to the specified value
the time 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 time 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 TimeOrTimeTz
value.