IonSymbolID

Ion Symbol Id

In the binary encoding, all Ion symbols are stored as integer symbol IDs whose text values are provided by a symbol table. If L is zero then the symbol ID is zero and the length and symbol ID fields are omitted.

Members

Functions

get
IonErrorCode get(T value)
get
T get()
getErrorCode
IonErrorCode getErrorCode()
serialize
void serialize(S serializer)

Serializes SymbolId as Ion value. Note: This serialization shouldn't be used for struct keys or annotation list.

Variables

data
const(ubyte)[] data;

Examples

import mir.test;
assert(IonValue([0x7F]).describe.get!IonNull == IonNull(IonTypeCode.symbol));
assert(IonValue([0x71, 0x07]).describe.get!IonSymbolID.get == 7);

size_t v;
assert(IonValue([0x72, 0x01, 0x04]).describe.get!IonSymbolID.get(v) == IonErrorCode.none);
v.should == 260;
// null.string
assert(IonValue([0x8F]).describe.get!IonNull == IonNull(IonTypeCode.string));
// empty string
assert(IonValue([0x80]).describe.get!(const(char)[]) !is null);
assert(IonValue([0x80]).describe.get!(const(char)[]) == "");

assert(IonValue([0x85, 0x63, 0x6f, 0x76, 0x69, 0x64]).describe.get!(const(char)[]) == "covid");

Meta