summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Allow NULL as a value for strings, arrays and objectsjson-glib-0-10Emmanuele Bassi2010-09-253-18/+73
| | | | | | | | We should not warn when asking for a string, array or object if the contents were 'null'. (cherry picked from commit 3f8c8f99126dc1a70d847eded13afd4b64395250) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* Support for surrogate pairs in json string.Eiichi Sato2010-04-151-1/+15
| | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=615799 (cherry picked from commit fcd07918d3ed2b31b047900da9d2fed23dddf7da) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* docs: Fix typoEmmanuele Bassi2010-04-151-1/+1
| | | | | | | There is no such thing as a 'JsonArrary' type. (cherry picked from commit 28edd58ddfd719d107d89aa364dc208b0126c90f) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* Post-release version bump to 0.10.5Emmanuele Bassi2010-03-191-1/+1
|
* Release 0.10.40.10.4Emmanuele Bassi2010-03-192-1/+8
|
* parser: Refactor the JsonParser logicEmmanuele Bassi2010-03-191-288/+179
| | | | | | | | | | | | | | | | | | | | | | The array and object parsing logic in JsonParser has clearly exploded beyond control: a simple tightening of the JSON validation almost broke the parser in two. It it is time to... <cue Christopher Lee voice-over> REFACTOR THE CODE! </cue Christopher Lee voice-over> This time, we should be following the JSON state machine and try to do more prediction of the next state based on peeking the next token. The code is fairly cleaner, now; and, most of all, still passes the validation test suite - which is, you know... nice. (cherry picked from commit 08cec3b7c9202007a5abbf548f8d2f1b54d4d0b4) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* JSON-GLib bug tracking system has been movedEmmanuele Bassi2010-03-192-2/+2
| | | | | | | | We are now using bugzilla.gnome.org, since we're already hosted on git.gnome.org. (cherry picked from commit 9d7c58b4fb5edeb8e9413acc9d509447e13962e5) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* generator: Use %g format for g_ascii_formatd()Emmanuele Bassi2010-03-191-1/+1
| | | | | | | | | | | | | | I should read the documentation for the functions I use: Converts a gdouble to a string, using the '.' as decimal point. To format the number you pass in a printf()-style format string. Allowed conversion specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. -- from g_ascii_formatd() in GLib's API reference Epic reading fail. (cherry picked from commit f622ee8d8ba54ddea6fbb7311a905ffab7842e8d) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* tests: Add another trailing comma invalid testEmmanuele Bassi2010-03-051-1/+2
| | | | | | (cherry picked from commit 88ac0d5111eb528e4c396e4c169ceee4fb046e62) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* tests: Add negative testsEmmanuele Bassi2010-03-051-0/+53
| | | | | | | Verify that invalid JSON will trigger a parser error. (cherry picked from commit c22c1151e418af9506547804d4bc9fddb60bc0f1) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* parser: Improve strictnessEmmanuele Bassi2010-03-051-39/+78
| | | | | | | | | Apparently, some breakage crept in JsonParser which allowed invalid JSON to actually pass. For instance: trailing and missing commas, invalid barewords and wrong array and object closing braces. (cherry picked from commit 26668fe238a52a7fd8374f409fc277aaa8efa826) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* Post-release version bump to 0.10.3Emmanuele Bassi2010-02-261-2/+2
|
* Release 0.10.2 (stable snapshot)0.10.2Emmanuele Bassi2010-02-261-2/+2
|
* Update NEWS fileEmmanuele Bassi2010-02-261-0/+5
|
* docs: Fix the GBoxed registration exampleEmmanuele Bassi2010-01-241-5/+6
| | | | | | | The registration function for serialization and deserialization has been replaced by two separate functions before releasing 0.10, but I forgot to update the example in the documentation. (cherry picked from commit ea666891cb1e6fc9e527ce6c93a306bc97145f16)
* Initialize every member of JsonObject on constructionEmmanuele Bassi2010-01-101-0/+1
| | | | | | We create JsonObject structures using g_slice_new(), so we need to initialize every member of the structure ourselves. (cherry picked from commit c09c2dc1c54c83fea4ef93486081fe3fab35452c)
* Post-release version bump to 0.10.1Emmanuele Bassi2009-12-291-1/+1
|
* Release 0.10.00.10.0Emmanuele Bassi2009-12-291-2/+2
|
* build: Enable introspection when distcheckingEmmanuele Bassi2009-12-291-1/+1
|
* Initialize out variables before using themVincent Untz2009-12-291-2/+2
| | | | | | | | | | | Here's a small patch for json-glib, to fix some gcc warnings breaking the build with -Werror (gcc can't know if the variable will get initialized or not). I didn't find a product for json-glib in bugzilla, but I guess a mail will work ;-) Happy holidays :-) Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* Post-release bump to 0.9.3Emmanuele Bassi2009-11-291-1/+1
|
* Release 0.9.2 (0.10.0-rc1)0.9.2Emmanuele Bassi2009-11-291-1/+1
|
* Update NEWSEmmanuele Bassi2009-11-291-0/+15
|
* docs: Fix annotation for json_gobject_to_data()Emmanuele Bassi2009-11-291-1/+1
|
* docs: Add missing to/from_data methodsEmmanuele Bassi2009-11-291-0/+2
|
* docs: Add release notes to the READMEEmmanuele Bassi2009-11-291-2/+10
|
* docs: Update the READMEEmmanuele Bassi2009-11-291-11/+16
|
* build: Clean up the configure summaryEmmanuele Bassi2009-11-291-7/+20
| | | | Make the output of the summary a little bit nicer.
* build: Require G-I 0.6.4Emmanuele Bassi2009-11-291-1/+1
| | | | | We should require at least 0.6.4 for GObject-Introspection, since that version allows us to pass the .la file to g-ir-scanner.
* docs: Fix argument name mismatchEmmanuele Bassi2009-11-281-1/+1
| | | | | | gtk-doc complains that the argument name in the header does not match the one in the documentation annotation for the GBoxed deserialization function registration.
* build: Clean up json-glib/Makefile.am rulesEmmanuele Bassi2009-11-281-20/+4
|
* build: Fix out-of-tree enum types file generationEmmanuele Bassi2009-11-281-2/+2
|
* boxed: Split (de)serialization registrationEmmanuele Bassi2009-11-235-78/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A GBoxed type defined as: struct Boxed { int foo; gboolean bar; int baz; }; Can be represented either by a JSON object: { "foo" : 1, "bar" : true, "baz" : 3 } Or by a JSON array: [ 1, true, 3 ] The current function for registering a serialization and a deserialization pair does not allow registering more than one deserialization function - which means that there can only be one way to deserialize a GBoxed type into a specific JsonNode type. To allow having more than one JsonNodeType associated to a GBoxed type and a deserialization function we need to split out the registration of the serialization and deserialization functions into two distinct functions.
* serializable: Make Serializable in charge of parsingTristan Van Berkom2009-11-121-2/+5
| | | | | | | | | | | | | | If a GObject class implements JsonSerializable and has overridden the serialize_property() vfunc then the Serializable should be fully in charge of serializing a property - that is: JSON-GLib should not try to add a fallback in case the serialize_property() implementation returned NULL. This is a change in semantics for JsonSerializable implementations. http://bugzilla.openedhand.com/show_bug.cgi?id=1859 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* serializable: Add methods proxying default implementationsEmmanuele Bassi2009-11-123-9/+115
| | | | | | | | | | If you want to use the default implementation of serialize_property() and/or deserialize_property() from an object class implementing JsonSerializable you currently have to peek the interface vtable and then call the vfunc pointers. We can expose the default implementation through functions ourselves and simplify the required code.
* gobject: Add deprecation annotationsEmmanuele Bassi2009-11-121-2/+2
| | | | | This makes it easier to detect when building without JSON_DISABLE_DEPRECATED.
* build: Build without deprecationsEmmanuele Bassi2009-11-121-0/+1
| | | | Make sure that JSON-GLib is built without using deprecated API.
* tests: Do not use deprecated APIEmmanuele Bassi2009-11-125-6/+6
| | | | Tests should not be using API marked as deprecated.
* tests: Verify Serializable::serialize_property()Emmanuele Bassi2009-11-121-0/+32
| | | | | Verify that an object with a custom serialize_property() is effectively what we expect it to be when it is parsed.
* Doubles are converted to strings containing commasCornelius Hald2009-11-121-1/+6
| | | | | | | | | | | | Under some locales (e.g. de_DE) a double is converted to a string containing a comma instead of a dot. That breaks the JSON syntax. Example: Double: 0.34 is converted to 0,34 when using locale de_DE http://bugzilla.openedhand.com/show_bug.cgi?id=1826 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* Update Introspection annotationsEmmanuele Bassi2009-11-124-30/+33
| | | | | | | • Fix the transfer rules for JsonNode, JsonObject and JsonArray getters. • Annotate the methods returning lists
* build: Add more flags to the maintainer cflags listEmmanuele Bassi2009-11-121-1/+3
|
* enum-types: Put back a missing staticEmmanuele Bassi2009-11-121-1/+1
| | | | | | The GEnumValue array defining the enumeration type values must be static, otherwise everything will crash when trying to retrieve the enumeration data from the GEnumClass.
* object: Return values list in insertion orderEmmanuele Bassi2009-10-301-48/+7
| | | | | | | | | Since we return the member names in insertion order, we should also return the member values in the same order. This also allows us to get rid of the (yucky) internal copies of g_hash_table_get_keys() and g_hash_table_get_values(), since we use the hash table only for storage and lookup purposes.
* tests: Verify parsing bare valuesMathias Hasselmann2009-10-291-5/+33
| | | | | | http://bugzilla.openedhand.com/show_bug.cgi?id=1856 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* parser: Advance when parsing bare valuesEmmanuele Bassi2009-10-291-0/+1
| | | | | A missing get_next_token() prevents getting the contents of the tokenizer in order to place them into the JsonNode.
* introspection: Fix the GIR generationEmmanuele Bassi2009-10-281-3/+8
| | | | | | | | | The rule for creating the JSON-GLib GIR file should use the json-glib.la shared object, to avoid using the installed copy of JSON-GLib when compiling the typelib. The include file for JSON-GLib is json-glib/json-gobject.h as well: json-glib/json-object.h does not exist.
* gobject: Use from/to data naming conventionEmmanuele Bassi2009-10-282-4/+69
| | | | | | | | | | | | | | | | | | | | | | Be more GLib-like, and use <namespace>_<type>_from_data() <namespace>_<type>_to_data() Instead of the homebrew "construct" and "serialize", when dealing with string buffers. This means: • adding json_gobject_from_data() to deprecate json_construct_gobject() • adding json_gobject_to_data() to deprecate json_serialize_gobject() The json_construct_gobject() function also contains a mistake: it uses gsize with the special value of -1 meaning "slurp the whole string", but gsize is an unsigned type. The newly added json_gobject_from_data() correctly uses gssize instead.
* gobject: Uniform JSON<->GObject mapping codeEmmanuele Bassi2009-10-283-35/+61
| | | | | | | | | Rename json_gobject_new() to json_gobject_deserialize(), and json_gobject_dump() to json_gobject_serialize(); this maps the JSON GBoxed API. Also for consistency, change the serialize() return value and the deserialize() argument to be JsonNodes of type JSON_NODE_OBJECT.
* docs: Add long descriptionsEmmanuele Bassi2009-10-282-5/+49
| | | | | The json-boxed and json-serializable sections are missing the long description for the API reference.