summaryrefslogtreecommitdiff
path: root/json-glib/json-debug.h
Commit message (Collapse)AuthorAgeFilesLines
* debug: Add flag for debugging nodesEmmanuele Bassi2016-03-221-1/+2
|
* debug: Clean up debug flags accessorEmmanuele Bassi2013-05-161-3/+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.
* Add initial JSONPath implementationEmmanuele Bassi2011-05-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* debug: Add debug flags for GObject-related codeEmmanuele Bassi2010-09-251-1/+2
|
* Add debugging macrosEmmanuele Bassi2010-03-181-0/+45
Similarly to what GTK+ and Clutter do, we can use macros that evaluate to nothing if JSON_ENABLE_DEBUG is disabled; they evaluate to messages when the JSON_DEBUG environment variable is set to a debug domain.