8#ifndef INCLUDED_BALBER_BERUTIL
9#define INCLUDED_BALBER_BERUTIL
149#include <balscm_version.h>
178#include <bsl_streambuf.h>
179#include <bsl_string.h>
180#include <bsl_string_view.h>
181#include <bsl_vector.h>
202#ifndef BDE_OMIT_INTERNAL_DEPRECATED
216 int *accumNumBytesConsumed);
224 bsl::streambuf *streamBuf,
228 int *accumNumBytesConsumed);
236 static int getLength(bsl::streambuf *streamBuf,
238 int *accumNumBytesConsumed);
247 template <
typename TYPE>
249 bsl::streambuf *streamBuf,
261 template <
typename TYPE>
263 bsl::streambuf *streamBuf,
265 int *accumNumBytesConsumed,
291 static int putLength(bsl::streambuf *streamBuf,
int length);
298 template <
typename TYPE>
299 static int putValue(bsl::streambuf *streamBuf,
347 static int peekChar(
char *value, bsl::streambuf *streamBuf);
361 bsl::streambuf *streamBuf,
368 static int putChars(bsl::streambuf *streamBuf,
392 k_TAG_CLASS_MASK = 0xC0,
393 k_TAG_TYPE_MASK = 0x20,
394 k_TAG_NUMBER_MASK = 0x1F,
400 k_MAX_TAG_NUMBER_IN_ONE_OCTET = 30,
408 k_NUM_VALUE_BITS_IN_TAG_OCTET = 7,
415 k_MAX_TAG_NUMBER_OCTETS =
417 k_NUM_VALUE_BITS_IN_TAG_OCTET +
423 k_CHAR_MSB_MASK = 0x80,
426 k_SEVEN_BITS_MASK = 0x7F
442 int *accumNumBytesConsumed,
443 bsl::streambuf *streamBuf);
480 template <
class INTEGRAL_TYPE>
509 k_INDEFINITE_LENGTH = -1,
513 k_INDEFINITE_LENGTH_OCTET = 0x80,
519 k_LONG_FORM_LENGTH_FLAG_MASK = 0x80,
525 k_LONG_FORM_LENGTH_VALUE_MASK = 0x7F
542 int *accumNumBytesConsumed,
543 bsl::streambuf *streamBuf);
550 bsl::streambuf *streamBuf);
557 static int putLength(bsl::streambuf *streamBuf,
int length);
601 bsl::streambuf *streamBuf,
611 static int putBoolValue(bsl::streambuf *streamBuf,
bool value);
665 template <
class INTEGRAL_TYPE>
674 bsl::streambuf *streamBuf,
688 template <
class INTEGRAL_TYPE>
690 bsl::streambuf *streamBuf,
702 bsl::streambuf *streamBuf);
712 template <
class INTEGRAL_TYPE>
736 template <
class INTEGRAL_TYPE>
782 bsl::streambuf *streamBuf,
795 bsl::streambuf *streamBuf,
808 bsl::streambuf *streamBuf,
820 static int putCharValue(bsl::streambuf *streamBuf,
char value);
840 unsigned char value);
876 k_MAX_MULTI_WIDTH_ENCODING_SIZE = 8,
878 k_BINARY_NEGATIVE_NUMBER_ID = 0xC0,
879 k_BINARY_POSITIVE_NUMBER_ID = 0x80,
881 k_REAL_BINARY_ENCODING = 0x80,
883 k_DOUBLE_EXPONENT_SHIFT = 52,
884 k_DOUBLE_OUTPUT_LENGTH = 10,
885 k_DOUBLE_EXPONENT_MASK_FOR_TWO_BYTES = 0x7FF,
886 k_DOUBLE_NUM_EXPONENT_BITS = 11,
887 k_DOUBLE_NUM_MANTISSA_BITS = 52,
888 k_DOUBLE_NUM_EXPONENT_BYTES = 2,
889 k_DOUBLE_NUM_MANTISSA_BYTES = 7,
890 k_DOUBLE_BIAS = 1023,
892 k_POSITIVE_ZERO_LEN = 0,
893 k_NEGATIVE_ZERO_LEN = 1,
895 k_POSITIVE_INFINITY_ID = 0x40,
896 k_NEGATIVE_INFINITY_ID = 0x41,
898 k_NEGATIVE_ZERO_ID = 0x43,
900 k_DOUBLE_INFINITY_EXPONENT_ID = 0x7FF,
901 k_INFINITY_MANTISSA_ID = 0,
903 k_REAL_SIGN_MASK = 0x40,
904 k_REAL_BASE_MASK = 0x20,
905 k_REAL_SCALE_FACTOR_MASK = 0x0C,
906 k_REAL_EXPONENT_LENGTH_MASK = 0x03,
908 k_BER_RESERVED_BASE = 3,
909 k_REAL_BASE_SHIFT = 4,
910 k_REAL_SCALE_FACTOR_SHIFT = 2,
912 k_REAL_MULTIPLE_EXPONENT_OCTETS = 4
929 static void assembleDouble(
double *value,
940 static void normalizeMantissaAndAdjustExp(
long long *mantissa,
947 static void parseDouble(
int *exponent,
967 bsl::streambuf *streamBuf,
980 bsl::streambuf *streamBuf,
995 bsl::streambuf *streamBuf,
1076 static int putChars(bsl::streambuf *streamBuf,
char value,
int numChars);
1097 bsl::streambuf *streamBuf,
1172 template <
class TYPE>
1173 static int getValue(TYPE *value, bsl::streambuf *streamBuf,
int length);
1186 template <
class TYPE>
1187 static int putValue(bsl::streambuf *streamBuf,
1205 bsl::streambuf *streamBuf,
1217 bsl::streambuf *streamBuf,
1229 bsl::streambuf *streamBuf,
1242 bsl::streambuf *streamBuf,
1254 bsl::streambuf *streamBuf,
1266 bsl::streambuf *streamBuf,
1376 bsl::streambuf *streamBuf);
1384 bsl::streambuf *streamBuf);
1538 int d_timezoneOffsetInMinutes;
1645 static bool isReserved(
unsigned char firstByte);
1681 unsigned char firstByte);
1709 unsigned char headerByte0,
1710 unsigned char headerByte1);
1728 unsigned char headerByte0,
1729 unsigned char headerByte1);
1735 bsl::streambuf *streamBuf);
1742 bsl::streambuf *streamBuf,
1743 int timezoneOffsetInMinutes);
1911 k_MAX_COMPACT_BINARY_DATE_LENGTH = 3,
1915 k_MIN_COMPACT_BINARY_DATETZ_LENGTH =
1916 k_MAX_COMPACT_BINARY_DATE_LENGTH + 1,
1921 k_MAX_COMPACT_BINARY_DATETZ_LENGTH = 5
1938 unsigned char firstByte);
1948 static int getIso8601DateValue(
bdlt::Date *value,
1949 bsl::streambuf *streamBuf,
1960 static int getCompactBinaryDateValue(
bdlt::Date *value,
1961 bsl::streambuf *streamBuf,
1972 const BerEncoderOptions *options);
1981 static int putIso8601DateValue(bsl::streambuf *streamBuf,
1983 const BerEncoderOptions *options);
1992 static int putCompactBinaryDateValue(bsl::streambuf *streamBuf,
1994 const BerEncoderOptions *options);
2005 unsigned char firstByte);
2017 bsl::streambuf *streamBuf,
2028 static int getCompactBinaryDateValue(
bdlt::DateTz *value,
2029 bsl::streambuf *streamBuf,
2040 static int getCompactBinaryDateTzValue(
bdlt::DateTz *value,
2041 bsl::streambuf *streamBuf,
2052 const BerEncoderOptions *options);
2061 static int putIso8601DateTzValue(bsl::streambuf *streamBuf,
2063 const BerEncoderOptions *options);
2073 static int putCompactBinaryDateValue(bsl::streambuf *streamBuf,
2075 const BerEncoderOptions *options);
2084 static int putCompactBinaryDateTzValue(bsl::streambuf *streamBuf,
2086 const BerEncoderOptions *options);
2095 static int detectDateOrDateTzEncoding(
2098 unsigned char firstByte);
2109 bsl::streambuf *streamBuf,
2121 bsl::streambuf *streamBuf,
2132 static int getCompactBinaryDateValue(
DateOrDateTz *value,
2133 bsl::streambuf *streamBuf,
2145 static int getCompactBinaryDateTzValue(
DateOrDateTz *value,
2146 bsl::streambuf *streamBuf,
2186 bsl::streambuf *streamBuf,
2218 bsl::streambuf *streamBuf,
2250 bsl::streambuf *streamBuf,
2434 k_EXTENDED_BINARY_TIME_LENGTH =
2440 k_EXTENDED_BINARY_TIMETZ_LENGTH =
2455 k_MIN_COMPACT_BINARY_TIME_LENGTH = 1,
2459 k_MAX_COMPACT_BINARY_TIME_LENGTH = 4,
2463 k_MIN_COMPACT_BINARY_TIMETZ_LENGTH =
2464 k_MAX_COMPACT_BINARY_TIME_LENGTH + 1,
2469 k_MAX_COMPACT_BINARY_TIMETZ_LENGTH = 6
2486 unsigned char firstByte);
2496 static int getIso8601TimeValue(
bdlt::Time *value,
2497 bsl::streambuf *streamBuf,
2508 static int getCompactBinaryTimeValue(
bdlt::Time *value,
2509 bsl::streambuf *streamBuf,
2520 static int getExtendedBinaryTimeValue(
bdlt::Time *value,
2521 bsl::streambuf *streamBuf,
2541 static int putIso8601TimeValue(bsl::streambuf *streamBuf,
2552 static int putCompactBinaryTimeValue(bsl::streambuf *streamBuf,
2563 static int putExtendedBinaryTimeValue(bsl::streambuf *streamBuf,
2576 unsigned char firstByte);
2588 bsl::streambuf *streamBuf,
2599 static int getCompactBinaryTimeValue(
bdlt::TimeTz *value,
2600 bsl::streambuf *streamBuf,
2612 static int getCompactBinaryTimeTzValue(
bdlt::TimeTz *value,
2613 bsl::streambuf *streamBuf,
2625 static int getExtendedBinaryTimeTzValue(
bdlt::TimeTz *value,
2626 bsl::streambuf *streamBuf,
2646 static int putIso8601TimeTzValue(bsl::streambuf *streamBuf,
2658 static int putCompactBinaryTimeValue(bsl::streambuf *streamBuf,
2669 static int putCompactBinaryTimeTzValue(bsl::streambuf *streamBuf,
2680 static int putExtendedBinaryTimeTzValue(bsl::streambuf *streamBuf,
2691 static int detectTimeOrTimeTzEncoding(
2694 unsigned char firstByte);
2705 bsl::streambuf *streamBuf,
2718 bsl::streambuf *streamBuf,
2729 static int getCompactBinaryTimeValue(
TimeOrTimeTz *value,
2730 bsl::streambuf *streamBuf,
2742 static int getCompactBinaryTimeTzValue(
TimeOrTimeTz *value,
2743 bsl::streambuf *streamBuf,
2754 static int getExtendedBinaryTimeValue(
TimeOrTimeTz *value,
2755 bsl::streambuf *streamBuf,
2767 static int getExtendedBinaryTimeTzValue(
TimeOrTimeTz *value,
2768 bsl::streambuf *streamBuf,
2779 int *millisecondsSinceMidnight,
2792 int millisecondsSinceMidnight);
2813 bsl::streambuf *streamBuf,
2845 bsl::streambuf *streamBuf,
2877 bsl::streambuf *streamBuf,
3073 k_EXTENDED_BINARY_SERIAL_DATE_LENGTH = 3,
3075 k_EXTENDED_BINARY_DATETIME_LENGTH =
3077 k_EXTENDED_BINARY_SERIAL_DATE_LENGTH +
3082 k_EXTENDED_BINARY_DATETIMETZ_LENGTH =
3084 k_EXTENDED_BINARY_SERIAL_DATE_LENGTH +
3094 k_MAX_ISO8601_DATETIMETZ_LENGTH =
3100 k_MAX_COMPACT_BINARY_DATETIME_LENGTH = 6,
3105 k_MIN_COMPACT_BINARY_DATETIMETZ_LENGTH =
3106 k_MAX_COMPACT_BINARY_DATETIME_LENGTH + 1,
3111 k_MAX_COMPACT_BINARY_DATETIMETZ_LENGTH = 9
3127 static void datetimeToMillisecondsSinceEpoch(
3140 static int millisecondsSinceEpochToDatetime(
3153 unsigned char firstByte);
3164 bsl::streambuf *streamBuf,
3176 bsl::streambuf *streamBuf,
3188 static int getCompactBinaryDatetimeTzValue(
bdlt::Datetime *value,
3189 bsl::streambuf *streamBuf,
3202 bsl::streambuf *streamBuf,
3231 static int putIso8601DatetimeValue(bsl::streambuf *streamBuf,
3244 static int putCompactBinaryDatetimeValue(
3245 bsl::streambuf *streamBuf,
3258 static int putCompactBinaryDatetimeValue(
3259 bsl::streambuf *streamBuf,
3273 static int putCompactBinaryDatetimeTzValue(
3274 bsl::streambuf *streamBuf,
3287 static int putExtendedBinaryDatetimeValue(
3288 bsl::streambuf *streamBuf,
3299 static int detectDatetimeTzEncoding(
3302 unsigned char firstByte);
3314 bsl::streambuf *streamBuf,
3326 bsl::streambuf *streamBuf,
3339 bsl::streambuf *streamBuf,
3352 bsl::streambuf *streamBuf,
3374 static int putIso8601DatetimeTzValue(bsl::streambuf *streamBuf,
3391 static int putCompactBinaryDatetimeTzValue(
3392 bsl::streambuf *streamBuf,
3393 int timezoneOffsetInMinutes,
3395 int serialDatetimeLength,
3406 static int putExtendedBinaryDatetimeTzValue(
3407 bsl::streambuf *streamBuf,
3418 static int detectDatetimeOrDatetimeTzEncoding(
3421 unsigned char firstByte);
3433 bsl::streambuf *streamBuf,
3446 bsl::streambuf *streamBuf,
3459 bsl::streambuf *streamBuf,
3472 bsl::streambuf *streamBuf,
3484 bsl::streambuf *streamBuf,
3496 static int getExtendedBinaryDatetimeTzValue(
3498 bsl::streambuf *streamBuf,
3517 bsl::streambuf *streamBuf,
3549 bsl::streambuf *streamBuf,
3583 bsl::streambuf *streamBuf,
3662 template <
typename TYPE>
3665 bsl::streambuf *streamBuf,
3670 bsl::streambuf *streamBuf,
3675 bsl::streambuf *streamBuf,
3679 unsigned char *value,
3680 bsl::streambuf *streamBuf,
3685 bsl::streambuf *streamBuf,
3690 bsl::streambuf *streamBuf,
3695 bsl::streambuf *streamBuf,
3700 bsl::streambuf *streamBuf,
3705 bsl::streambuf *streamBuf,
3710 bsl::streambuf *streamBuf,
3715 bsl::streambuf *streamBuf,
3720 bsl::streambuf *streamBuf,
3725 bsl::streambuf *streamBuf,
3730 bsl::streambuf *streamBuf,
3735 bsl::streambuf *streamBuf,
3740 bsl::streambuf *streamBuf,
3745 bsl::streambuf *streamBuf,
3750 bsl::streambuf *streamBuf,
3815 template <
typename TYPE>
3816 static int putValue(bsl::streambuf *streamBuf,
3819 static int putValue(bsl::streambuf *streamBuf,
3822 static int putValue(bsl::streambuf *streamBuf,
3825 static int putValue(bsl::streambuf *streamBuf,
3826 unsigned char value,
3828 static int putValue(bsl::streambuf *streamBuf,
3831 static int putValue(bsl::streambuf *streamBuf,
3834 static int putValue(bsl::streambuf *streamBuf,
3837 static int putValue(bsl::streambuf *streamBuf,
3840 static int putValue(bsl::streambuf *streamBuf,
3843 static int putValue(bsl::streambuf *streamBuf,
3846 static int putValue(bsl::streambuf *streamBuf,
3849 static int putValue(bsl::streambuf *streamBuf,
3852 static int putValue(bsl::streambuf *streamBuf,
3855 static int putValue(bsl::streambuf *streamBuf,
3858 static int putValue(bsl::streambuf *streamBuf,
3861 static int putValue(bsl::streambuf *streamBuf,
3864 static int putValue(bsl::streambuf *streamBuf,
3903 int *accumNumBytesConsumed)
3912 int *accumNumBytesConsumed)
3915 result, accumNumBytesConsumed, streamBuf);
3918template <
class TYPE>
3926 value, streamBuf, length, options);
3929template <
typename TYPE>
3933 int *accumNumBytesConsumed,
3938 &length, accumNumBytesConsumed, streamBuf)) {
3946 *accumNumBytesConsumed += length;
3968template <
typename TYPE>
3985 const bsl::streambuf::int_type
byte = streamBuf->sgetc();
3986 if (bsl::streambuf::traits_type::eof() ==
byte) {
3990 *value = bsl::streambuf::traits_type::to_char_type(
byte);
3996 bsl::streambuf *streamBuf,
3999 const bsl::streamsize numCharsRead =
4000 streamBuf->sgetn(buffer,
static_cast<bsl::streamsize
>(bufferLength));
4002 if (numCharsRead !=
static_cast<bsl::streamsize
>(bufferLength)) {
4014 const bsl::streamsize numCharsWritten =
4015 streamBuf->sputn(buffer,
static_cast<bsl::streamsize
>(bufferLength));
4017 if (numCharsWritten != bufferLength) {
4029template <
typename TYPE>
4034 enum { k_BDEM_SUCCESS = 0, k_BDEM_FAILURE = -1 };
4037 return k_BDEM_FAILURE;
4040 static const bool isUnsigned = (TYPE(-1) > TYPE(0));
4042 if (isUnsigned && (
unsigned)length ==
sizeof(TYPE) + 1) {
4043 static const TYPE SGN_BIT =
static_cast<TYPE
>(
4044 static_cast<TYPE
>(1)
4050 if (!(value & SGN_BIT)) {
4051 return k_BDEM_FAILURE;
4054 if (0 != streamBuf->sputc(0)) {
4055 return k_BDEM_FAILURE;
4061 if (
static_cast<unsigned>(length) >
sizeof(TYPE)) {
4062 return k_BDEM_FAILURE;
4065#if BSLS_PLATFORM_IS_BIG_ENDIAN
4066 return length == streamBuf->sputn(
4067 static_cast<char *
>(
static_cast<void *
>(&value)) +
4068 sizeof(TYPE) - length,
4074 char *dst =
static_cast<char *
>(
static_cast<void *
>(&value)) + length;
4075 for (; length > 0; --length) {
4076 unsigned char c = *--dst;
4077 if (c != streamBuf->sputc(c)) {
4078 return k_BDEM_FAILURE;
4082 return k_BDEM_SUCCESS;
4095 bsl::streambuf *streamBuf,
4102 int intValue = streamBuf->sbumpc();
4103 if (bsl::streambuf::traits_type::eof() == intValue) {
4107 *value = 0 != intValue;
4128 BSLS_ASSERT(0 == *
static_cast<char *
>(
static_cast<void *
>(&value)) ||
4129 1 == *
static_cast<char *
>(
static_cast<void *
>(&value)));
4131 typedef bsl::streambuf::char_type char_type;
4137 if (
static_cast<int>(value) !=
4138 streamBuf->sputc(
static_cast<char_type
>(value ? 1 : 0))) {
4150template <
typename TYPE>
4153 int numBytes =
sizeof(TYPE);
4162 static const TYPE NEG_MASK =
static_cast<TYPE
>(
4163 static_cast<TYPE
>(0xff80)
4168 else if (value > 0) {
4169 static const TYPE SGN_BIT =
static_cast<TYPE
>(
4170 static_cast<TYPE
>(1)
4172 if (value & SGN_BIT) {
4179 return static_cast<int>(
sizeof(TYPE) + 1);
4185 static const TYPE POS_MASK = TYPE(~NEG_MASK);
4186 while ((value & POS_MASK) == value) {
4187 value =
static_cast<TYPE
>(value << 8);
4195 while ((value | NEG_MASK) == value) {
4196 value =
static_cast<TYPE
>(
4197 static_cast<unsigned long long>(value) << 8);
4209template <
typename TYPE>
4211 bsl::streambuf *streamBuf,
4214 enum { k_SUCCESS = 0, k_FAILURE = -1 };
4216 enum { k_SIGN_BIT_MASK = 0x80 };
4218 static const bool isUnsigned = (TYPE(-1) > TYPE(0));
4220 if (isUnsigned &&
static_cast<unsigned>(length) ==
sizeof(TYPE) + 1) {
4226 if (0 != streamBuf->sbumpc()) {
4235 if (
static_cast<unsigned>(length) >
sizeof(TYPE)) {
4241 *value =
static_cast<TYPE
>(streamBuf->sgetc() & k_SIGN_BIT_MASK ? -1 : 0);
4243 for (
int i = 0; i < length; ++i) {
4244 int nextOctet = streamBuf->sbumpc();
4245 if (bsl::streambuf::traits_type::eof() == nextOctet) {
4249 const unsigned long long mask =
4252 *value =
static_cast<TYPE
>((*value & mask)
4255 static_cast<TYPE
>(*value |
static_cast<unsigned char>(nextOctet));
4263 bsl::streambuf *streamBuf)
4291 byte0 + byte1 + byte2 + byte3 + byte4;
4298template <
typename TYPE>
4302 typedef bsl::streambuf::char_type char_type;
4305 if (length != streamBuf->sputc(
static_cast<char_type
>(length))) {
4312template <
typename TYPE>
4332 const char bytes[5] = {
4334 static_cast<unsigned char>((unsignedValue >> (8 * 4)) & 0xFF)),
4336 static_cast<unsigned char>((unsignedValue >> (8 * 3)) & 0xFF)),
4338 static_cast<unsigned char>((unsignedValue >> (8 * 2)) & 0xFF)),
4340 static_cast<unsigned char>((unsignedValue >> (8 * 1)) & 0xFF)),
4342 static_cast<unsigned char>((unsignedValue >> (8 * 0)) & 0xFF))};
4357 bsl::streambuf *streamBuf,
4365 if (0 != streamBuf->sbumpc()) {
4378 int valueOctet = streamBuf->sbumpc();
4379 if (bsl::streambuf::traits_type::eof() == valueOctet) {
4383 *value =
static_cast<char>(valueOctet);
4389 bsl::streambuf *streamBuf,
4397 *value =
static_cast<signed char>(temp);
4403 bsl::streambuf *streamBuf,
4411 *value =
static_cast<unsigned char>(temp);
4425 if (
static_cast<unsigned char>(value) != streamBuf->sputc(value)) {
4436 return putCharValue(streamBuf,
static_cast<char>(value));
4441 unsigned char value)
4444 static_cast<unsigned short>(value));
4457 bsl::streambuf *streamBuf,
4460 double tentativeValue;
4465 *value =
static_cast<float>(tentativeValue);
4474 bsl::streambuf *streamBuf,
4479 static_cast<double>(value),
4500 if (valueLength != streamBuf->sputn(value, valueLength)) {
4514 streamBuf, value.
data(),
static_cast<int>(value.
length()));
4521 bsl::streambuf *streamBuf,
4525 streamBuf, value.
data(),
static_cast<int>(value.
length()));
4532 bsl::streambuf *streamBuf,
4536 streamBuf, value.
data(),
static_cast<int>(value.
length()));
4544template <
class TYPE>
4545int BerUtil_Iso8601ImpUtil::getValue(TYPE *value,
4546 bsl::streambuf *streamBuf,
4573 const bsl::streamsize bytesConsumed = streamBuf->sgetn(buf, length);
4574 if (
static_cast<int>(bytesConsumed) != length) {
4581template <
class TYPE>
4582int BerUtil_Iso8601ImpUtil::putValue(bsl::streambuf *streamBuf,
4584 const BerEncoderOptions *options)
4588 int datetimeFractionalSecondPrecision =
4589 options ? options->datetimeFractionalSecondPrecision() : 6;
4616 const bool useMicrosecondPrecision =
4619 const bool compactBinaryEncodingOfValueIsBuggy = (
bdlt::Time() == value);
4628 const bool useExtendedBinaryEncodingIfAllowed =
4629 useMicrosecondPrecision || compactBinaryEncodingOfValueIsBuggy;
4631 const bool extendedBinaryEncodingIsAllowed =
4636 extendedBinaryEncodingIsAllowed;
4677: d_type(
Type::e_NOT_EXTENDED_BINARY)
4678, d_timezoneOffsetInMinutes(0)
4687 d_timezoneOffsetInMinutes = 0;
4694 d_timezoneOffsetInMinutes = 0;
4703 d_timezoneOffsetInMinutes = offset;
4729 return d_timezoneOffsetInMinutes;
4747 const bool bit0 = firstByte & 0x80;
4748 const bool bit1 = firstByte & 0x40;
4749 const bool bit2 = firstByte & 0x20;
4751 return bit0 && (bit1 || bit2);
4756 unsigned char firstByte)
4758 const bool bit0 = firstByte & 0x80;
4759 const bool bit1 = firstByte & 0x40;
4760 const bool bit2 = firstByte & 0x20;
4762 return bit0 && !(bit1 || bit2);
4767 unsigned char firstByte)
4769 const bool bit0 = firstByte & 0x80;
4770 const bool bit1 = firstByte & 0x40;
4771 const bool bit2 = firstByte & 0x20;
4772 const bool bit3 = firstByte & 0x10;
4774 return bit0 && !(bit1 || bit2) && !bit3;
4779 unsigned char firstByte)
4781 const bool bit0 = firstByte & 0x80;
4782 const bool bit1 = firstByte & 0x40;
4783 const bool bit2 = firstByte & 0x20;
4784 const bool bit3 = firstByte & 0x10;
4786 return bit0 && !(bit1 || bit2) && bit3;
4793 unsigned char firstByte)
4806 unsigned char firstByte)
4810 const bool bit0 = firstByte & 0x80;
4811 const bool bit3 = firstByte & 0x10;
4829 bsl::streambuf *streamBuf)
4831 char headerBytes[2];
4837 const unsigned char headerByte0 =
4838 static_cast<unsigned char>(headerBytes[0]);
4839 const unsigned char headerByte1 =
4840 static_cast<unsigned char>(headerBytes[1]);
4848 unsigned char headerByte0,
4849 unsigned char headerByte1)
4855 return getValue(value, headerByte0, headerByte1);
4860 bsl::streambuf *streamBuf)
4862 char headerBytes[2];
4868 const unsigned char headerByte0 =
4869 static_cast<unsigned char>(headerBytes[0]);
4870 const unsigned char headerByte1 =
4871 static_cast<unsigned char>(headerBytes[1]);
4873 return getValue(value, headerByte0, headerByte1);
4878 unsigned char headerByte0,
4879 unsigned char headerByte1)
4896 if ((headerByte0 & 0x0F) | (headerByte1 & 0xFF)) {
4904 enum { k_TIMEZONE_SIGN_BIT = 0x08 };
4911 const unsigned char timezoneOffsetHi =
4912 (headerByte0 & k_TIMEZONE_SIGN_BIT)
4913 ? ((0x0F & headerByte0) | 0xF0)
4914 : ((0x0F & headerByte0) | 0x00);
4916 const signed char signedTimezoneOffsetHi =
4917 static_cast<signed char>(timezoneOffsetHi);
4919 const unsigned char timezoneOffsetLo = headerByte1;
4921 const int timezoneOffset =
4922 (
static_cast<unsigned>(signedTimezoneOffsetHi) << 8) |
4923 (
static_cast<unsigned>(timezoneOffsetLo) << 0);
4935#if BSLA_UNREACHABLE_IS_ACTIVE
4944 bsl::streambuf *streamBuf)
4952 bsl::streambuf *streamBuf,
4953 int timezoneOffsetInMinutes)
4958 const unsigned short offsetWord =
4959 static_cast<unsigned short>(timezoneOffsetInMinutes);
4961 static const unsigned short k_OFFSET_MASK = 0x0FFF;
4963 const unsigned short headerWord = 0x9000 | (offsetWord & k_OFFSET_MASK);
4966 static_cast<char>((headerWord >> 8) & 0xFF),
4967 static_cast<char>((headerWord >> 0) & 0xFF)};
4981int BerUtil_DateImpUtil::detectDateEncoding(DateEncoding::Value *encoding,
4983 unsigned char firstByte)
4985 if (k_MAX_COMPACT_BINARY_DATE_LENGTH >= length) {
5005 const BerEncoderOptions *options)
5007 if (options && options->encodeDateAndTimeTypesAsBinary()) {
5017int BerUtil_DateImpUtil::detectDateTzEncoding(DateTzEncoding::Value *encoding,
5019 unsigned char firstByte)
5022 k_MIN_COMPACT_BINARY_DATETZ_LENGTH);
5024 if (k_MIN_COMPACT_BINARY_DATETZ_LENGTH > length) {
5029 if (k_MAX_COMPACT_BINARY_DATETZ_LENGTH >= length) {
5049 const BerEncoderOptions *options)
5051 if (options && options->encodeDateAndTimeTypesAsBinary() &&
5056 if (options && options->encodeDateAndTimeTypesAsBinary()) {
5066int BerUtil_DateImpUtil::detectDateOrDateTzEncoding(
5067 DateOrDateTzEncoding::Value *encoding,
5069 unsigned char firstByte)
5071 if (k_MAX_COMPACT_BINARY_DATE_LENGTH >= length) {
5078 if (k_MAX_COMPACT_BINARY_DATETZ_LENGTH >= length) {
5089 if (k_MAX_ISO8601_DATE_LENGTH >= length) {
5101int BerUtil_DateImpUtil::getIso8601DateValue(DateOrDateTz *value,
5102 bsl::streambuf *streamBuf,
5106 return getIso8601DateValue(&value->the<
bdlt::Date>(), streamBuf, length);
5110int BerUtil_DateImpUtil::getIso8601DateTzValue(DateOrDateTz *value,
5111 bsl::streambuf *streamBuf,
5115 return getIso8601DateTzValue(
5120int BerUtil_DateImpUtil::getCompactBinaryDateValue(DateOrDateTz *value,
5121 bsl::streambuf *streamBuf,
5125 return getCompactBinaryDateValue(
5126 &value->the<
bdlt::Date>(), streamBuf, length);
5130int BerUtil_DateImpUtil::getCompactBinaryDateTzValue(DateOrDateTz *value,
5131 bsl::streambuf *streamBuf,
5135 return getCompactBinaryDateTzValue(
5145 bsl::streambuf *streamBuf,
5154 int rc = detectDateOrDateTzEncoding(&encoding, length, firstByte);
5162 return getIso8601DateValue(value, streamBuf, length);
5165 return getIso8601DateTzValue(value, streamBuf, length);
5168 return getCompactBinaryDateValue(value, streamBuf, length);
5171 return getCompactBinaryDateTzValue(value, streamBuf, length);
5177#if BSLA_UNREACHABLE_IS_ACTIVE
5212 static_cast<int>(serialDate))) {
5220 &year, &month, &day,
static_cast<int>(serialDate));
5229int BerUtil_TimeImpUtil::detectTimeEncoding(TimeEncoding::Value *encoding,
5231 unsigned char firstByte)
5233 if (k_MAX_COMPACT_BINARY_TIME_LENGTH >= length) {
5254int BerUtil_TimeImpUtil::getIso8601TimeValue(
bdlt::Time *value,
5255 bsl::streambuf *streamBuf,
5266 const BerEncoderOptions *options)
5281int BerUtil_TimeImpUtil::putIso8601TimeValue(
5282 bsl::streambuf *streamBuf,
5284 const BerEncoderOptions *options)
5292int BerUtil_TimeImpUtil::detectTimeTzEncoding(TimeTzEncoding::Value *encoding,
5294 unsigned char firstByte)
5297 k_MIN_COMPACT_BINARY_TIMETZ_LENGTH);
5300 k_MAX_COMPACT_BINARY_TIMETZ_LENGTH);
5302 if (k_MAX_COMPACT_BINARY_TIME_LENGTH >= length) {
5307 if (k_MAX_COMPACT_BINARY_TIMETZ_LENGTH >= length) {
5312 BSLS_ASSERT(k_MAX_COMPACT_BINARY_TIMETZ_LENGTH < length);
5328int BerUtil_TimeImpUtil::getIso8601TimeTzValue(
bdlt::TimeTz *value,
5329 bsl::streambuf *streamBuf,
5340 const BerEncoderOptions *options)
5360int BerUtil_TimeImpUtil::putIso8601TimeTzValue(
5361 bsl::streambuf *streamBuf,
5363 const BerEncoderOptions *options)
5371int BerUtil_TimeImpUtil::detectTimeOrTimeTzEncoding(
5372 TimeOrTimeTzEncoding::Value *encoding,
5374 unsigned char firstByte)
5376 if (k_MAX_COMPACT_BINARY_TIME_LENGTH >= length) {
5381 if (k_MAX_COMPACT_BINARY_TIMETZ_LENGTH >= length) {
5400 if (k_MAX_ISO8601_TIME_LENGTH >= length) {
5410int BerUtil_TimeImpUtil::getIso8601TimeValue(TimeOrTimeTz *value,
5411 bsl::streambuf *streamBuf,
5415 return getIso8601TimeValue(&value->the<
bdlt::Time>(), streamBuf, length);
5419int BerUtil_TimeImpUtil::getIso8601TimeTzValue(TimeOrTimeTz *value,
5420 bsl::streambuf *streamBuf,
5424 return getIso8601TimeTzValue(
5429int BerUtil_TimeImpUtil::getCompactBinaryTimeValue(TimeOrTimeTz *value,
5430 bsl::streambuf *streamBuf,
5434 return getCompactBinaryTimeValue(
5435 &value->the<
bdlt::Time>(), streamBuf, length);
5439int BerUtil_TimeImpUtil::getCompactBinaryTimeTzValue(TimeOrTimeTz *value,
5440 bsl::streambuf *streamBuf,
5444 return getCompactBinaryTimeTzValue(
5449int BerUtil_TimeImpUtil::getExtendedBinaryTimeValue(TimeOrTimeTz *value,
5450 bsl::streambuf *streamBuf,
5454 return getExtendedBinaryTimeValue(
5455 &value->the<
bdlt::Time>(), streamBuf, length);
5459int BerUtil_TimeImpUtil::getExtendedBinaryTimeTzValue(
5460 TimeOrTimeTz *value,
5461 bsl::streambuf *streamBuf,
5465 return getExtendedBinaryTimeTzValue(
5475 int *millisecondsSinceMidnight,
5479 *millisecondsSinceMidnight =
5480 static_cast<int>((time - defaultTime).totalMilliseconds());
5491 *millisecondsSinceMidnight =
5492 static_cast<Int64
>(time.
hour()) * Ratio::k_MICROSECONDS_PER_HOUR +
5493 static_cast<Int64
>(time.
minute()) * Ratio::k_MICROSECONDS_PER_MINUTE +
5494 static_cast<Int64
>(time.
second()) * Ratio::k_MICROSECONDS_PER_SECOND +
5496 Ratio::k_MICROSECONDS_PER_MILLISECOND +
5503 int millisecondsSinceMidnight)
5507 static const int k_MIN_NUM_MILLISECONDS = 0;
5508 static const int k_MAX_NUM_MILLISECONDS =
5509 24 * Ratio::k_MILLISECONDS_PER_HOUR;
5511 if (k_MIN_NUM_MILLISECONDS > millisecondsSinceMidnight) {
5515 if (k_MAX_NUM_MILLISECONDS < millisecondsSinceMidnight) {
5519 const int serialTime = millisecondsSinceMidnight;
5521 const int hour = serialTime / Ratio::k_MILLISECONDS_PER_HOUR_32;
5524 (serialTime - hour * Ratio::k_MILLISECONDS_PER_HOUR_32) /
5525 Ratio::k_MILLISECONDS_PER_MINUTE_32;
5527 const int second = (serialTime - hour * Ratio::k_MILLISECONDS_PER_HOUR_32 -
5528 minute * Ratio::k_MILLISECONDS_PER_MINUTE_32) /
5529 Ratio::k_MILLISECONDS_PER_SECOND_32;
5531 const int millisecond =
5532 (serialTime - hour * Ratio::k_MILLISECONDS_PER_HOUR_32 -
5533 minute * Ratio::k_MILLISECONDS_PER_MINUTE_32 -
5534 second * Ratio::k_MILLISECONDS_PER_SECOND_32);
5536 time->
setTime(hour, minute, second, millisecond);
5549 24 * Ratio::k_MICROSECONDS_PER_HOUR;
5551 if (k_MIN_NUM_MICROSECONDS > microsecondsSinceMidnight) {
5555 if (k_MAX_NUM_MICROSECONDS < microsecondsSinceMidnight) {
5562 static_cast<int>(serialTime / Ratio::k_MICROSECONDS_PER_HOUR);
5565 static_cast<int>((serialTime - hour * Ratio::k_MICROSECONDS_PER_HOUR) /
5566 Ratio::k_MICROSECONDS_PER_MINUTE);
5569 static_cast<int>((serialTime - hour * Ratio::k_MICROSECONDS_PER_HOUR -
5570 minute * Ratio::k_MICROSECONDS_PER_MINUTE) /
5571 Ratio::k_MICROSECONDS_PER_SECOND);
5573 const int millisecond =
5574 static_cast<int>((serialTime - hour * Ratio::k_MICROSECONDS_PER_HOUR -
5575 minute * Ratio::k_MICROSECONDS_PER_MINUTE -
5576 second * Ratio::k_MICROSECONDS_PER_SECOND) /
5577 Ratio::k_MICROSECONDS_PER_MILLISECOND);
5579 const int microsecond =
static_cast<int>(
5580 (serialTime - hour * Ratio::k_MICROSECONDS_PER_HOUR -
5581 minute * Ratio::k_MICROSECONDS_PER_MINUTE -
5582 second * Ratio::k_MICROSECONDS_PER_SECOND -
5583 millisecond * Ratio::k_MICROSECONDS_PER_MILLISECOND));
5585 time->
setTime(hour, minute, second, millisecond, microsecond);
5593 bsl::streambuf *streamBuf,
5602 int rc = detectTimeEncoding(&encoding, length, firstByte);
5610 return getIso8601TimeValue(value, streamBuf, length);
5613 return getCompactBinaryTimeValue(value, streamBuf, length);
5616 return getExtendedBinaryTimeValue(value, streamBuf, length);
5621#if BSLA_UNREACHABLE_IS_ACTIVE
5635 switch (selectTimeEncoding(value, options)) {
5637 return putIso8601TimeValue(streamBuf, value, options);
5640 return putCompactBinaryTimeValue(streamBuf, value, options);
5644 return putExtendedBinaryTimeValue(streamBuf, value, options);
5650#if BSLA_UNREACHABLE_IS_ACTIVE
5661 bsl::streambuf *streamBuf,
5670 int rc = detectTimeTzEncoding(&encoding, length, firstByte);
5678 return getIso8601TimeTzValue(value, streamBuf, length);
5681 return getCompactBinaryTimeValue(value, streamBuf, length);
5684 return getCompactBinaryTimeTzValue(value, streamBuf, length);
5688 return getExtendedBinaryTimeTzValue(value, streamBuf, length);
5694#if BSLA_UNREACHABLE_IS_ACTIVE
5708 switch (selectTimeTzEncoding(value, options)) {
5710 return putIso8601TimeTzValue(streamBuf, value, options);
5713 return putCompactBinaryTimeValue(streamBuf, value, options);
5717 return putCompactBinaryTimeTzValue(streamBuf, value, options);
5721 return putExtendedBinaryTimeTzValue(streamBuf, value, options);
5727#if BSLA_UNREACHABLE_IS_ACTIVE
5738 bsl::streambuf *streamBuf,
5747 int rc = detectTimeOrTimeTzEncoding(&encoding, length, firstByte);
5755 return getIso8601TimeValue(value, streamBuf, length);
5758 return getIso8601TimeTzValue(value, streamBuf, length);
5761 return getCompactBinaryTimeValue(value, streamBuf, length);
5764 return getCompactBinaryTimeTzValue(value, streamBuf, length);
5768 return getExtendedBinaryTimeValue(value, streamBuf, length);
5771 return getExtendedBinaryTimeTzValue(value, streamBuf, length);
5777#if BSLA_UNREACHABLE_IS_ACTIVE
5793int BerUtil_DatetimeImpUtil::detectDatetimeEncoding(
5794 DatetimeEncoding::Value *encoding,
5796 unsigned char firstByte)
5798 if (k_MAX_COMPACT_BINARY_DATETIME_LENGTH >= length) {
5803 if (k_MAX_COMPACT_BINARY_DATETIMETZ_LENGTH >= length) {
5825BerUtil_DatetimeImpUtil::selectDatetimeEncoding(
5827 int *serialDatetimeLength,
5829 const BerEncoderOptions *options)
5838 datetimeToMillisecondsSinceEpoch(&serialDatetimeValue, value);
5840 const int serialDatetimeLengthValue =
5843 if (k_MIN_COMPACT_BINARY_DATETIMETZ_LENGTH <=
5844 serialDatetimeLengthValue) {
5845 *serialDatetime = serialDatetimeValue;
5846 *serialDatetimeLength = serialDatetimeLengthValue;
5850 *serialDatetime = serialDatetimeValue;
5851 *serialDatetimeLength = serialDatetimeLengthValue;
5861int BerUtil_DatetimeImpUtil::detectDatetimeTzEncoding(
5862 DatetimeTzEncoding::Value *encoding,
5864 unsigned char firstByte)
5866 if (k_MAX_COMPACT_BINARY_DATETIME_LENGTH >= length) {
5871 if (k_MAX_COMPACT_BINARY_DATETIMETZ_LENGTH >= length) {
5893BerUtil_DatetimeImpUtil::selectDatetimeTzEncoding(
5897 const BerEncoderOptions *options)
5906 datetimeToMillisecondsSinceEpoch(&serialDatetimeValue,
5909 const int lengthValue =
5912 if (0 == value.
offset() &&
5913 k_MIN_COMPACT_BINARY_DATETIMETZ_LENGTH > lengthValue) {
5914 *serialDatetime = serialDatetimeValue;
5915 *length = lengthValue;
5919 *serialDatetime = serialDatetimeValue;
5920 *length = lengthValue;
5930int BerUtil_DatetimeImpUtil::detectDatetimeOrDatetimeTzEncoding(
5931 DatetimeOrDatetimeTzEncoding::Value *encoding,
5933 unsigned char firstByte)
5937 if (k_MAX_COMPACT_BINARY_DATETIME_LENGTH >= length) {
5942 if (k_MAX_COMPACT_BINARY_DATETIMETZ_LENGTH >= length) {
5961 if (k_MAX_ISO8601_DATETIME_LENGTH >= length) {
5971int BerUtil_DatetimeImpUtil::getIso8601DatetimeValue(
5972 DatetimeOrDatetimeTz *value,
5973 bsl::streambuf *streamBuf,
5977 return getIso8601DatetimeValue(
5982int BerUtil_DatetimeImpUtil::getIso8601DatetimeTzValue(
5983 DatetimeOrDatetimeTz *value,
5984 bsl::streambuf *streamBuf,
5988 return getIso8601DatetimeTzValue(
5993int BerUtil_DatetimeImpUtil::getCompactBinaryDatetimeValue(
5994 DatetimeOrDatetimeTz *value,
5995 bsl::streambuf *streamBuf,
5999 return getCompactBinaryDatetimeValue(
6004int BerUtil_DatetimeImpUtil::getCompactBinaryDatetimeTzValue(
6005 DatetimeOrDatetimeTz *value,
6006 bsl::streambuf *streamBuf,
6010 return getCompactBinaryDatetimeTzValue(
6015int BerUtil_DatetimeImpUtil::getExtendedBinaryDatetimeValue(
6016 DatetimeOrDatetimeTz *value,
6017 bsl::streambuf *streamBuf,
6021 return getExtendedBinaryDatetimeValue(
6026int BerUtil_DatetimeImpUtil::getExtendedBinaryDatetimeTzValue(
6027 DatetimeOrDatetimeTz *value,
6028 bsl::streambuf *streamBuf,
6032 return getExtendedBinaryDatetimeTzValue(
6042 bsl::streambuf *streamBuf,
6058 switch (selectDatetimeEncoding(&serialDatetime, &length, value, options)) {
6060 return putIso8601DatetimeValue(streamBuf, value, options);
6063 return putCompactBinaryDatetimeValue(
6064 streamBuf, serialDatetime, length, options);
6067 return putCompactBinaryDatetimeTzValue(
6068 streamBuf, serialDatetime, length, options);
6071 return putExtendedBinaryDatetimeValue(streamBuf, value, options);
6077#if BSLA_UNREACHABLE_IS_ACTIVE
6088 bsl::streambuf *streamBuf,
6097 int rc = detectDatetimeEncoding(&encoding, length, firstByte);
6105 return getIso8601DatetimeValue(value, streamBuf, length);
6108 return getCompactBinaryDatetimeValue(value, streamBuf, length);
6112 return getCompactBinaryDatetimeTzValue(value, streamBuf, length);
6116 return getExtendedBinaryDatetimeValue(value, streamBuf, length);
6122#if BSLA_UNREACHABLE_IS_ACTIVE
6133 bsl::streambuf *streamBuf,
6153 int serialDatetimeLength;
6155 switch (selectDatetimeTzEncoding(
6156 &serialDatetime, &serialDatetimeLength, value, options)) {
6158 return putIso8601DatetimeTzValue(streamBuf, value, options);
6162 return putCompactBinaryDatetimeValue(
6163 streamBuf, serialDatetime, serialDatetimeLength, options);
6167 return putCompactBinaryDatetimeTzValue(streamBuf,
6170 serialDatetimeLength,
6175 return putExtendedBinaryDatetimeTzValue(streamBuf, value, options);
6181#if BSLA_UNREACHABLE_IS_ACTIVE
6192 bsl::streambuf *streamBuf,
6201 int rc = detectDatetimeTzEncoding(&encoding, length, firstByte);
6209 return getIso8601DatetimeTzValue(value, streamBuf, length);
6212 return getCompactBinaryDatetimeValue(value, streamBuf, length);
6216 return getCompactBinaryDatetimeTzValue(value, streamBuf, length);
6220 return getExtendedBinaryDatetimeTzValue(value, streamBuf, length);
6226#if BSLA_UNREACHABLE_IS_ACTIVE
6238 bsl::streambuf *streamBuf,
6247 int rc = detectDatetimeOrDatetimeTzEncoding(&encoding, length, firstByte);
6255 return getIso8601DatetimeValue(value, streamBuf, length);
6258 return getIso8601DatetimeTzValue(value, streamBuf, length);
6261 return getCompactBinaryDatetimeValue(value, streamBuf, length);
6265 return getCompactBinaryDatetimeTzValue(value, streamBuf, length);
6269 return getExtendedBinaryDatetimeValue(value, streamBuf, length);
6273 return getExtendedBinaryDatetimeTzValue(value, streamBuf, length);
6279#if BSLA_UNREACHABLE_IS_ACTIVE
6291template <
typename TYPE>
6293 bsl::streambuf *streamBuf,
6302 bsl::streambuf *streamBuf,
6311 bsl::streambuf *streamBuf,
6320 bsl::streambuf *streamBuf,
6329 bsl::streambuf *streamBuf,
6338 bsl::streambuf *streamBuf,
6347 bsl::streambuf *streamBuf,
6356 bsl::streambuf *streamBuf,
6365 bsl::streambuf *streamBuf,
6374 bsl::streambuf *streamBuf,
6383 bsl::streambuf *streamBuf,
6392 bsl::streambuf *streamBuf,
6401 bsl::streambuf *streamBuf,
6410 bsl::streambuf *streamBuf,
6419 bsl::streambuf *streamBuf,
6424 value, streamBuf, length);
6429 bsl::streambuf *streamBuf,
6438 bsl::streambuf *streamBuf,
6447 bsl::streambuf *streamBuf,
6459template <
class TYPE>
6485 unsigned char value,
6610 return StringUtil::putRawStringValue(streamBuf,
string, stringLength);
Definition balber_berdecoderoptions.h:76
Definition balber_berencoderoptions.h:73
bool encodeDateAndTimeTypesAsBinary() const
Definition balber_berencoderoptions.h:740
int datetimeFractionalSecondPrecision() const
Definition balber_berencoderoptions.h:746
int & bdeVersionConformance()
Definition balber_berencoderoptions.h:565
Definition balber_berutil.h:1515
void makeExtendedBinaryWithoutTimezone()
Definition balber_berutil.h:4691
BerUtil_DateAndTimeHeader & operator=(const BerUtil_DateAndTimeHeader &rhs)=default
BerUtil_DateAndTimeHeader()
Definition balber_berutil.h:4676
BerUtil_DateAndTimeHeader(const BerUtil_DateAndTimeHeader &original)=default
bool isExtendedBinaryWithoutTimezone() const
Definition balber_berutil.h:4715
~BerUtil_DateAndTimeHeader()=default
Destroy this object.
void makeExtendedBinaryWithTimezone(int offset)
Definition balber_berutil.h:4698
BerUtil_TimezoneOffsetImpUtil TimezoneUtil
Definition balber_berutil.h:1528
void makeNotExtendedBinary()
Definition balber_berutil.h:4684
bool isExtendedBinaryWithTimezone() const
Definition balber_berutil.h:4721
BerUtil_DateAndTimeHeaderType Type
Definition balber_berutil.h:1523
int timezoneOffsetInMinutes() const
Definition balber_berutil.h:4727
bool isExtendedBinary() const
Definition balber_berutil.h:4708
Definition bdlb_variant.h:2514
Definition bdldfp_decimal.h:1834
Definition bdlt_datetz.h:162
static bool isValid(const Date &localDate, int offset)
Definition bdlt_datetz.h:388
int offset() const
Definition bdlt_datetz.h:498
Date localDate() const
Definition bdlt_datetz.h:492
Definition bdlt_date.h:294
int day() const
Return the day of the month in the range [1 .. 31] of this date.
Definition bdlt_date.h:927
void setYearMonthDay(int year, int month, int day)
Definition bdlt_date.h:871
int addDaysIfValid(int numDays)
int year() const
Return the year in the range [1 .. 9999] of this date.
Definition bdlt_date.h:977
int month() const
Return the month of the year in the range [1 .. 12] of this date.
Definition bdlt_date.h:965
Definition bdlt_datetimetz.h:308
Datetime localDatetime() const
Definition bdlt_datetimetz.h:660
DateTz dateTz() const
Definition bdlt_datetimetz.h:654
TimeTz timeTz() const
Definition bdlt_datetimetz.h:672
int offset() const
Definition bdlt_datetimetz.h:666
Definition bdlt_datetime.h:331
Date date() const
Return the value of the "date" part of this object.
Definition bdlt_datetime.h:2164
Time time() const
Return the value of the "time" part of this object.
Definition bdlt_datetime.h:2275
Definition bdlt_iso8601utilconfiguration.h:225
void setFractionalSecondPrecision(int value)
Definition bdlt_timetz.h:190
Time localTime() const
Definition bdlt_timetz.h:518
static bool isValid(const Time &localTime, int offset)
Definition bdlt_timetz.h:408
Time utcTime() const
Definition bdlt_timetz.h:530
int offset() const
Return the time zone offset of this object in minutes from UTC.
Definition bdlt_timetz.h:524
Definition bdlt_time.h:196
void setTime(int hour, int minute=0, int second=0, int millisecond=0, int microsecond=0)
int microsecond() const
Return the value of the microsecond attribute of this time object.
Definition bdlt_time.h:905
static bool isValid(int hour, int minute=0, int second=0, int millisecond=0, int microsecond=0)
Definition bdlt_time.h:697
int second() const
Return the value of the second attribute of this time object.
Definition bdlt_time.h:928
int millisecond() const
Return the value of the millisecond attribute of this time object.
Definition bdlt_time.h:912
int minute() const
Return the value of the minute attribute of this time object.
Definition bdlt_time.h:920
int hour() const
Return the value of the hour attribute of this time object.
Definition bdlt_time.h:898
Definition bslstl_stringview.h:441
BSLS_KEYWORD_CONSTEXPR size_type length() const BSLS_KEYWORD_NOEXCEPT
Return the length of this view.
Definition bslstl_stringview.h:1685
BSLS_KEYWORD_CONSTEXPR const_pointer data() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_stringview.h:1760
Definition bslstl_string.h:1281
size_type length() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6601
CHAR_TYPE * data() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:6477
Definition bslstl_vector.h:1025
void resize(size_type newSize)
Definition bslstl_vector.h:3616
Definition bslstl_stringref.h:372
const CHAR_TYPE * data() const
Definition bslstl_stringref.h:936
size_type length() const
Definition bslstl_stringref.h:958
#define BSLA_UNREACHABLE
Definition bsla_unreachable.h:159
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_ASSERT_OPT(X)
Definition bsls_assert.h:1856
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition balber_berconstants.h:82
TagType
Definition balber_berconstants.h:113
TagClass
Definition balber_berconstants.h:92
Definition balber_berutil.h:581
static int getBoolValue(bool *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:4094
BerUtil_LengthImpUtil LengthUtil
Definition balber_berutil.h:588
static int putBoolValue(bsl::streambuf *streamBuf, bool value)
Definition balber_berutil.h:4115
Definition balber_berutil.h:752
static int putSignedCharValue(bsl::streambuf *streamBuf, signed char value)
Definition balber_berutil.h:4433
static int getCharValue(char *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:4356
BerUtil_IntegerImpUtil IntegerUtil
Definition balber_berutil.h:759
BerUtil_LengthImpUtil LengthUtil
Definition balber_berutil.h:764
static int putUnsignedCharValue(bsl::streambuf *streamBuf, unsigned char value)
Definition balber_berutil.h:4440
static int putCharValue(bsl::streambuf *streamBuf, char value)
Definition balber_berutil.h:4418
static int getUnsignedCharValue(unsigned char *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:4402
static int getSignedCharValue(signed char *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:4388
Definition balber_berutil.h:323
@ k_NUM_BITS_PER_OCTET
Definition balber_berutil.h:326
Definition balber_berutil.h:1400
@ k_EXTENDED_BINARY_MIN_BDE_VERSION
Definition balber_berutil.h:1424
Value
Definition balber_berutil.h:1403
@ e_ISO8601_TIMETZ
Definition balber_berutil.h:1409
@ e_COMPACT_BINARY_DATETZ
Definition balber_berutil.h:1411
@ e_COMPACT_BINARY_TIMETZ
Definition balber_berutil.h:1415
@ e_COMPACT_BINARY_DATETIME
Definition balber_berutil.h:1412
@ e_COMPACT_BINARY_DATE
Definition balber_berutil.h:1410
@ e_EXTENDED_BINARY_TIME
Definition balber_berutil.h:1418
@ e_ISO8601_DATE
Definition balber_berutil.h:1404
@ e_EXTENDED_BINARY_TIMETZ
Definition balber_berutil.h:1419
@ e_COMPACT_BINARY_DATETIMETZ
Definition balber_berutil.h:1413
@ e_ISO8601_TIME
Definition balber_berutil.h:1408
@ e_ISO8601_DATETIME
Definition balber_berutil.h:1406
@ e_EXTENDED_BINARY_DATETIME
Definition balber_berutil.h:1416
@ e_COMPACT_BINARY_TIME
Definition balber_berutil.h:1414
@ e_ISO8601_DATETZ
Definition balber_berutil.h:1405
@ e_EXTENDED_BINARY_DATETIMETZ
Definition balber_berutil.h:1417
@ e_ISO8601_DATETIMETZ
Definition balber_berutil.h:1407
Definition balber_berutil.h:1609
static bool isExtendedBinary(unsigned char firstByte)
Definition balber_berutil.h:4755
static void detectType(Type::Value *type, unsigned char firstByte)
Definition balber_berutil.h:4805
BerUtil_StreambufUtil StreambufUtil
Definition balber_berutil.h:1626
BerUtil_DateAndTimeHeaderType Type
Definition balber_berutil.h:1621
static bool isExtendedBinaryWithoutTimezone(unsigned char firstByte)
Definition balber_berutil.h:4766
static int putExtendedBinaryWithoutTimezoneValue(bsl::streambuf *streamBuf)
Definition balber_berutil.h:4943
BerUtil_TimezoneOffsetImpUtil TimezoneUtil
Definition balber_berutil.h:1631
static int putExtendedBinaryWithTimezoneValue(bsl::streambuf *streamBuf, int timezoneOffsetInMinutes)
Definition balber_berutil.h:4951
BerUtil_DateAndTimeHeader Header
Definition balber_berutil.h:1616
static bool isReserved(unsigned char firstByte)
Definition balber_berutil.h:4738
static const int k_HEADER_LENGTH
Number of octets used to encode an extended-binary-encoding header.
Definition balber_berutil.h:1636
static void detectTypeIfNotReserved(bool *reserved, Type::Value *type, unsigned char firstByte)
Definition balber_berutil.h:4790
static int getValue(Header *value, bsl::streambuf *streamBuf)
Definition balber_berutil.h:4859
static int getValueIfNotReserved(Header *value, bsl::streambuf *streamBuf)
Definition balber_berutil.h:4827
static bool isExtendedBinaryWithTimezone(unsigned char firstByte)
Definition balber_berutil.h:4778
Definition balber_berutil.h:1481
Value
Definition balber_berutil.h:1484
@ e_EXTENDED_BINARY_WITH_TIMEZONE
Definition balber_berutil.h:1495
@ e_EXTENDED_BINARY_WITHOUT_TIMEZONE
Definition balber_berutil.h:1490
@ e_NOT_EXTENDED_BINARY
Definition balber_berutil.h:1485
Definition balber_berutil.h:1753
Value
Definition balber_berutil.h:1762
@ e_COMPACT_BINARY_DATE
Definition balber_berutil.h:1764
@ e_ISO8601_DATE
Definition balber_berutil.h:1763
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:1760
Definition balber_berutil.h:1834
BerUtil_DateTzEncoding DateTzEncoding
Definition balber_berutil.h:1852
bdlb::Variant2< bdlt::Date, bdlt::DateTz > DateOrDateTz
Definition balber_berutil.h:1891
BerUtil_Iso8601ImpUtil Iso8601Util
Definition balber_berutil.h:1867
@ k_COMPACT_BINARY_DATE_EPOCH
Definition balber_berutil.h:1894
BerUtil_StringImpUtil StringUtil
Definition balber_berutil.h:1882
static int putDateTzValue(bsl::streambuf *streamBuf, const bdlt::DateTz &date, const BerEncoderOptions *options)
static int getDateOrDateTzValue(DateOrDateTz *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:5144
static int daysSinceEpochToDate(bdlt::Date *date, bsls::Types::Int64 daysSinceEpoch)
Definition balber_berutil.h:5204
BerUtil_TimezoneOffsetImpUtil TimezoneUtil
Definition balber_berutil.h:1887
BerUtil_DateAndTimeHeaderImpUtil DateAndTimeHeaderUtil
Definition balber_berutil.h:1842
static int getDateTzValue(bdlt::DateTz *value, bsl::streambuf *streamBuf, int length)
BerUtil_LengthImpUtil LengthUtil
Definition balber_berutil.h:1872
BerUtil_IntegerImpUtil IntegerUtil
Definition balber_berutil.h:1862
BerUtil_StreambufUtil StreambufUtil
Definition balber_berutil.h:1877
static int getDateValue(bdlt::Date *date, bsl::streambuf *streamBuf, int length)
static void dateToDaysSinceEpoch(bsls::Types::Int64 *daysSinceEpoch, const bdlt::Date &date)
Definition balber_berutil.h:5193
BerUtil_DateOrDateTzEncoding DateOrDateTzEncoding
Definition balber_berutil.h:1857
BerUtil_DateEncoding DateEncoding
Definition balber_berutil.h:1847
static int putDateValue(bsl::streambuf *streamBuf, const bdlt::Date &value, const BerEncoderOptions *options)
Definition balber_berutil.h:1798
Value
Definition balber_berutil.h:1807
@ e_COMPACT_BINARY_DATETZ
Definition balber_berutil.h:1811
@ e_COMPACT_BINARY_DATE
Definition balber_berutil.h:1810
@ e_ISO8601_DATETZ
Definition balber_berutil.h:1809
@ e_ISO8601_DATE
Definition balber_berutil.h:1808
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:1805
Definition balber_berutil.h:1775
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:1782
Value
Definition balber_berutil.h:1784
@ e_COMPACT_BINARY_DATETZ
Definition balber_berutil.h:1787
@ e_COMPACT_BINARY_DATE
Definition balber_berutil.h:1786
@ e_ISO8601_DATETZ
Definition balber_berutil.h:1785
Definition balber_berutil.h:2888
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:2895
@ k_EXTENDED_BINARY_MIN_BDE_VERSION
Definition balber_berutil.h:2905
Value
Definition balber_berutil.h:2897
@ e_COMPACT_BINARY_DATETIME
Definition balber_berutil.h:2899
@ e_EXTENDED_BINARY_DATETIME
Definition balber_berutil.h:2901
@ e_ISO8601_DATETIME
Definition balber_berutil.h:2898
@ e_COMPACT_BINARY_DATETIMETZ
Definition balber_berutil.h:2900
Definition balber_berutil.h:2985
static int getDatetimeTzValue(bdlt::DatetimeTz *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:6191
BerUtil_DateAndTimeHeader DateAndTimeHeader
Definition balber_berutil.h:3003
BerUtil_DatetimeEncoding DatetimeEncoding
Definition balber_berutil.h:3018
static int getDatetimeOrDatetimeTzValue(DatetimeOrDatetimeTz *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:6236
BerUtil_ExtendedBinaryEncodingUtil ExtendedBinaryEncodingUtil
Definition balber_berutil.h:2998
static int putDatetimeValue(bsl::streambuf *streamBuf, const bdlt::Datetime &value, const BerEncoderOptions *options)
Definition balber_berutil.h:6041
BerUtil_LengthImpUtil LengthUtil
Definition balber_berutil.h:3044
bdlb::Variant2< bdlt::Datetime, bdlt::DatetimeTz > DatetimeOrDatetimeTz
Definition balber_berutil.h:3068
BerUtil_Constants Constants
Definition balber_berutil.h:2992
BerUtil_DatetimeTzEncoding DatetimeTzEncoding
Definition balber_berutil.h:3023
BerUtil_Iso8601ImpUtil Iso8601Util
Definition balber_berutil.h:3039
static int putDatetimeTzValue(bsl::streambuf *streamBuf, const bdlt::DatetimeTz &value, const BerEncoderOptions *options)
Definition balber_berutil.h:6132
BerUtil_DateImpUtil DateUtil
Definition balber_berutil.h:3013
BerUtil_IntegerImpUtil IntegerUtil
Definition balber_berutil.h:3034
BerUtil_DatetimeOrDatetimeTzEncoding DatetimeOrDatetimeTzEncoding
Definition balber_berutil.h:3029
BerUtil_DateAndTimeHeaderImpUtil DateAndTimeHeaderUtil
Definition balber_berutil.h:3009
static int getDatetimeValue(bdlt::Datetime *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:6087
BerUtil_StreambufUtil StreambufUtil
Definition balber_berutil.h:3049
BerUtil_StringImpUtil StringUtil
Definition balber_berutil.h:3054
BerUtil_TimezoneOffsetImpUtil TimezoneUtil
Definition balber_berutil.h:3063
BerUtil_TimeImpUtil TimeUtil
Definition balber_berutil.h:3058
Definition balber_berutil.h:2946
Value
Definition balber_berutil.h:2955
@ e_EXTENDED_BINARY_DATETIMETZ
Definition balber_berutil.h:2961
@ e_EXTENDED_BINARY_DATETIME
Definition balber_berutil.h:2960
@ e_COMPACT_BINARY_DATETIMETZ
Definition balber_berutil.h:2959
@ e_ISO8601_DATETIMETZ
Definition balber_berutil.h:2957
@ e_COMPACT_BINARY_DATETIME
Definition balber_berutil.h:2958
@ e_ISO8601_DATETIME
Definition balber_berutil.h:2956
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:2953
Definition balber_berutil.h:2917
Value
Definition balber_berutil.h:2926
@ e_EXTENDED_BINARY_DATETIMETZ
Definition balber_berutil.h:2930
@ e_COMPACT_BINARY_DATETIME
Definition balber_berutil.h:2928
@ e_COMPACT_BINARY_DATETIMETZ
Definition balber_berutil.h:2929
@ e_ISO8601_DATETIMETZ
Definition balber_berutil.h:2927
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:2924
@ k_EXTENDED_BINARY_MIN_BDE_VERSION
Definition balber_berutil.h:2934
Definition balber_berutil.h:1440
static bool useExtendedBinaryEncoding(const bdlt::Time &value, const BerEncoderOptions *options)
Definition balber_berutil.h:4603
static bool useBinaryEncoding(const BerEncoderOptions *options)
Definition balber_berutil.h:4664
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:1447
Definition balber_berutil.h:859
BerUtil_LengthImpUtil LengthUtil
Definition balber_berutil.h:871
static int putDoubleValue(bsl::streambuf *streamBuf, double value, const BerEncoderOptions *options=0)
static int putFloatValue(bsl::streambuf *streamBuf, float value, const BerEncoderOptions *options=0)
Definition balber_berutil.h:4473
static int putDecimal64Value(bsl::streambuf *streamBuf, bdldfp::Decimal64 value)
static int getDecimal64Value(bdldfp::Decimal64 *value, bsl::streambuf *streamBuf, int length)
static int getDoubleValue(double *value, bsl::streambuf *streamBuf, int length)
BerUtil_IntegerImpUtil IntegerUtil
Definition balber_berutil.h:866
static int getFloatValue(float *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:4456
Definition balber_berutil.h:3596
BerUtil_CharacterImpUtil CharacterUtil
Definition balber_berutil.h:3608
bdlb::Variant2< bdlt::Datetime, bdlt::DatetimeTz > DatetimeOrDatetimeTz
Definition balber_berutil.h:3647
bdlb::Variant2< bdlt::Date, bdlt::DateTz > DateOrDateTz
Definition balber_berutil.h:3642
BerUtil_DatetimeImpUtil DatetimeUtil
Definition balber_berutil.h:3618
bdlb::Variant2< bdlt::Time, bdlt::TimeTz > TimeOrTimeTz
Definition balber_berutil.h:3651
BerUtil_FloatingPointImpUtil FloatingPointUtil
Definition balber_berutil.h:3623
BerUtil_BooleanImpUtil BooleanUtil
Definition balber_berutil.h:3603
BerUtil_IntegerImpUtil IntegerUtil
Definition balber_berutil.h:3628
static int getValue(DatetimeOrDatetimeTz *value, bsl::streambuf *streamBuf, int length, const BerDecoderOptions &options=BerDecoderOptions())
BerUtil_StringImpUtil StringUtil
Definition balber_berutil.h:3633
BerUtil_TimeImpUtil TimeUtil
Definition balber_berutil.h:3638
BerUtil_DateImpUtil DateUtil
Definition balber_berutil.h:3613
static int getValue(TYPE *value, bsl::streambuf *streamBuf, int length, const BerDecoderOptions &options=BerDecoderOptions())
Definition balber_berutil.h:6292
static int getValue(TimeOrTimeTz *value, bsl::streambuf *streamBuf, int length, const BerDecoderOptions &options=BerDecoderOptions())
Definition balber_berutil.h:380
BerUtil_Constants Constants
Definition balber_berutil.h:387
static int putIdentifierOctets(bsl::streambuf *streamBuf, BerConstants::TagClass tagClass, BerConstants::TagType tagType, int tagNumber)
static int getIdentifierOctets(BerConstants::TagClass *tagClass, BerConstants::TagType *tagType, int *tagNumber, int *accumNumBytesConsumed, bsl::streambuf *streamBuf)
Definition balber_berutil.h:3876
static int putStringValue(bsl::streambuf *streamBuf, const char *string, int stringLength)
Definition balber_berutil.h:6605
Definition balber_berutil.h:624
static int get40BitIntegerValue(bsls::Types::Int64 *value, bsl::streambuf *streamBuf)
Definition balber_berutil.h:4262
BerUtil_Constants Constants
Definition balber_berutil.h:631
static int putIntegerValue(bsl::streambuf *streamBuf, INTEGRAL_TYPE value)
static int getIntegerValue(INTEGRAL_TYPE *value, bsl::streambuf *streamBuf, int length)
BerUtil_StreambufUtil StreambufUtil
Definition balber_berutil.h:646
static int getIntegerValue(long long *value, bsl::streambuf *streamBuf, int length)
static int getNumOctetsToStream(int value)
static int getNumOctetsToStream(long long value)
BerUtil_RawIntegerImpUtil RawIntegerUtil
Definition balber_berutil.h:641
static int getNumOctetsToStream(INTEGRAL_TYPE value)
static int putIntegerGivenLength(bsl::streambuf *streamBuf, INTEGRAL_TYPE value, int length)
static int put40BitIntegerValue(bsl::streambuf *streamBuf, bsls::Types::Int64 value)
Definition balber_berutil.h:4324
BerUtil_LengthImpUtil LengthImpUtil
Definition balber_berutil.h:636
static int getNumOctetsToStream(short value)
static const int k_40_BIT_INTEGER_LENGTH
Number of octets used to encode a signed integer value in 40 bits.
Definition balber_berutil.h:651
Definition balber_berutil.h:1148
static int getDatetimeValue(bdlt::Datetime *value, bsl::streambuf *streamBuf, int length)
static int getDateTzValue(bdlt::DateTz *value, bsl::streambuf *streamBuf, int length)
static int getDatetimeTzValue(bdlt::DatetimeTz *value, bsl::streambuf *streamBuf, int length)
static int putDatetimeTzValue(bsl::streambuf *streamBuf, const bdlt::DatetimeTz &value, const BerEncoderOptions *options)
static int getTimeTzValue(bdlt::TimeTz *value, bsl::streambuf *streamBuf, int length)
static int putTimeValue(bsl::streambuf *streamBuf, const bdlt::Time &value, const BerEncoderOptions *options)
static int putDateTzValue(bsl::streambuf *streamBuf, const bdlt::DateTz &value, const BerEncoderOptions *options)
BerUtil_StringImpUtil StringUtil
Definition balber_berutil.h:1155
static int putTimeTzValue(bsl::streambuf *streamBuf, const bdlt::TimeTz &value, const BerEncoderOptions *options)
static int getDateValue(bdlt::Date *value, bsl::streambuf *streamBuf, int length)
static int getTimeValue(bdlt::Time *value, bsl::streambuf *streamBuf, int length)
static int putDatetimeValue(bsl::streambuf *streamBuf, const bdlt::Datetime &value, const BerEncoderOptions *options)
static int putDateValue(bsl::streambuf *streamBuf, const bdlt::Date &value, const BerEncoderOptions *options)
Definition balber_berutil.h:493
static int putIndefiniteLengthOctet(bsl::streambuf *streamBuf)
static int getEndOfContentOctets(int *accumNumBytesConsumed, bsl::streambuf *streamBuf)
BerUtil_RawIntegerImpUtil RawIntegerUtil
Definition balber_berutil.h:504
BerUtil_Constants Constants
Definition balber_berutil.h:500
static int putEndOfContentOctets(bsl::streambuf *streamBuf)
static int getLength(int *result, int *accumNumBytesConsumed, bsl::streambuf *streamBuf)
static int putLength(bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:3764
BerUtil_BooleanImpUtil BooleanUtil
Definition balber_berutil.h:3771
BerUtil_TimeImpUtil TimeUtil
Definition balber_berutil.h:3806
BerUtil_FloatingPointImpUtil FloatingPointUtil
Definition balber_berutil.h:3791
BerUtil_DatetimeImpUtil DatetimeUtil
Definition balber_berutil.h:3786
BerUtil_DateImpUtil DateUtil
Definition balber_berutil.h:3781
static int putValue(bsl::streambuf *streamBuf, const TYPE &value, const BerEncoderOptions *options)
Definition balber_berutil.h:6460
BerUtil_StringImpUtil StringUtil
Definition balber_berutil.h:3801
BerUtil_IntegerImpUtil IntegerUtil
Definition balber_berutil.h:3796
BerUtil_CharacterImpUtil CharacterUtil
Definition balber_berutil.h:3776
Definition balber_berutil.h:462
static int putIntegerGivenLength(bsl::streambuf *streamBuf, INTEGRAL_TYPE value, int length)
BerUtil_Constants Constants
Definition balber_berutil.h:469
Definition balber_berutil.h:337
static int putChars(bsl::streambuf *streamBuf, const char *buffer, int bufferLength)
Definition balber_berutil.h:4010
static int peekChar(char *value, bsl::streambuf *streamBuf)
Definition balber_berutil.h:3983
static int getChars(char *buffer, bsl::streambuf *streamBuf, int bufferLength)
Definition balber_berutil.h:3995
Definition balber_berutil.h:1046
static int putStringViewValue(bsl::streambuf *streamBuf, const bsl::string_view &value)
Definition balber_berutil.h:4520
static int putChars(bsl::streambuf *streamBuf, char value, int numChars)
static int putStringRefValue(bsl::streambuf *streamBuf, const bslstl::StringRef &value)
Definition balber_berutil.h:4531
static int putRawStringValue(bsl::streambuf *streamBuf, const char *string, int stringLength)
Definition balber_berutil.h:4492
static int getStringValue(bsl::string *value, bsl::streambuf *streamBuf, int length, const BerDecoderOptions &options)
BerUtil_LengthImpUtil LengthUtil
Definition balber_berutil.h:1053
static int putStringValue(bsl::streambuf *streamBuf, const bsl::string &value)
Definition balber_berutil.h:4510
Definition balber_berutil.h:2261
@ k_EXTENDED_BINARY_MIN_BDE_VERSION
Definition balber_berutil.h:2277
Value
Definition balber_berutil.h:2270
@ e_ISO8601_TIME
Definition balber_berutil.h:2271
@ e_COMPACT_BINARY_TIME
Definition balber_berutil.h:2272
@ e_EXTENDED_BINARY_TIME
Definition balber_berutil.h:2273
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:2268
Definition balber_berutil.h:2356
BerUtil_DateAndTimeHeaderImpUtil DateAndTimeHeaderUtil
Definition balber_berutil.h:2380
BerUtil_DateAndTimeHeaderType DateAndTimeHeaderType
Definition balber_berutil.h:2374
static int getTimeOrTimeTzValue(TimeOrTimeTz *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:5737
BerUtil_StringImpUtil StringUtil
Definition balber_berutil.h:2400
static void timeToMicrosecondsSinceMidnight(bsls::Types::Int64 *microsecondsSinceMidnight, const bdlt::Time &time)
Definition balber_berutil.h:5484
BerUtil_TimeTzEncoding TimeTzEncoding
Definition balber_berutil.h:2415
BerUtil_StreambufUtil StreambufUtil
Definition balber_berutil.h:2405
static int getTimeTzValue(bdlt::TimeTz *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:5660
BerUtil_TimeOrTimeTzEncoding TimeOrTimeTzEncoding
Definition balber_berutil.h:2420
static int microsecondsSinceMidnightToTime(bdlt::Time *time, bsls::Types::Int64 microsecondsSinceMidnight)
Definition balber_berutil.h:5541
static void timeToMillisecondsSinceMidnight(int *millisecondsSinceMidnight, const bdlt::Time &time)
Definition balber_berutil.h:5474
BerUtil_IntegerImpUtil IntegerUtil
Definition balber_berutil.h:2385
static int putTimeValue(bsl::streambuf *streamBuf, const bdlt::Time &value, const BerEncoderOptions *options)
Definition balber_berutil.h:5631
bdlb::Variant2< bdlt::Time, bdlt::TimeTz > TimeOrTimeTz
Definition balber_berutil.h:2429
BerUtil_TimezoneOffsetImpUtil TimezoneUtil
Definition balber_berutil.h:2425
BerUtil_ExtendedBinaryEncodingUtil ExtendedBinaryEncodingUtil
Definition balber_berutil.h:2364
static int putTimeTzValue(bsl::streambuf *streamBuf, const bdlt::TimeTz &value, const BerEncoderOptions *options)
Definition balber_berutil.h:5704
static int millisecondsSinceMidnightToTime(bdlt::Time *time, int millisecondsSinceMidnight)
Definition balber_berutil.h:5501
BerUtil_Iso8601ImpUtil Iso8601Util
Definition balber_berutil.h:2390
BerUtil_LengthImpUtil LengthUtil
Definition balber_berutil.h:2395
BerUtil_TimeEncoding TimeEncoding
Definition balber_berutil.h:2410
static int getTimeValue(bdlt::Time *value, bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:5592
BerUtil_DateAndTimeHeader DateAndTimeHeader
Definition balber_berutil.h:2369
Definition balber_berutil.h:2318
Value
Definition balber_berutil.h:2327
@ e_COMPACT_BINARY_TIME
Definition balber_berutil.h:2330
@ e_ISO8601_TIME
Definition balber_berutil.h:2328
@ e_COMPACT_BINARY_TIMETZ
Definition balber_berutil.h:2331
@ e_EXTENDED_BINARY_TIME
Definition balber_berutil.h:2332
@ e_ISO8601_TIMETZ
Definition balber_berutil.h:2329
@ e_EXTENDED_BINARY_TIMETZ
Definition balber_berutil.h:2333
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:2325
Definition balber_berutil.h:2289
BerUtil_DateAndTimeEncoding Encoding
Definition balber_berutil.h:2296
@ k_EXTENDED_BINARY_MIN_BDE_VERSION
Definition balber_berutil.h:2306
Value
Definition balber_berutil.h:2298
@ e_COMPACT_BINARY_TIMETZ
Definition balber_berutil.h:2301
@ e_COMPACT_BINARY_TIME
Definition balber_berutil.h:2300
@ e_ISO8601_TIMETZ
Definition balber_berutil.h:2299
@ e_EXTENDED_BINARY_TIMETZ
Definition balber_berutil.h:2302
Definition balber_berutil.h:1349
static int putTimezoneOffsetInMinutes(bsl::streambuf *streamBuf, int value)
@ k_TIMEZONE_LENGTH
Definition balber_berutil.h:1359
@ k_MIN_OFFSET
Definition balber_berutil.h:1353
@ k_MAX_OFFSET
Definition balber_berutil.h:1356
static int getTimezoneOffsetInMinutes(int *value, bsl::streambuf *streamBuf)
static bool isValidTimezoneOffsetInMinutes(int value)
static int getTimezoneOffsetInMinutesIfValid(int *value, bsl::streambuf *streamBuf)
Definition balber_berutil.h:196
static int putEndOfContentOctets(bsl::streambuf *streamBuf)
Definition balber_berutil.h:3951
static int getIdentifierOctets(bsl::streambuf *streamBuf, BerConstants::TagClass *tagClass, BerConstants::TagType *tagType, int *tagNumber, int *accumNumBytesConsumed)
static int getValue(bsl::streambuf *streamBuf, TYPE *value, int length, const BerDecoderOptions &options=BerDecoderOptions())
Definition balber_berutil.h:3920
static int putLength(bsl::streambuf *streamBuf, int length)
Definition balber_berutil.h:3963
static int getLength(bsl::streambuf *streamBuf, int *result, int *accumNumBytesConsumed)
Definition balber_berutil.h:3910
static int putIndefiniteLengthOctet(bsl::streambuf *streamBuf)
Definition balber_berutil.h:3957
static int putValue(bsl::streambuf *streamBuf, const TYPE &value, const BerEncoderOptions *options=0)
Definition balber_berutil.h:3970
static int putIdentifierOctets(bsl::streambuf *streamBuf, BerConstants::TagClass tagClass, BerConstants::TagType tagType, int tagNumber)
static int getEndOfContentOctets(bsl::streambuf *streamBuf, int *accumNumBytesConsumed)
Definition balber_berutil.h:3902
@ BDEM_INDEFINITE_LENGTH
Definition balber_berutil.h:204
@ INDEFINITE_LENGTH
Definition balber_berutil.h:205
@ k_INDEFINITE_LENGTH
Definition balber_berutil.h:199
@ k_DATETZ_STRLEN
Definition bdlt_iso8601util.h:751
@ k_DATE_STRLEN
Definition bdlt_iso8601util.h:750
@ k_TIME_STRLEN
Definition bdlt_iso8601util.h:753
@ k_DATETIMETZ_STRLEN
Definition bdlt_iso8601util.h:757
@ k_MAX_STRLEN
Definition bdlt_iso8601util.h:761
@ k_TIMETZ_STRLEN
Definition bdlt_iso8601util.h:754
@ k_DATETIME_STRLEN
Definition bdlt_iso8601util.h:756
static int parse(bsls::TimeInterval *result, const char *string, ssize_t length)
static int generate(char *buffer, ssize_t bufferLength, const bsls::TimeInterval &object)
Definition bdlt_iso8601util.h:1967
static bool isValidSerial(int serialDay)
Definition bdlt_prolepticdateimputil.h:633
static void serialToYmd(int *year, int *month, int *day, int serialDay)
static int ymdToSerial(int year, int month, int day)
Definition bdlt_timeunitratio.h:199
unsigned long long Uint64
Definition bsls_types.h:137
long long Int64
Definition bsls_types.h:132