| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the case where, with nested objects, we call:
json_reader_read_member (reader, "outer");
// json_reader_get_member_name (reader) == "outer"
json_reader_read_member (reader, "inner");
// json_reader_get_member_name (reader) == "inner"
// do something useful
json_reader_end_member (reader);
but at the end, the following assertion no longer holds:
// json_reader_get_member_name (reader) == "outer"
even though the JsonReader state should have been reset after ending the
inner node.
Fix it by maintaining a stack of member names. This works with both
json_reader_read_member() and json_reader_read_element(). Updates to the
unit tests are included.
https://bugzilla.gnome.org/show_bug.cgi?id=741824
|
| |
|
|
| |
All the platforms and build system we support have a config.h header.
|
| |
|
|
|
| |
Drop the DocBook documentation, and move everything to the MarkDown
format used by modern gtk-doc.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a call to json_reader_read_element() fails if the element
doesn't exist, we need to call json_reader_end_element() to clear
out any errors.
But the _end_element() call will backtrack to the parent node,
when the _read_element() call did not set the child node.
To fix this, leave early from _end_*() calls when an error has
been set.
https://bugzilla.gnome.org/show_bug.cgi?id=723428
|
| |
|
|
|
|
| |
Fix cut'n'paste error.
https://bugzilla.gnome.org/show_bug.cgi?id=721137
|
| |
|
|
|
| |
We depend on a new version of GLib, so we can remove a bunch of old
version checks.
|
| |
|
|
|
|
|
|
| |
If we're being compiled against a newer version of GLib, we should use
the new macros that add instance private data.
Since this is a stable branch, we cannot bump the GLib requirement; so
we use version checks to conditionally compile the new code.
|
| |
|
|
| |
Instead of hand-writing the error domain function ourselves.
|
| |
|
|
|
| |
Even if we have a special JsonNode for it. The json_reader_is_value()
function should return TRUE for 'null' nodes as well.
|
| |
|
|
| |
JsonNode will do an implicit conversion for us.
|
| |
|
|
|
|
|
|
| |
JsonReader should perform more strict validation, and put itself in an
error state whenever the user asks for values or information on nodes
that are not there, or not of the right type.
https://bugzilla.gnome.org/show_bug.cgi?id=658632
|
| |
|
|
|
|
|
|
| |
See GLib bug:
https://bugzilla.gnome.org/show_bug.cgi?id=644611
The macro is going to be deprecated soon.
|
| |
|
|
| |
These errors might find their way into a UI.
|
| |
|
|
| |
We need to translate the GError messages.
|
| | |
|
| |
|
|
|
|
| |
Free the current_member string, and since we're destroying data we own
let's do it inside the finalize implementation instead of the dispose
one.
|
| |
|
|
| |
This should allow easy access to the member name during iteration.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we assume that a JSON object is just an array with a named mapping
then the JsonReader API should be able to descend into objects using the
same API used for arrays.
This obviously is less useful than it sounds if we take a very strict
interpretation of JSON objects as unordered string-to-value mappings; as
the ordering is not guaranteed to be stable, parsers would be fairly
weak against various JSON definitions.
If the JSON format parsed is guaranteed to be stable then an integer
offset might be an easy (albeit slightly less performant) way to access
data.
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
Use modern API to deal with properties installation and notification.
|
| |
|
|
|
| |
A JsonReader is useless without a root JsonNode to start walking the
tree from.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
We should strive to make JsonBuilder and JsonReader similar in API.
|
|
|
JsonReader is a simple, cursor-based API for parsing a JSON DOM. It is
similar, in spirit, to the XmlReader API provided by various platforms
and XML parsing libraries.
|