BoxedSerializeFunc
Description:
[ CCode ( has_target = false ) ]
[ Version ( since = "0.10" ) ]
public delegate Node BoxedSerializeFunc (void* boxed)
[ Version ( since = "0.10" ) ]
public delegate Node BoxedSerializeFunc (void* boxed)
Serializes the passed `GBoxed` and stores it inside a `JsonNode`, for instance:
```c 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); } ```
Parameters:
boxed |
a boxed data structure |
Returns:
the newly created JSON node tree representing the boxed data |
Namespace: Json
Package: json-glib-1.0