Json
Object Hierarchy:
Description:
public class Json : Object
JSON ↔ bin bridge for tests, HTTP tooling, and debugging.
Encodes json-glib trees onto a Stream and decodes wire bytes back into JSON nodes.
Property layout follows the JSON shape and wire type bytes — not a live GObject schema. Objects need meta key *type unless
Mode.AUTO. Keys starting with * are meta only and stripped before
encode. Register aliases with register first.
Example
OLLMrpc.Bin.register("Pair", typeof(Pair));
var json = new OLLMrpc.Bin.Json();
var parser = new global::Json.Parser();
parser.load_from_data(
"{\"*type\":\"Pair\",\"name\":\"a\",\"count\":1}", -1);
var mem = new GLib.MemoryOutputStream.resizable();
var bin = new OLLMrpc.Bin.Stream(
null, new GLib.DataOutputStream(mem));
json.json_to_bin(parser.get_root().get_object(), bin);
GObject to JSON
var node = json.from_gobject(pair);
Prefer from_gobject over hand-rolled memory pipes.
See also:
Stream, Mode
Content:
Properties:
Creation methods:
Methods:
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref