Quick Links:

bal | bbl | bdl | bsl

Public Types | Static Public Member Functions | Static Public Attributes

balber::BerUtil_DateAndTimeHeaderImpUtil Struct Reference

#include <balber_berutil.h>

List of all members.

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

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.

See Component balber_berutil


Member Typedef Documentation


Member Function Documentation

static bool balber::BerUtil_DateAndTimeHeaderImpUtil::isReserved ( unsigned char  firstByte  )  [static]

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.

static bool balber::BerUtil_DateAndTimeHeaderImpUtil::isExtendedBinary ( unsigned char  firstByte  )  [static]

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.

static bool balber::BerUtil_DateAndTimeHeaderImpUtil::isExtendedBinaryWithoutTimezone ( unsigned char  firstByte  )  [static]

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.

static bool balber::BerUtil_DateAndTimeHeaderImpUtil::isExtendedBinaryWithTimezone ( unsigned char  firstByte  )  [static]

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.

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

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.

static void balber::BerUtil_DateAndTimeHeaderImpUtil::detectType ( Type::Value type,
unsigned char  firstByte 
) [static]

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.

static int balber::BerUtil_DateAndTimeHeaderImpUtil::getValueIfNotReserved ( Header value,
bsl::streambuf *  streamBuf 
) [static]

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.

static int balber::BerUtil_DateAndTimeHeaderImpUtil::getValueIfNotReserved ( Header value,
unsigned char  headerByte0,
unsigned char  headerByte1 
) [static]

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.

static int balber::BerUtil_DateAndTimeHeaderImpUtil::getValue ( Header value,
bsl::streambuf *  streamBuf 
) [static]

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.

static int balber::BerUtil_DateAndTimeHeaderImpUtil::getValue ( Header value,
unsigned char  headerByte0,
unsigned char  headerByte1 
) [static]

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.

static int balber::BerUtil_DateAndTimeHeaderImpUtil::putExtendedBinaryWithoutTimezoneValue ( bsl::streambuf *  streamBuf  )  [static]

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 int balber::BerUtil_DateAndTimeHeaderImpUtil::putExtendedBinaryWithTimezoneValue ( bsl::streambuf *  streamBuf,
int  timezoneOffsetInMinutes 
) [static]

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


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