| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This can be useful to extract a sub json structure
during parsing of another (for example when we don't
know in advance the format of this sub json and just
want to pass it to another consumer).
Closes #9
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Drop `SECTION` blurbs.
Use gi-docgen syntax for internal links.
Use summary lines for gi-docgen indices.
Use Markdown syntax for code fragments.
|
|
|
|
|
|
|
| |
Use JsonObject's private members_ordered
GQueue instead. This avoids a g_list_copy().
https://bugzilla.gnome.org/show_bug.cgi?id=773504
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
methods
json_builder_add_boolean_value
json_builder_add_double_value
json_builder_add_int_value
json_builder_add_null_value
json_builder_add_string_value
json_builder_add_value
json_builder_begin_array
json_builder_begin_object
json_builder_end_array
json_builder_end_object
json_builder_get_root
json_builder_set_member_name
json_generator_get_root
json_reader_get_error
json_reader_get_member_name
json_reader_get_value
json_serializable_find_property
json_serializable_find_property
json_boxed_serialize
|
|
|
|
|
|
| |
matches the json_reader_is_value check.
https://bugzilla.gnome.org/show_bug.cgi?id=758580
|
|
|
|
|
|
| |
See https://developer.gnome.org/hig/stable/typography.html
https://bugzilla.gnome.org/show_bug.cgi?id=772753
|
|
|
|
|
|
|
| |
We need to tell the compiler that the 3rd argument is a format-like
string, and that the arguments for that come in the variadic arguments
list; this allows compilers like GCC to do validation on the format
string itself, and avoid a whole class of bugs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
Include an example showing that the end function must be called on both
code paths (success and failure) if the reader object is to be used
afterwards.
https://bugzilla.gnome.org/show_bug.cgi?id=744100
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|