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

#include <balber_berutil.h>

Public Types

typedef BerUtil_IntegerImpUtil IntegerUtil
 
typedef BerUtil_LengthImpUtil LengthUtil
 

Static Public Member Functions

static int getFloatValue (float *value, bsl::streambuf *streamBuf, int length)
 
static int getDoubleValue (double *value, bsl::streambuf *streamBuf, int length)
 
static int getDecimal64Value (bdldfp::Decimal64 *value, bsl::streambuf *streamBuf, int length)
 
static int putFloatValue (bsl::streambuf *streamBuf, float value, const BerEncoderOptions *options=0)
 
static int putDoubleValue (bsl::streambuf *streamBuf, double value, const BerEncoderOptions *options=0)
 
static int putDecimal64Value (bsl::streambuf *streamBuf, bdldfp::Decimal64 value)
 

Detailed Description

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

: the specification: : Refers to the August 2015 revision of the ITU-T Recommendation X.690, : and : : the floating point specification: : Refers to the 2008 revision of the IEE 754 Standard for : Floating-Point Arithemtic.

Member Typedef Documentation

◆ IntegerUtil

IntegerUtil is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for integer values.

◆ LengthUtil

LengthUtil is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for length quantities.

Member Function Documentation

◆ getDecimal64Value()

static int balber::BerUtil_FloatingPointImpUtil::getDecimal64Value ( bdldfp::Decimal64 value,
bsl::streambuf *  streamBuf,
int  length 
)
static

Read the specified length number of bytes from the input sequence of the specified streamBuf and load to the specified value the interpretation of those bytes as the contents octets of an encoded 64-bit decimal value. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if length 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 the contents octets of an encoded 64-bit decimal value. See the package-level documentation of {balber} for the definition of the format used to encode 64-bit decimal values.

◆ getDoubleValue()

static int balber::BerUtil_FloatingPointImpUtil::getDoubleValue ( double *  value,
bsl::streambuf *  streamBuf,
int  length 
)
static

Read the specified length number of bytes from the input sequence of the specified streamBuf and load to the specified value the interpretation of those bytes as the contents octets of a BER-encoded real value according to the specification. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if length 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 the contents octets of a real value according to the specification.

◆ getFloatValue()

int balber::BerUtil_FloatingPointImpUtil::getFloatValue ( float *  value,
bsl::streambuf *  streamBuf,
int  length 
)
inlinestatic

Read the specified length number of bytes from the input sequence of the specified streamBuf and load to the specified value the interpretation of those bytes as the contents octets of a BER-encoded real value according to the specification. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if length 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 the contents octets of a real value according to the specification.

◆ putDecimal64Value()

static int balber::BerUtil_FloatingPointImpUtil::putDecimal64Value ( bsl::streambuf *  streamBuf,
bdldfp::Decimal64  value 
)
static

Write the length and contents octets of the encoding of the BER encoding of the specified value 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. See the package-level documentation of {balber} for the definition of the format used to encode 64-bit decimal values.

◆ putDoubleValue()

static int balber::BerUtil_FloatingPointImpUtil::putDoubleValue ( bsl::streambuf *  streamBuf,
double  value,
const BerEncoderOptions options = 0 
)
static

Write the length and contents octets of the BER encoding of the specified real value (as defined in the specification) to the output sequence of the specified streamBuf. Optionally specify options, which will indicate whether -0.0 will be preserved or encoded as +0.0. 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.

◆ putFloatValue()

int balber::BerUtil_FloatingPointImpUtil::putFloatValue ( bsl::streambuf *  streamBuf,
float  value,
const BerEncoderOptions options = 0 
)
inlinestatic

Write the length and contents octets of the BER encoding of the specified real value (as defined in the specification) to the output sequence of the specified streamBuf. Optionally specify options, which will indicate whether -0.0f will be preserved or encoded as +0.0f. 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 documentation for this struct was generated from the following file: