Json


Object Hierarchy:

Object hierarchy for Json

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


Namespace: OLLMrpc.Bin
Package: ollmchat

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object