| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Clarify the documentation for json_node_set_object() and
json_object_get_array_member().
https://bugzilla.gnome.org/show_bug.cgi?id=754384
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
The two are fairly different, and JsonObject does not behave this way.
https://bugzilla.gnome.org/show_bug.cgi?id=730803
|
|
|
|
|
| |
GSimpleAsyncResult is deprecated in GLib 2.46, so we should drop its
use, and simplify the code in the process.
|
|
|
|
|
| |
Wrap JsonParser and JsonGenerator in simple, easy to call functions that
manage the objects for you.
|
|
|
|
|
|
|
| |
We need to remove the path specification inside the sources listing, and
modify the enumeration type and marshallers generation rules to cope
with it (by adding the $(srcdir) when needed). This is similar to the
changes there were made to Clutter.
|
| |
|
|
|
|
|
|
|
|
|
| |
The json gvariant serializer encodes whole number doubles without
a dot. The deserializer needs to be able to parse these as well.
Fix problem, and add test cases.
https://bugzilla.gnome.org/show_bug.cgi?id=724319
|
|
|
|
|
|
|
| |
Document and annotate the fact that json_builder_add_value() takes
ownership of the JsonNode passed in to it.
https://bugzilla.gnome.org/show_bug.cgi?id=743475
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Long and unsigned long was properly serialized but not deserialized, guint64
handling is not ideal as the type is cast into a gint64, however this is
better than not handling the fundamental type at all.
https://bugzilla.gnome.org/show_bug.cgi?id=725972
|
|
|
|
|
| |
It's not public API anyway, and we use annotations instead of the '_'
prefix.
|
| |
|
|
|
|
| |
Expands the symbol annotation correctly.
|
|
|
|
|
|
|
| |
Otherwise g-ir-scanner won't pick the types up, and will not notice that
the error enumerations have an associated error domain.
https://bugzilla.gnome.org/show_bug.cgi?id=730917
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=730425
|
|
|
|
|
|
|
| |
Escaping these as octals is out of the JSON spec completely,
so roll our own string encoder.
https://bugzilla.gnome.org/show_bug.cgi?id=730425
|
|
|
|
|
|
| |
Also fix empty keys, which are now encoded properly.
https://bugzilla.gnome.org/show_bug.cgi?id=727593
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=727755
|
| |
|
|
|
|
|
|
|
| |
The ByteArray we use to buffer the contents of a stream in order to
pass them to the parser may have a bigger length. We should use the
cursor position that we use to put a '\0' in the buffer instead. We
could also use -1, but this saves us a strlen() later on.
|
|
|
|
| |
Fixes compilation in cases where builddir != srcdir.
|
|
|
|
| |
All the platforms and build system we support have a config.h header.
|
|
|
|
| |
We need to let g-ir-scanner parse json-version.h.
|
|
|
|
| |
Add a JSON_ENCODE_VERSION macro and use it in JSON_VERSION_HEX.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Drop the DocBook documentation, and move everything to the MarkDown
format used by modern gtk-doc.
|
|
|
|
|
|
| |
We over-assert() our pre-conditions, and the conversion is a bit
obfuscated. We should use a proper function, and de-obfuscate the
code so that the intent is clear.
|
|
|
|
|
| |
JsonNode, JsonObject, and JsonArray have various constructors, so we
need to annotate them.
|
|
|
|
|
|
|
|
|
| |
As unistd.h is not universally available, don't include it unconditionally
and include the corresponding Windows headers where necessary. Also, use
gssize in place of ssize_t and define STDOUT_FILENO on Windows when we
don't have unistd.h, which is a constant that is defined in unistd.h.
https://bugzilla.gnome.org/show_bug.cgi?id=723813
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=723428
|
|
|
|
|
|
| |
Fix cut'n'paste error.
https://bugzilla.gnome.org/show_bug.cgi?id=721137
|
| |
|
|
|
|
|
| |
Only include the necessary headers, and use a single-header inclusion
guard to prevent people from including only json-gvariant.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC (and other compilers) can optimise multiple inclusion of headers if
they find the:
#ifndef FOO
#define FOO
#endif
pattern as the first thing inside a header. The single-header inclusion
guard was preventing that from happening, so we need to move it inside
the multiple inclusion guard.
|
|
|
|
| |
Instead of sizeof(array)/sizeof(type).
|
|
|
|
|
|
|
|
|
| |
Consider the following JSON: ["123"]
Trying to convert it to GVariant with signature "(i)" would previously fail,
as string-to-number conversions weren't implemented. This patch implements
string-to-number and string-to-boolean conversions.
https://bugzilla.gnome.org/show_bug.cgi?id=707382
|
|
|
|
|
|
|
| |
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
Conflicts:
json-glib/tests/path.c
|
|
|
|
|
|
|
| |
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
Conflicts:
json-glib/json-path.c
|
|
|
|
| |
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
|
|
|
|
| |
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
|
|
|
|
|
| |
The pkg-config file for a library is tied to the source, so it should
not be in the top-level of the project.
|
|
|
|
|
|
|
|
|
| |
The -no-undefined linker flag is needed only when compiling for Windows,
and it's added conditionally. Except that we also add it unconditionally
in the LDFLAGS used for the libjson-glib-1.0 shared object. Whoopsie.
We should also drop the unneeded -rpath: distributions will go out of
their way to patch it out in any case.
|
|
|
|
|
|
|
|
| |
We don't need a custom Makefile for quiet rules: AM_V_GEN is pretty much
all we use anyway.
The Makefile.am.gtest file is not included any longer, since we switched
to TAP and GLib's own rules for unit testing.
|
|
|
|
| |
Use the same spacing and formatting rules.
|
|
|
|
|
| |
A simple command line utility to format JSON data; it allows prettifying
and unprettifying JSON.
|
|
|
|
|
| |
The json-glib-validate tool is a small utility that validates the data
found at the URIs passed on its command line.
|
|
|
|
|
|
| |
JSON is defined to be encoded using UTF-8, so we should not rely on
the documentation saying so when parsing, but validate the input and
eventually provide a recoverable parsing error.
|
|
|
|
|
| |
Do not just pass the GError through from the public-facing arguments: we
may want to perform error checking internally at any later date.
|