liteserver / binn

Binary Serialization
Apache License 2.0
440 stars 58 forks source link

Nested objects #22

Open sfhacker opened 6 years ago

sfhacker commented 6 years ago

Ciao there,

I'm new to this project and I'd like to ask whether or not it is possible to have nested objects. For example:

{ "message":{ "type":"QUERY", "timestamp":1234569900, "source":{ "id":1, "name":"NN", "actor":"AGT" } } }

Something like: binn_object_append_object("source", obj_source, obj_message) Could you provide a code example?

Thanks.

kroggen commented 6 years ago

Yes, we can use nested objects. Take a look here.

In this case we use the binn_object_set_object function.

The list of functions is on the binn.h file.