summaryrefslogtreecommitdiff
path: root/json-glib/json-generator.c
Commit message (Collapse)AuthorAgeFilesLines
* Escape to special characters in JsonGeneratorbug-958Emmanuele Bassi2008-06-131-1/+16
| | | | | | | | | | | | When using json-glib to write a blog system, some deserialized objects were not been interpreted by javascript because there were line breaks in generated strings. Patch from Lincoln de Sousa. Bug #958 - JsonGenerator does not escape special characters Signed-off-by: Emmanuele Bassi <ebassi@openedhand.com>
* Wrap config.h include with conditionalsEmmanuele Bassi2007-12-251-0/+2
| | | | | Including the autotools generated config.h should always be conditional on the HAVE_CONFIG_H definitions.
* Do not leak the intermediate strings when generating JSONEmmanuele Bassi2007-12-251-0/+6
| | | | Found this very dumb leak while using Valgrind.
* Use a unicode character for the indent-char property of JsonGeneratorEmmanuele Bassi2007-11-211-8/+8
| | | | | The indent character should be any Unicode character available instead of a generic char.
* Add the indent-char property to JsonGeneratorEmmanuele Bassi2007-11-211-14/+40
| | | | | The JsonGenerator:indent-char can be used to control the character that indents the lines when pretty printing.
* Use G_TYPE_DOUBLE when dumping a value.Emmanuele Bassi2007-11-211-2/+2
| | | | | JsonNode of type value for floating point numbers is G_TYPE_DOUBLE and not G_TYPE_FLOAT anymore.
* Add the JsonGenerator:root propertyEmmanuele Bassi2007-11-131-2/+28
| | | | | | | | | | | | | | | | JsonGenerator now has a :root property, so it can be constructed using just g_object_new(): generator = g_object_new (JSON_TYPE_GENERATOR, "pretty", TRUE, "indent", 4, "root", node, NULL); This means that the root node is copied inside the generator, instead of just taking ownership (it was quite confusing). The documentation now clearly states what happens, and that you can safely free the node after feeding it to the JsonGenerator.
* Fix the compiler fixesEmmanuele Bassi2007-10-161-4/+6
| | | | | This is what happens when you fix a compiler warning about a shadowing variable and you don't run the test suite to check the results.
* Fix compilation errors with extra maintainer CFLAGSEmmanuele Bassi2007-10-161-8/+8
|
* Add objects supportEmmanuele Bassi2007-10-021-3/+122
| | | | | JsonGenerator can now create objects and array-nested objects, with and without pretty printing. The test suite has been updated accordingly.
* Add nested arrays supportEmmanuele Bassi2007-10-011-0/+10
| | | | | JsonGenerator now supports nested arrays, both with and without pretty printing. The tests suite has been updated accordingly.
* Simple arrays generationEmmanuele Bassi2007-10-011-5/+155
| | | | | | | JsonGenerator now can create simple arrays, with "pretty" enabled and disabled. Simple arrays are just one-level, value-only arrays. The test unit has been updated to exercise this new feature.
* Move data types ctors and setters into the public headersEmmanuele Bassi2007-10-011-1/+0
| | | | | | | Now that we are providing a generator class we need to provide the constructors and setters for JsonNode, JsonObject and JsonArray. This also means that the json-private.h header is now useless, so we can remove it from the build and repository.
* Add stub class for JsonGeneratorEmmanuele Bassi2007-10-011-0/+255
JsonGenerator is an object that creates JSON data streams from a data model tree. This commit adds the JsonGenerator class to the build and API reference.