The OpenD Programming Language

deserializeValueImpl

Deserialize integral value.

Examples

import mir.ion.value;
import mir.ion.exception;

auto data = IonValue([0x21, 0x07]).describe;
int valueS;
uint valueU;

assert(deserializeValueImpl(data, valueS) == IonErrorCode.none);
assert(valueS == 7);

assert(deserializeValueImpl(data, valueU) == IonErrorCode.none);
assert(valueU == 7);

data = IonValue([0x31, 0x07]).describe;

assert(deserializeValueImpl(data, valueS) == IonErrorCode.none);
assert(valueS == -7);

Meta