tagion_hibon_add_string

Insert string into hibon

extern (C)
int
tagion_hibon_add_string
(,
const char* key
,
const size_t key_len
,
const char* value
,
const size_t value_len
)

Parameters

instance const(HiBONT*)

the instance to insert the key value into

key char*

pointer to the key

key_len size_t

length of the key

value char*

pointer to the string

value_len size_t

length of the string

Return Value

Type: int

ErrorCode

Examples

HiBONT h;
int rt = tagion_hibon_create(&h);
assert(rt == ErrorCode.none, "could not create hibon");
string key = "some_key";
string value = "some_value";
rt = tagion_hibon_add_string(&h, &key[0], key.length, &value[0], value.length);
HiBON string_hibon = cast(HiBON) h.hibon;
assert(string_hibon[key].get!string == value);