BloombergLP::balber::BerUtil_IntegerImpUtil

This component-private utility struct provides a namespace for a suite of functions used by BerUtil to implement BER encoding and decoding operations for integer values. Within the definition of this struct:

Synopsis

Declared in <balber_berutil.h>

struct BerUtil_IntegerImpUtil;

Description

* the specification: > Refers to the August 2015 revision of the ITU-T Recommendation X.690.

Type Aliases

NameDescription
Constants Constants is an alias to a namespace for a suite of general-purpose constants that occur when encoding or decoding BER data.
LengthImpUtil LengthUtil is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for length quantities.
RawIntegerUtil RawIntegerUtil is an alias to a namespace for a suite of low-level functions used to implement BER encoding operations for integer 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.

Static Member Functions

NameDescription
get40BitIntegerValue Read 5 bytes from the input sequence of the specified streamBuf and load to the specified value the interpretation of those bytes as a 40-bit, signed, 2's-complement, big-endian integer. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all 5 bytes are successfully read from the input sequence of the streamBuf without the read position becoming unavailable, and the bytes read contain a valid representation of a 40-bit, signed, 2's-complement, big-endian integer.
getIntegerValue getIntegerValue overloads
getNumOctetsToStream getNumOctetsToStream overloads
put40BitIntegerValue Write the 5 octets that comprise the 40-bit, signed, 2's-complement, bit-endian representation of the specified integer value to the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all bytes corresponding to the representation of the value are written to the streamBuf without the write position becoming unavailable. The behavior is undefined unless the value is in the half-open interval [-549755813888, 549755813888)].
putIntegerGivenLength Write exactly the specified length number of contents octets of the BER encoding of the specified integer value (as defined in the specification) to the output sequence of the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all bytes corresponding to the contents octets are written to the streamBuf without the write position becoming unavailable. The behavior is undefined unless there are exactly length number of contents octets used to encode the integer value according to the specification. The program is ill-formed unless the specified INTEGRAL_TYPE is a fundamental integral type.
putIntegerValue Write the length and contents octets of the BER encoding of the specified integer value (as defined in the specification) to the output sequence of the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all bytes corresponding to the length and contents octets are written to the streamBuf without the write position becoming unavailable. The program is ill-formed unless the specified INTEGRAL_TYPE is a fundamental integral type.

Static Data Members

NameDescription
k_40_BIT_INTEGER_LENGTH Number of octets used to encode a signed integer value in 40 bits.