BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balber::BerUtil_TimeImpUtil Struct Reference

#include <balber_berutil.h>

Public Types

typedef BerUtil_ExtendedBinaryEncodingUtil ExtendedBinaryEncodingUtil
 
typedef BerUtil_DateAndTimeHeader DateAndTimeHeader
 
typedef BerUtil_DateAndTimeHeaderType DateAndTimeHeaderType
 
typedef BerUtil_DateAndTimeHeaderImpUtil DateAndTimeHeaderUtil
 
typedef BerUtil_IntegerImpUtil IntegerUtil
 
typedef BerUtil_Iso8601ImpUtil Iso8601Util
 
typedef BerUtil_LengthImpUtil LengthUtil
 
typedef BerUtil_StringImpUtil StringUtil
 
typedef BerUtil_StreambufUtil StreambufUtil
 
typedef BerUtil_TimeEncoding TimeEncoding
 
typedef BerUtil_TimeTzEncoding TimeTzEncoding
 
typedef BerUtil_TimeOrTimeTzEncoding TimeOrTimeTzEncoding
 
typedef BerUtil_TimezoneOffsetImpUtil TimezoneUtil
 
typedef bdlb::Variant2< bdlt::Time, bdlt::TimeTzTimeOrTimeTz
 

Static Public Member Functions

static void timeToMillisecondsSinceMidnight (int *millisecondsSinceMidnight, const bdlt::Time &time)
 
static void timeToMicrosecondsSinceMidnight (bsls::Types::Int64 *microsecondsSinceMidnight, const bdlt::Time &time)
 
static int millisecondsSinceMidnightToTime (bdlt::Time *time, int millisecondsSinceMidnight)
 
static int microsecondsSinceMidnightToTime (bdlt::Time *time, bsls::Types::Int64 microsecondsSinceMidnight)
 
static int getTimeValue (bdlt::Time *value, bsl::streambuf *streamBuf, int length)
 
static int putTimeValue (bsl::streambuf *streamBuf, const bdlt::Time &value, const BerEncoderOptions *options)
 
static int getTimeTzValue (bdlt::TimeTz *value, bsl::streambuf *streamBuf, int length)
 
static int putTimeTzValue (bsl::streambuf *streamBuf, const bdlt::TimeTz &value, const BerEncoderOptions *options)
 
static int getTimeOrTimeTzValue (TimeOrTimeTz *value, bsl::streambuf *streamBuf, int length)
 

Detailed Description

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:

: the specification: : Refers to the August 2015 revision of the ITU-T Recommendation X.690, : and : : 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.

Member Typedef Documentation

◆ DateAndTimeHeader

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.

◆ DateAndTimeHeaderType

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.

◆ 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.

◆ ExtendedBinaryEncodingUtil

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.

◆ 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.

◆ TimeEncoding

TimeEncoding 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::Time type.

◆ TimeOrTimeTz

◆ TimeOrTimeTzEncoding

TimeOrTimeTzEncoding 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::Time, bdlt::TimeTz> type.

◆ TimeTzEncoding

TimeTzEncoding 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::TimeTz type.

◆ 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.

Member Function Documentation

◆ getTimeOrTimeTzValue()

int balber::BerUtil_TimeImpUtil::getTimeOrTimeTzValue ( TimeOrTimeTz value,
bsl::streambuf *  streamBuf,
int  length 
)
inlinestatic

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.

◆ getTimeTzValue()

int balber::BerUtil_TimeImpUtil::getTimeTzValue ( bdlt::TimeTz value,
bsl::streambuf *  streamBuf,
int  length 
)
inlinestatic

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.

◆ getTimeValue()

int balber::BerUtil_TimeImpUtil::getTimeValue ( bdlt::Time value,
bsl::streambuf *  streamBuf,
int  length 
)
inlinestatic

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.

◆ microsecondsSinceMidnightToTime()

int balber::BerUtil_TimeImpUtil::microsecondsSinceMidnightToTime ( bdlt::Time time,
bsls::Types::Int64  microsecondsSinceMidnight 
)
inlinestatic

Load to the specified time the time value represented by the specified microsecondsSinceMidnight.

◆ millisecondsSinceMidnightToTime()

int balber::BerUtil_TimeImpUtil::millisecondsSinceMidnightToTime ( bdlt::Time time,
int  millisecondsSinceMidnight 
)
inlinestatic

Load to the specified time the time value represented by the specified millisecondsSinceMidnight.

◆ putTimeTzValue()

int balber::BerUtil_TimeImpUtil::putTimeTzValue ( bsl::streambuf *  streamBuf,
const bdlt::TimeTz value,
const BerEncoderOptions options 
)
inlinestatic

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.

◆ putTimeValue()

int balber::BerUtil_TimeImpUtil::putTimeValue ( bsl::streambuf *  streamBuf,
const bdlt::Time value,
const BerEncoderOptions options 
)
inlinestatic

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.

◆ timeToMicrosecondsSinceMidnight()

void balber::BerUtil_TimeImpUtil::timeToMicrosecondsSinceMidnight ( bsls::Types::Int64 microsecondsSinceMidnight,
const bdlt::Time time 
)
inlinestatic

Load to the specified microsecondsSinceMidnight the number of microseconds in the specified time value.

◆ timeToMillisecondsSinceMidnight()

void balber::BerUtil_TimeImpUtil::timeToMillisecondsSinceMidnight ( int *  millisecondsSinceMidnight,
const bdlt::Time time 
)
inlinestatic

Load to the specified millisecondsSinceMidnight the number of milliseconds in the specified time value.


The documentation for this struct was generated from the following file: