summaryrefslogtreecommitdiff
path: root/json-glib/json-gobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the fallback value-to-node generator even for serializablesgobject-deserializeEmmanuele Bassi2007-11-131-6/+11
| | | | | | | To avoid reimplementing the same code all over again, if the implementation of the serialize_property virtual function of JsonSerializable returns NULL we will fall back to the simple value-to-node generator we provide for non-serializable classes.
* Fix a couple of dumb typos in the GObject deserialization codeEmmanuele Bassi2007-11-131-2/+4
| | | | | | We need to skip if the CONSTRUCT_ONLY flag is set, not unset. We also need to copy the value from the JSON node into the target GValue, not the other way around.
* Add node-to-property simple fallback parser for deserializationEmmanuele Bassi2007-11-131-9/+85
| | | | | | | | | The fallback parser for json_construct_gobject() is invoked if the GType does not implement the JsonSerializable interface, or if the interface was not handling the property. It will natively convert integers, booleans, strings and double precision floating point values; it also handles string vectors in form of arrays.
* Initial implementation of GObject deserialization functionEmmanuele Bassi2007-11-101-12/+170
| | | | | | | | | | The json_construct_gobject() function takes a GType and a JSON data stream and constructs a new instance for the given type. If the type is a JsonSerializable, it will use the JsonSerializable interface for parsing the JsonNodes of each object member. This is the initial implementation of the function: the JsonNode-to-GValue fallback parser is just a stub.
* We need the actual implementation of the JsonSerializable GType functionEmmanuele Bassi2007-10-161-0/+6
| | | | A placeholder, while syntactically correct, won't do.
* Add the JsonSerializable interfaceEmmanuele Bassi2007-10-161-31/+157
| | | | | | | The JsonSerializable interface allows implementations to override the GObject-to-JSON serialization process, by providing two virtual methods to control the (de)serialization of GObject properties. This way it's possible to serialize GObjects with properties holding complex data types.
* Add GObject serialization support for JSON-GLibEmmanuele Bassi2007-10-021-0/+169
This commit adds json-gobject.h and json_serialize_gobject() to JSON-GLib, to serialize a GObject instance into a JSON data stream.