Decode a multi-width value from buffer if size is valid.
Declared in <bdldfp_decimalconvertutil.h>
static
int
decimal64FromMultiWidthEncodingIfValid(
Decimal64* decimal,
unsigned char const* buffer,
bsls::Types::size_type size);
The behavior is undefined unless buffer has at least size bytes. Note that this function returns a non-zero value and leaves decimal unchanged if size is not a valid encoding size of the multi-width encoding format.
0 on success, and a non-zero value otherwise
| Name | Description |
|---|---|
| decimal | receives the decoded value on success |
| buffer | buffer containing a multi-width encoding |
| size | number of encoded bytes to read |