tagion_hibon_add_index_binary

Add binary data to hibon instance by index

extern (C)
int
tagion_hibon_add_index_binary
(,
const size_t index
,
const uint8_t* buf
,
const size_t buf_len
)

Parameters

instance const(HiBONT*)

pointer to the instance

index size_t

The index to put the binary data at

buf uint8_t*

pointer to the buffer to insert.

buf_len size_t

length of the buffer

Return Value

Type: int

Examples

HiBONT h;
int rt = tagion_hibon_create(&h);
assert(rt == ErrorCode.none, "could not create hibon");
const index = 1;
immutable(ubyte[]) binary_data = [0, 1, 0, 1];
rt = tagion_hibon_add_index_binary(&h, index, &binary_data[0], binary_data.length);
assert(rt == ErrorCode.none);
HiBON result = cast(HiBON) h.hibon;
assert(result[index].get!(immutable(ubyte[])) == binary_data);