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

#include <balber_berutil.h>

Public Types

typedef BerUtil_DateAndTimeHeader Header
 
typedef BerUtil_DateAndTimeHeaderType Type
 
typedef BerUtil_StreambufUtil StreambufUtil
 
typedef BerUtil_TimezoneOffsetImpUtil TimezoneUtil
 

Static Public Member Functions

static bool isReserved (unsigned char firstByte)
 
static bool isExtendedBinary (unsigned char firstByte)
 
static bool isExtendedBinaryWithoutTimezone (unsigned char firstByte)
 
static bool isExtendedBinaryWithTimezone (unsigned char firstByte)
 
static void detectTypeIfNotReserved (bool *reserved, Type::Value *type, unsigned char firstByte)
 
static void detectType (Type::Value *type, unsigned char firstByte)
 
static int getValueIfNotReserved (Header *value, bsl::streambuf *streamBuf)
 
static int getValueIfNotReserved (Header *value, unsigned char headerByte0, unsigned char headerByte1)
 
static int getValue (Header *value, bsl::streambuf *streamBuf)
 
static int getValue (Header *value, unsigned char headerByte0, unsigned char headerByte1)
 
static int putExtendedBinaryWithoutTimezoneValue (bsl::streambuf *streamBuf)
 
static int putExtendedBinaryWithTimezoneValue (bsl::streambuf *streamBuf, int timezoneOffsetInMinutes)
 

Static Public Attributes

static const int k_HEADER_LENGTH = 2
 Number of octets used to encode an extended-binary-encoding header.
 

Detailed Description

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.

Member Typedef Documentation

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

Member Function Documentation

◆ detectType()

void balber::BerUtil_DateAndTimeHeaderImpUtil::detectType ( Type::Value type,
unsigned char  firstByte 
)
inlinestatic

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()

void balber::BerUtil_DateAndTimeHeaderImpUtil::detectTypeIfNotReserved ( bool *  reserved,
Type::Value type,
unsigned char  firstByte 
)
inlinestatic

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() [1/2]

int balber::BerUtil_DateAndTimeHeaderImpUtil::getValue ( Header value,
bsl::streambuf *  streamBuf 
)
inlinestatic

Read 2 bytes from the input sequence of the specified streamBuf and load to the specified value the interpretation of those bytes as an extended-binary header value Return 0 on success, and a non-zero value otherwise. The behavior is undefined if 2 bytes are successfully read from the streamBuf, but the interpretation of those bytes as an extended-binary header indicates the value is in a format reserved for future use.

◆ getValue() [2/2]

int balber::BerUtil_DateAndTimeHeaderImpUtil::getValue ( Header value,
unsigned char  headerByte0,
unsigned char  headerByte1 
)
inlinestatic

Load to the specified value the interpretation of the specified headerByte0 and headerByte1 as the 2 bytes that comprise an encoded extended-binary header value. Return 0 on success, and a non-zero value otherwise. The behavior is undefined if the interpretation of the 2 bytes as an extended-binary header indicates the value is in a format reserved for future use.

◆ getValueIfNotReserved() [1/2]

int balber::BerUtil_DateAndTimeHeaderImpUtil::getValueIfNotReserved ( Header value,
bsl::streambuf *  streamBuf 
)
inlinestatic

Read 2 bytes from the input sequence of the specified streamBuf and load to the specified value the interpretation of those bytes as an extended-binary header value, if that header indicates the value is not in a format reserved for future use. Return 0 on success, and a non-zero value otherwise.

◆ getValueIfNotReserved() [2/2]

int balber::BerUtil_DateAndTimeHeaderImpUtil::getValueIfNotReserved ( Header value,
unsigned char  headerByte0,
unsigned char  headerByte1 
)
inlinestatic

Load to the specified value the interpretation of the specified headerByte0 and headerByte1 as the 2 bytes that comprise an encoded extended-binary header value if that value indicates it is not in a format reserved for future use. Return 0 on success, and a non-zero value otherwise.

◆ isExtendedBinary()

bool balber::BerUtil_DateAndTimeHeaderImpUtil::isExtendedBinary ( unsigned char  firstByte)
inlinestatic

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.

◆ isExtendedBinaryWithoutTimezone()

bool balber::BerUtil_DateAndTimeHeaderImpUtil::isExtendedBinaryWithoutTimezone ( unsigned char  firstByte)
inlinestatic

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.

◆ isExtendedBinaryWithTimezone()

bool balber::BerUtil_DateAndTimeHeaderImpUtil::isExtendedBinaryWithTimezone ( unsigned char  firstByte)
inlinestatic

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.

◆ isReserved()

bool balber::BerUtil_DateAndTimeHeaderImpUtil::isReserved ( unsigned char  firstByte)
inlinestatic

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.

◆ putExtendedBinaryWithoutTimezoneValue()

int balber::BerUtil_DateAndTimeHeaderImpUtil::putExtendedBinaryWithoutTimezoneValue ( bsl::streambuf *  streamBuf)
inlinestatic

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.

◆ putExtendedBinaryWithTimezoneValue()

int balber::BerUtil_DateAndTimeHeaderImpUtil::putExtendedBinaryWithTimezoneValue ( bsl::streambuf *  streamBuf,
int  timezoneOffsetInMinutes 
)
inlinestatic

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.

Member Data Documentation

◆ k_HEADER_LENGTH

const int balber::BerUtil_DateAndTimeHeaderImpUtil::k_HEADER_LENGTH = 2
static

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