json-glib-1.0
Description:
JSON-GLib is a library for reading and parsing JSON using GLib and GObject data types and API.
- C-Documentation: https://developer-old.gnome.org/json-glib/unstable/
- Binding-Maintainer(s): Tomaž Vajngerl
- Devhelp-Package download
- Example listing
Content:
Namespaces:
- Json
- Serializable - `JsonSerializable` is an interface for controlling the serialization and deserialization of `GObject` classes.
- Array - `JsonArray` is the representation of the array type inside JSON.
- Builder - `JsonBuilder` provides an object for generating a JSON tree.
- Generator - `JsonGenerator` provides an object for generating a JSON data stream from a tree of [struct@Json.
- Node - A generic container of JSON data types.
- Object - `JsonObject` is the representation of the object type inside JSON.
- Parser - `JsonParser` provides an object for parsing a JSON data stream, either inside a file or inside a static buffer.
- Path - `JsonPath` is a simple class implementing the JSONPath syntax for extracting data out of a JSON tree.
- Reader - `JsonReader` provides a simple, cursor-based API for parsing a JSON DOM.
- ObjectIter - An iterator object used to iterate over the members of a JSON object.
- NodeType - Indicates the content of a node.
- ParserError - Error codes for `JSON_PARSER_ERROR`.
- PathError - Error codes for `JSON_PATH_ERROR`.
- ReaderError - Error codes for `JSON_READER_ERROR`.
- public const int MAJOR_VERSION
Json major version component (e.
- public const int MICRO_VERSION
Json micro version component (e.
- public const int MINOR_VERSION
Json minor version component (e.
- public const int VERSION_HEX
- public const string VERSION_S
The version of JSON-GLib, encoded as a string, useful for printing and concatenation.
- public delegate void ArrayForeach (Array array, uint index_, Node element_node)
The function to be passed to [method@Json.
- public delegate void* BoxedDeserializeFunc (Node node)
Deserializes the contents of the passed `JsonNode` into a `GBoxed`, for instance:
- public delegate Node BoxedSerializeFunc (void* boxed)
Serializes the passed `GBoxed` and stores it inside a `JsonNode`, for instance:
- public delegate void ObjectForeach (Object object, string member_name, Node member_node)
The function to be passed to [method@Json.
- public bool boxed_can_deserialize (Type gboxed_type, NodeType node_type)
Checks whether it is possible to deserialize a `GBoxed` of type `gboxed_type` from a [struct@Json.
- public bool boxed_can_serialize (Type gboxed_type, out NodeType node_type)
Checks whether it is possible to serialize a `GBoxed` of type `gboxed_type` into a [struct@Json.
- public void* boxed_deserialize (Type gboxed_type, Node node)
Deserializes the given [struct@Json.
- public void boxed_register_deserialize_func (Type gboxed_type, NodeType node_type, BoxedDeserializeFunc deserialize_func)
Registers a deserialization function for a `GBoxed` of type `gboxed_type` from a [struct@Json.
- public void boxed_register_serialize_func (Type gboxed_type, NodeType node_type, BoxedSerializeFunc serialize_func)
Registers a serialization function for a `GBoxed` of type `gboxed_type` to a [struct@Json.
- public Node? boxed_serialize (Type gboxed_type, void* boxed)
Serializes a pointer to a `GBoxed` of the given type into a [struct@Json.
- public Object? construct_gobject (Type gtype, string data, size_t length) throws Error
Deserializes a JSON data stream and creates an instance of the given type.
- public Node? from_string (string str) throws Error
Parses the given string and returns the corresponding JSON tree.
- public Object gobject_deserialize (Type gtype, Node node)
Creates a new `GObject` instance of the given type, and constructs it using the members of the object in the given node.
- public Object? gobject_from_data (Type gtype, string data, ssize_t length = -1) throws Error
Deserializes a JSON data stream and creates an instance of the given type.
- public Node gobject_serialize (Object gobject)
Creates a JSON tree representing the passed object instance.
- public string gobject_to_data (Object gobject, out size_t length)
Serializes a `GObject` instance into a JSON data stream, iterating recursively over each property.
- public Variant? gvariant_deserialize (Node json_node, string? signature) throws Error
Converts a JSON data structure to a `GVariant`.
- public Variant? gvariant_deserialize_data (string json, ssize_t length, string? signature) throws Error
Converts a JSON string to a `GVariant` value.
- public Node gvariant_serialize (Variant variant)
Converts `variant` to a JSON tree.
- public string gvariant_serialize_data (Variant variant, out size_t length)
Converts
variant
to its JSON encoded string representation. - public Quark parser_error_quark ()
- public Quark path_error_quark ()
- public Quark reader_error_quark ()
- public string serialize_gobject (Object gobject, out size_t length)
Serializes a `GObject` instance into a JSON data stream.
- public int string_compare (string a, string b)
Check whether
a
andb
are equal UTF-8 JSON strings and return an ordering over them in `strcmp()` style. - public bool string_equal (string a, string b)
Check whether
a
andb
are equal UTF-8 JSON strings. - public uint string_hash (string key)
Calculate a hash value for the given
key
(a UTF-8 JSON string ). - public string to_string (Node node, bool pretty)
Generates a stringified JSON representation of the contents of the given `node`.