summaryrefslogtreecommitdiff
path: root/doc/reference/json-glib-sections.txt
Commit message (Collapse)AuthorAgeFilesLines
* Move the reference build down one levelEmmanuele Bassi2017-03-141-445/+0
| | | | | There's no point in having the API reference in its own sub-directory: it's the only documentation we have.
* docs: Reference the JSON-GLib headerEmmanuele Bassi2017-03-131-0/+2
| | | | | The API reference should list the header that user code should include in order to use the API.
* core: Add JSON node, object, array hashesPhilip Withnall2016-03-011-0/+11
| | | | | | | | | | | | | | | | | | | Now that these objects can be marked as immutable, it is possible to calculate and cache hash values for each of them. This allows efficient hash-based deduplication of large numbers of JSON nodes, as needed by Walbottle for JSON test vector generation. To complement the new hash functions, each of JsonNode, JsonValue, JsonObject and JsonArray also now have an equal() comparison method. This compares them structurally and recursively, using the definition of equality from the JSON Schema specification, which seems as good as any other. http://json-schema.org/latest/json-schema-core.html#anchor9 https://bugzilla.gnome.org/show_bug.cgi?id=756121 Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* node: Add json_node_ref() and json_node_unref()Philip Withnall2016-03-011-0/+2
| | | | | | | | | | | | | | Add reference counting semantics to JsonNode, in addition to the existing init/unset and alloc/free semantics. json_node_free() must only be used with nodes allocated using json_node_alloc(). json_node_unref() may be used with all nodes (if correctly paired; it may be paired with json_node_alloc()). It is not valid to call json_node_free() on a node whose reference count is not 1. https://bugzilla.gnome.org/show_bug.cgi?id=756121
* core: Add immutability support to core objectsPhilip Withnall2016-03-011-0/+8
| | | | | | | | | | | Add an immutable mode to JsonNode, JsonObject, JsonArray and JsonValue. This is an optional mode which objects enter by calling json_*_seal(). It is a one-way transition, which means that we can build and manipulate objects as much as desired, before sealing them and enjoying the benefits of immutable objects: no need to take copies when handling them, persistent hash values (still to be implemented). https://bugzilla.gnome.org/show_bug.cgi?id=756121
* object: Add JsonObjectIter to ease iteration over JsonObject membersPhilip Withnall2015-10-061-0/+3
| | | | | | | | | | This is a stack-allocated iterator object similar to GHashTableIter which allows allocation-free iteration over the members in a JsonObject. It differs from json_object_foreach_member() in the order in which it iterates — for JsonObjectIter the order is undefined. https://bugzilla.gnome.org/show_bug.cgi?id=755509
* docs: Add missing symbolsEmmanuele Bassi2015-06-091-1/+5
|
* Add simple JSON/string utilitiesEmmanuele Bassi2015-06-091-0/+6
| | | | | Wrap JsonParser and JsonGenerator in simple, easy to call functions that manage the objects for you.
* Reimplement JSON_VERSION_HEX as a macro callEmmanuele Bassi2014-03-181-0/+1
| | | | Add a JSON_ENCODE_VERSION macro and use it in JSON_VERSION_HEX.
* Use compiler annotations to determine symbol visibilityEmmanuele Bassi2014-03-181-0/+16
| | | | | | | | | | | | | | | | | Instead of relying on a separate file that requires being update every time we add a new public function we should use compiler annotations to let the linker know which symbols are public and exported. In order to achieve this we have to: * check for the visibility=hidden attribute * add -fvisibility=hidden to the linker flags * add a macro to annotate all public symbols While we're at it, we should copy the versioned symbols macro layout already used by GLib, GTK+, and other G* libraries, including the ability to express the range of allowed versions of JSON-GLib that third party code can compile against.
* node: Add typed initializersEmmanuele Bassi2012-10-271-0/+9
| | | | | | | | | | | We should simplify the JsonNode API a bit, especially when it comes to initializing nodes. Instead of a two-step "new(<type>) followed by a set_<type>(value)" API, we can provide a "init_<type>(value)" API that can take any existing JsonNode and initialize it to the given type. This makes the JsonNode creation more concise and reliable; it also allows to implicitly re-initialize JsonNodes without requiring the user to de-allocate/re-allocate them first.
* docs: Add missing symbolsEmmanuele Bassi2012-06-301-0/+2
| | | | The deprecation macros should be in the private section.
* docs: Fix API reference missing symbolsEmmanuele Bassi2011-06-151-0/+4
|
* docs: Document JsonPath and add it to the API referenceEmmanuele Bassi2011-06-011-0/+20
|
* reader: Add accessor for the member nameEmmanuele Bassi2011-02-061-0/+1
| | | | This should allow easy access to the member name during iteration.
* reader: Add list_members() methodEmmanuele Bassi2011-02-041-0/+1
| | | | | Allow retrieving a list of member names from the current cursor position of the JsonReader. It's useful if you're trying to inspect a JSON tree.
* gvariant: Adds JSON GVariant integration API, with docs and testsEduardo Lima Mitev2011-01-261-0/+10
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=632940
* generator: Clean up and add accessorsEmmanuele Bassi2010-12-141-1/+10
| | | | | | | | Instead of asking everyone to use g_object_set() to set up a JsonGenerator the class should provide a decent API for its properties. While we're at it, we should also use modern API for installing and notifying of property changes.
* reader: Do not wrap JsonParserEmmanuele Bassi2010-08-121-1/+1
| | | | | | | Since JsonParser has far more methods for parsing a JSON stream we should just make JsonReader an API for reading an already parsed JSON tree - in the same way that JsonBuilder does not generate the stringified version of the JSON tree it builds.
* reader: Mirror the JsonBuilder API value accessorsEmmanuele Bassi2010-08-121-5/+5
| | | | We should strive to make JsonBuilder and JsonReader similar in API.
* docs: Add JsonReader to the API referenceEmmanuele Bassi2010-08-121-0/+41
|
* generator: Add an OutputStream-based methodEmmanuele Bassi2010-08-021-0/+1
| | | | | | | Currently, only synchronous API. The output handling is pretty trivial, unlike the input handling in JsonParser; this is a really basic convenience API.
* docs: Add the new JsonParser stream APIEmmanuele Bassi2010-08-021-0/+3
|
* docs: Add JsonBuilder to the API referenceEmmanuele Bassi2010-06-161-0/+32
| | | | | And silence gtk-doc-scanner by removing an undefined argument from json_builder_add_null_value().
* docs: Add missing to/from_data methodsEmmanuele Bassi2009-11-291-0/+2
|
* boxed: Split (de)serialization registrationEmmanuele Bassi2009-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A GBoxed type defined as: struct Boxed { int foo; gboolean bar; int baz; }; Can be represented either by a JSON object: { "foo" : 1, "bar" : true, "baz" : 3 } Or by a JSON array: [ 1, true, 3 ] The current function for registering a serialization and a deserialization pair does not allow registering more than one deserialization function - which means that there can only be one way to deserialize a GBoxed type into a specific JsonNode type. To allow having more than one JsonNodeType associated to a GBoxed type and a deserialization function we need to split out the registration of the serialization and deserialization functions into two distinct functions.
* serializable: Add methods proxying default implementationsEmmanuele Bassi2009-11-121-0/+4
| | | | | | | | | | If you want to use the default implementation of serialize_property() and/or deserialize_property() from an object class implementing JsonSerializable you currently have to peek the interface vtable and then call the vfunc pointers. We can expose the default implementation through functions ourselves and simplify the required code.
* gobject: Uniform JSON<->GObject mapping codeEmmanuele Bassi2009-10-281-2/+2
| | | | | | | | | Rename json_gobject_new() to json_gobject_deserialize(), and json_gobject_dump() to json_gobject_serialize(); this maps the JSON GBoxed API. Also for consistency, change the serialize() return value and the deserialize() argument to be JsonNodes of type JSON_NODE_OBJECT.
* docs: Split out GObject-related sectionsEmmanuele Bassi2009-10-271-6/+27
| | | | | | | | | Like commit c176f70e593c9cfb4901cd9f27ce54b8aa7152f2 did for the source code, the documentation should be split three-ways: • GObject-related API • JsonSerializable • GBoxed-related API
* [node] Add HOLDS macros for quick type checkingEmmanuele Bassi2009-09-281-1/+6
| | | | JsonNode should mimick GValue's API and have macros for easy type checking
* [node] Add JsonNode.set_parent()Emmanuele Bassi2009-09-061-0/+1
| | | | | Add the setter for JsonNode:parent, to be used in JsonParser instead of directly accessing the JsonNode structure.
* Add JsonArray iteration functionEmmanuele Bassi2009-05-171-0/+2
| | | | | | Similarly to commit 3057a172 for JsonObject, the newly added json_array_foreach_element() iterates over a JSON array data type.
* Add JsonObject iteration functionEmmanuele Bassi2009-05-161-0/+2
| | | | | The json_object_foreach_member() function iterates over a JsonObject data type.
* [node] Add is_null() methodEmmanuele Bassi2009-04-171-0/+1
| | | | | The json_node_is_null() function is just a quick check for nodes set to null.
* [node] Add function version of JSON_NODE_TYPE macroEmmanuele Bassi2009-04-171-0/+1
| | | | | First pass at adding some type safety to the JsonNode type checks, and at removing every mention of the JsonNode interna fields.
* Add convenience accessors to JsonArrayEmmanuele Bassi2009-04-171-3/+19
| | | | | | | | | | Like commit 5bb6ea91 did for JsonObject, we should add typed convenience accessors to JsonArray in order to cut down the amount of nodes needed when parsing and generating JSON data streams. As for JsonObject, the amount of types is small enough to avoid the combinatorial API explosion.
* Deprecate add_member() and add set_member() and friendsEmmanuele Bassi2009-04-171-0/+17
| | | | | | | | | | | | | | | | | | | The add_member() method of JsonObject has wee bit weird semantics: if the member to be added already exists it prints a scary warning and returns - and yet it calls g_hash_table_replace() internally as if it overwrites the member. So, instead of changing semantics midway we can: - add a json_object_set_member() which adds a new member and overwrites existing members - deprecate json_object_add_member() While we're at it, we can add convenience wrappers for set_member() and get_member() that don't require us toying with nodes; luckily, since the amount of valid types we can add to a JsonObject is limited, this does not lead to a combinatorial API explosion.
* Ignore json-scanner.h and its typesEmmanuele Bassi2008-04-191-1/+0
| | | | | | | | | When generating the documentation, ignore the JsonScanner header as it will not be installed. Also, we moved JsonTokenType from json-parser.h to json-scanner.h, where it belongs, so we can remove it from the (private) subsection of the json-parser section.
* Remove json_parser_peek_root from the gtk-doc sectionsEmmanuele Bassi2008-01-291-1/+0
| | | | | The json_parser_peek_root() function has been removed, and so we do not its symbol in the json-glib-sections.txt file anymore.
* Add symbols of the newly committed APIEmmanuele Bassi2007-11-211-0/+3
|
* Add new symbols to the documentationEmmanuele Bassi2007-11-131-1/+6
|
* Merge branch 'gobject-deserialize' into workEmmanuele Bassi2007-11-131-0/+1
|\
| * Initial implementation of GObject deserialization functionEmmanuele Bassi2007-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Add support for parsing assignmentsEmmanuele Bassi2007-11-101-0/+1
|/ | | | | | | | | | | | | | | | | Some JSON web APIs return a full JavaScript assignment instead of just the data structure (and I'm looking at you, Tumblr). This is done in clear violation of the grammar published in the RFC 4627, and it's evidently done because most web developers are too lazy for doing a var foo = eval('(' + text ')'); and want everything defined for them. JsonParser will blissfully ignore the left-hand part of the assignment but, in the interest of the developer who cares, will record: 1. that the parsed statement was in fact an assignment and 2. the name of the variable used. The function json_parser_has_assignment() can be used to query both the presence of an assignment and the variable name at the same time.
* Add the JsonSerializable interfaceEmmanuele Bassi2007-10-161-0/+15
| | | | | | | 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 a method for getting all the nodes from a JsonObjectEmmanuele Bassi2007-10-161-0/+1
| | | | | To map json_array_get_elements(), a json_object_get_values() method has been added which returns the list of JsonNodes contained by a JsonObject.
* Add API for removing nodes from arrays and objectsEmmanuele Bassi2007-10-151-0/+2
| | | | | | | Write and document json_object_remove_member() and json_array_remove_element() which can be used to remove a JsonNode from a JsonObject or a JsonArray respectively. This way, the JsonObject and JsonArray are API-complete and the object model can be manipulated in code.
* Add json_node_dup_string()Emmanuele Bassi2007-10-081-0/+1
| | | | | The newly added json_node_dup_string() is a convenience function for getting a copy of the string contained inside a JsonNode.
* Add convenience accessors for fundamental types in JsonNodeEmmanuele Bassi2007-10-051-0/+8
| | | | | | This commit adds some convenience accessors for setting and getting fundamental types in and from a JsonNode, to avoid jumping through all the GValue hoops.
* Add line/position getters to JsonParserEmmanuele Bassi2007-10-051-0/+6
| | | | | | Add two methods to JsonParser to retrieve the currently parsed line and position within that line. These methods works only while parsing, so within the signal handlers and inside subclasses.