summaryrefslogtreecommitdiff
path: root/json-glib/json-path.c
Commit message (Collapse)AuthorAgeFilesLines
* Drop or mark unused parametersEmmanuele Bassi2022-10-111-1/+1
| | | | Avoid compiler warnings when running with `-Wunused-parameter`.
* Fix sign comparison warningsEmmanuele Bassi2022-10-111-3/+3
| | | | | When running with `-Wsign-compare` we're raising a lot of signed/unsigned comparison warnings.
* Update the JsonPath documentationEmmanuele Bassi2021-06-101-44/+41
|
* docs: Initial, rough port away from gtk-docEmmanuele Bassi2021-06-081-48/+48
| | | | | | | | | | Drop `SECTION` blurbs. Use gi-docgen syntax for internal links. Use summary lines for gi-docgen indices. Use Markdown syntax for code fragments.
* core: Avoid json_object_get_members()Garrett Regier2017-06-161-8/+6
| | | | | | | Use JsonObject's private members_ordered GQueue instead. This avoids a g_list_copy(). https://bugzilla.gnome.org/show_bug.cgi?id=773504
* docs: Fix array subsets descriptionAllin Cottrell2017-03-181-2/+2
| | | | | | | | | | | | | | | The doc for json-glib misstates the meaning of the JsonPath set notation operator, as in $.store.book[0,2] This does not mean elements 0 to 2 (a range) but rather just elements 0 and 2. This is correctly handled in the library; it's just the doc that is wrong. https://bugzilla.gnome.org/show_bug.cgi?id=768788
* docs: Use appropriate markdown for literalsEmmanuele Bassi2017-03-181-8/+8
|
* Use Unicode in translatable stringsPiotr Drąg2017-03-181-6/+6
| | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772753
* doc: Use 'plain' language for JSON snippetsEmmanuele Bassi2017-03-181-3/+4
|
* Fix translator commentsPiotr Drąg2017-01-281-1/+1
| | | | They need to be exactly one line above a string to show up in .po files.
* node: Add json_node_ref() and json_node_unref()Philip Withnall2016-03-011-2/+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
* Remove conditional inclusion of config.hEmmanuele Bassi2014-03-181-2/+0
| | | | All the platforms and build system we support have a config.h header.
* docs: Port to MarkDownEmmanuele Bassi2014-03-181-158/+110
| | | | | Drop the DocBook documentation, and move everything to the MarkDown format used by modern gtk-doc.
* Handle invalid path: invalid first characterbi2013-12-021-1/+9
| | | | | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org> Conflicts: json-glib/json-path.c
* path: compile and query path '$' to retrieve root nodebi2013-12-021-2/+5
| | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* Handle invalid path : missing member name after .bi2013-12-021-0/+8
| | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* path: Check if JSONPath expression is NULLJuan A. Suarez Romero2013-09-191-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=708318
* path: Remove unused variableEmmanuele Bassi2013-08-211-1/+1
|
* debug: Clean up debug flags accessorEmmanuele Bassi2013-05-161-1/+6
| | | | | | Mark json_get_debug_flags() as an internal function, and drop the '_' prefix; also, add a simple macro that we can use everywhere to mask the function call.
* path: Move debug dump of the path into its own functionEmmanuele Bassi2013-05-161-61/+62
| | | | | The path parsing function is already pretty long, so we should isolate the debugging code out of the way.
* Use G_DEFINE_QUARK macroEmmanuele Bassi2013-05-161-6/+2
| | | | Instead of hand-writing the error domain function ourselves.
* path: Fix get all object members with wildcardEmmanuele Bassi2013-01-111-1/+1
| | | | | Similar to the fix that went in commit path e348b1fa, we need to fix getting all the members of an object by using the wildcard notation.
* path: Fix get all array elements with wildcardJuan A. Suarez Romero2013-01-111-1/+1
| | | | | | | | | Using the same data as in tests, asking for $['store']['book'][*] JSON path should return all the book objects in an array. But that array is returned inside another array, dupped several times. https://bugzilla.gnome.org/show_bug.cgi?id=691557
* path: Pass int width for printf field width, not longColin Walters2012-06-081-4/+4
|
* Mark GError messages for translationsEmmanuele Bassi2011-06-011-6/+7
| | | | These errors might find their way into a UI.
* Add i18n machineryEmmanuele Bassi2011-06-011-1/+3
| | | | We need to translate the GError messages.
* Revert "path: Add some more validation points"Emmanuele Bassi2011-06-011-56/+21
| | | | | | This reverts commit e8fa85705e48d03742eb351addbad53be4d8e60b. The validation broke the test suite; it'll need some more work.
* path: Add some more validation pointsEmmanuele Bassi2011-06-011-21/+56
| | | | Especially for the slice syntax.
* docs: Document JsonPath and add it to the API referenceEmmanuele Bassi2011-06-011-2/+172
|
* Add initial JSONPath implementationEmmanuele Bassi2011-05-311-0/+856
JSONPath is a JSON query syntax similar to what XPath does for XML; using JSONPath it's possible to address a specific node (or set of nodes) inside a JSON document. The JsonPath class is a simple implementation of part of the JSONPath proposal, as formalised by Stefan Gössner here: http://goessner.net/articles/JsonPath/ The covered operators are: • root, or '$'; • child, both using the dot-notation and the bracket notation; • recursive descent, or '..'; • subscript, or '[]'; • set, or '[,]'; • slice, or '[start:end:step]'. The only missing operators are the filter, or '?()' and the script, or '()', because implementing a JavaScript interpreter inside JSON-GLib is not one of my greatest aspirations. It should be possible, though, to parse and evaluate simple arithmetic conditions, in the future. The JsonPath methods are pretty straightforward: a JsonPath instance should be created and used to compile an expression; the compilation might result in a syntax error or not. Then, the JsonPath instance can be used to match any JSON tree. Like the other JSONPath implementations, JsonPath returns a JSON array of matching nodes. A simple, one-off static method called json_path_query() is also provided; the method wraps the JsonPath creation, the expression compilation, and the matching, as well as disposing the JsonPath instance once done. For the time being, only positive testing is provided; negative testing for the expression compilation will follow.