pointer to the hibon instance
The index to pute the hibon add
pointer to the sub hibon instance that needs to be inserted
ErrorCode
HiBONT sub_h; int rt = tagion_hibon_create(&sub_h); assert(rt == ErrorCode.none, "could not create hibon"); const key = "some_key"; string value = "some_value"; rt = tagion_hibon_add_string(&sub_h, &key[0], key.length, &value[0], value.length); HiBON string_hibon = cast(HiBON) sub_h.hibon; assert(string_hibon[key].get!string == value); // add it to a new hibon instance as a subhibon; HiBONT h; rt = tagion_hibon_create(&h); assert(rt == ErrorCode.none, "Could not create hibon"); const _key = 1; rt = tagion_hibon_add_index_hibon(&h, _key, &sub_h); assert(rt == ErrorCode.none); HiBON result = cast(HiBON) h.hibon; assert(result[_key].get!HiBON == string_hibon, "The read subhibon was not the same");
Add hibon to hibon instance by index