BDE 4.14.0 Production release
|
#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. | |
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.
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
is an alias to a namespace for a suite of functions used to implement input and output operations on bsl::streambuf
objects.
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
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.
|
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
.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
static |