pointer to the hibon instance
pointer to the key
length of the key
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"); string 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"); string _key = "sub_doc_key"; rt = tagion_hibon_add_hibon(&h, &_key[0], _key.length, &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