Serializes the passed GBoxed and stores it inside a JsonNode, for instance:
GBoxed
JsonNode
static JsonNode *my_point_serialize (gconstpointer boxed){ const MyPoint *point = boxed; g_autoptr(JsonBuilder) builder = json_builder_new (); json_builder_begin_object (builder); json_builder_set_member_name (builder, "x"); json_builder_add_double_value (builder, point->x); json_builder_set_member_name (builder, "y"); json_builder_add_double_value (builder, point->y); json_builder_end_object (builder); return json_builder_get_root (builder);}
a boxed data structure
Serializes the passed
GBoxed
and stores it inside aJsonNode
, for instance: