| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
The newly added API is available since 1.2.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that these objects can be marked as immutable, it is possible to
calculate and cache hash values for each of them. This allows efficient
hash-based deduplication of large numbers of JSON nodes, as needed by
Walbottle for JSON test vector generation.
To complement the new hash functions, each of JsonNode, JsonValue,
JsonObject and JsonArray also now have an equal() comparison method.
This compares them structurally and recursively, using the definition of
equality from the JSON Schema specification, which seems as good as any
other.
http://json-schema.org/latest/json-schema-core.html#anchor9
https://bugzilla.gnome.org/show_bug.cgi?id=756121
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Add an immutable mode to JsonNode, JsonObject, JsonArray and JsonValue.
This is an optional mode which objects enter by calling json_*_seal().
It is a one-way transition, which means that we can build and manipulate
objects as much as desired, before sealing them and enjoying the
benefits of immutable objects: no need to take copies when handling
them, persistent hash values (still to be implemented).
https://bugzilla.gnome.org/show_bug.cgi?id=756121
|
|
|
|
| |
They are not needed — json-glib is not at all thread safe.
|
|
|
|
| |
All the platforms and build system we support have a config.h header.
|
|
Given its ECMAScript inheritance, JSON allows only four types of values:
- integer numbers
- floating point numbers
- booleans
- strings
We can efficiently represent a JSON value using a simple, reference
counted structure, that behaves similarly to GValue but without the
baggage of the whole type system.
For the time being, we should keep the whole JsonValue internal: we
already specify typed public accessors, so there's no need to complicate
the API any further.
|