Petri Lehtinen [Sun, 7 Feb 2010 12:08:54 +0000 (14:08 +0200)]
C++: Make proxies safer
If a user happens to store an ElementProxy or a PropertyProxy
instance, we need to take a reference to the JSON value they point to.
With PropertyProxy, the key needs to be copied as well.
Petri Lehtinen [Thu, 4 Feb 2010 19:13:57 +0000 (21:13 +0200)]
Merge branch '1.2'
Conflicts:
LICENSE
Petri Lehtinen [Thu, 4 Feb 2010 19:12:36 +0000 (21:12 +0200)]
Merge branch 'cleanup-c++-code'
Petri Lehtinen [Thu, 4 Feb 2010 19:10:04 +0000 (21:10 +0200)]
C++: Fix test_cpp.cpp to work with VPATH builds
It reads an input file, and the file location is different with VPATH
builds. Read top_srcdir from environment and use it to find the file.
Petri Lehtinen [Thu, 4 Feb 2010 19:07:02 +0000 (21:07 +0200)]
C++: Add Value::dump_file(), load_file() and loads() that take an std::string
Petri Lehtinen [Thu, 4 Feb 2010 19:02:35 +0000 (21:02 +0200)]
C++: Rename some functions to better match the C API
Value::save_file -> Value::dump_file
Value::save_string -> Value::dumps
load_string -> loads
Petri Lehtinen [Thu, 4 Feb 2010 18:50:01 +0000 (20:50 +0200)]
C++: #include <cstdio> in jansson.hpp
This is to avoid standard C functions ending up in namespace json, as
jansson.h is #included in there, and jansson.h in turn #includes
stdio.h.
Petri Lehtinen [Thu, 4 Feb 2010 18:49:01 +0000 (20:49 +0200)]
C++: Rename test.json to test_cpp.json
Petri Lehtinen [Tue, 2 Feb 2010 19:26:11 +0000 (21:26 +0200)]
Add year 2010 to copyright notices
Petri Lehtinen [Tue, 2 Feb 2010 19:14:31 +0000 (21:14 +0200)]
Add myself as another copyright holder for jansson.hpp and jansson.ipp
Petri Lehtinen [Tue, 2 Feb 2010 19:10:57 +0000 (21:10 +0200)]
C++: Rename jansson-impl.hpp to jansson.ipp
The .ipp suffix is for inlined template implementation code.
While at it, use #ifdef and #ifndef instead of #if defined().
Petri Lehtinen [Tue, 2 Feb 2010 19:01:50 +0000 (21:01 +0200)]
C++: Rename namespace json::_private to json::detail
Petri Lehtinen [Tue, 2 Feb 2010 18:59:23 +0000 (20:59 +0200)]
C++: Untabify, reindent, delete trailing whitespace
Petri Lehtinen [Tue, 2 Feb 2010 18:37:00 +0000 (20:37 +0200)]
test/suites/api: Detect tests correctly
The C++ test case didn't work correctly in VPATH builds or with
VALGRIND=1.
Petri Lehtinen [Mon, 1 Feb 2010 19:01:24 +0000 (21:01 +0200)]
Add functions json_object_iter_{at,set,set_new}
Petri Lehtinen [Thu, 28 Jan 2010 19:05:19 +0000 (21:05 +0200)]
Merge branch '1.2'
Petri Lehtinen [Thu, 28 Jan 2010 19:04:21 +0000 (21:04 +0200)]
test/suites/api/test_object.c: Enhance tests for iterators
Petri Lehtinen [Thu, 28 Jan 2010 18:58:25 +0000 (20:58 +0200)]
test/suites/api: Fail when a test fails
The valgrind fix a while back apparently made the test system not
notice normal failures in suites/api.
Petri Lehtinen [Thu, 28 Jan 2010 18:57:52 +0000 (20:57 +0200)]
run-tests.sh: Print the test name correctly when VERBOSE=1
Petri Lehtinen [Tue, 26 Jan 2010 19:19:48 +0000 (21:19 +0200)]
doc/Makefile.am: Don't remove changes.rst in clean
Petri Lehtinen [Thu, 21 Jan 2010 20:31:06 +0000 (22:31 +0200)]
Update LICENSE
Petri Lehtinen [Thu, 21 Jan 2010 20:29:26 +0000 (22:29 +0200)]
Merge branch 'c++-api'
Petri Lehtinen [Thu, 21 Jan 2010 19:07:14 +0000 (21:07 +0200)]
jansson 1.2
Petri Lehtinen [Thu, 21 Jan 2010 18:59:56 +0000 (20:59 +0200)]
test/run-suites: Be less picky when searching for tests
This is to better catch distribution errors. It's easier to notice
that run-tests fails than to notice that one of many test suites is
silently skipped.
Petri Lehtinen [Thu, 21 Jan 2010 18:59:17 +0000 (20:59 +0200)]
Distribute some missing files
Petri Lehtinen [Thu, 21 Jan 2010 18:53:05 +0000 (20:53 +0200)]
Remove CHANGES preprocessing, as it didn't work with VPATH builds
The problem is that Sphinx can only read input files from a single
directory. In VPATH builds, the source and build trees are separate,
and the changes.rst went into the build tree.
This patch solves the issue by using cfunc as the Sphinx default role.
Petri Lehtinen [Tue, 19 Jan 2010 19:19:37 +0000 (21:19 +0200)]
CHANGES: Update for v1.2
Sean Middleditch [Tue, 19 Jan 2010 05:55:41 +0000 (21:55 -0800)]
add meaningful copyright to jansson-impl.hpp too
Sean Middleditch [Tue, 19 Jan 2010 05:55:25 +0000 (21:55 -0800)]
add meaningful copyright to jansson.hpp
Sean Middleditch [Tue, 19 Jan 2010 05:36:02 +0000 (21:36 -0800)]
integrate jansson.hpp into build and test suite
Sean Middleditch [Tue, 19 Jan 2010 05:26:10 +0000 (21:26 -0800)]
Merge branch 'master' of /home/elanthis/Source/janssonxx
Conflicts:
.gitignore
Sean Middleditch [Tue, 19 Jan 2010 03:24:25 +0000 (19:24 -0800)]
replace json::from() with explicit Value() constructors
Sean Middleditch [Tue, 19 Jan 2010 02:50:13 +0000 (18:50 -0800)]
move static functions out of Value, add test driver to ensure linking works properly
Sean Middleditch [Tue, 19 Jan 2010 02:37:13 +0000 (18:37 -0800)]
rename jansson namespace to json
Petri Lehtinen [Sun, 17 Jan 2010 11:57:20 +0000 (13:57 +0200)]
Merge branch '1.1'
Conflicts:
Makefile.am
Sean Middleditch [Sun, 17 Jan 2010 04:27:13 +0000 (20:27 -0800)]
rename files to match upstream's preferences
Sean Middleditch [Sun, 17 Jan 2010 04:21:52 +0000 (20:21 -0800)]
add comments noting inefficiency of stream ops
Sean Middleditch [Sun, 17 Jan 2010 04:17:48 +0000 (20:17 -0800)]
added a couple minor comments
Sean Middleditch [Sun, 17 Jan 2010 04:15:33 +0000 (20:15 -0800)]
cleanup code
Sean Middleditch [Sat, 16 Jan 2010 09:40:16 +0000 (01:40 -0800)]
rename ArrayProxy to ElementProxy and ObjectProxy to PropertyProxy
Sean Middleditch [Sat, 16 Jan 2010 09:36:13 +0000 (01:36 -0800)]
rename and move the _* private classes to _private namespace
Sean Middleditch [Sat, 16 Jan 2010 09:31:37 +0000 (01:31 -0800)]
add object property proxy support
Sean Middleditch [Sat, 16 Jan 2010 09:24:27 +0000 (01:24 -0800)]
add array element proxy support
Sean Middleditch [Sat, 16 Jan 2010 09:13:19 +0000 (01:13 -0800)]
templatize janssonxx functionality to prepare for proxy setters
Petri Lehtinen [Tue, 12 Jan 2010 19:58:52 +0000 (21:58 +0200)]
doc: Convert CHANGES to reStructuredText and add it to HTML docs
CHANGES is preprocessed to convert json_*() function names to Sphinx
:cfunc: cross references. This is to keep CHANGES more readable in
both plain text and HTML.
Sean Middleditch [Thu, 14 Jan 2010 02:35:07 +0000 (18:35 -0800)]
dont attempt to create a std::string from NULL in as_string()
Sean Middleditch [Thu, 14 Jan 2010 02:34:17 +0000 (18:34 -0800)]
save flags default to 0
Sean Middleditch [Thu, 14 Jan 2010 02:33:19 +0000 (18:33 -0800)]
add a safeguard against NULL return output stream
Sean Middleditch [Thu, 14 Jan 2010 02:32:44 +0000 (18:32 -0800)]
add Value::from(float)
Sean Middleditch [Wed, 13 Jan 2010 00:17:11 +0000 (16:17 -0800)]
insert and remove methods
Sean Middleditch [Wed, 13 Jan 2010 00:07:57 +0000 (16:07 -0800)]
add proper attribution to janssonxx.h
Sean Middleditch [Wed, 13 Jan 2010 00:03:27 +0000 (16:03 -0800)]
use different temporaries in tests instead of reusing e3
Sean Middleditch [Tue, 12 Jan 2010 23:38:47 +0000 (15:38 -0800)]
remove auto type conversion on array/object assignment
Sean Middleditch [Tue, 12 Jan 2010 23:33:36 +0000 (15:33 -0800)]
rename as_json_t to as_json
Sean Middleditch [Tue, 12 Jan 2010 23:29:45 +0000 (15:29 -0800)]
add (ugly) stream support
Sean Middleditch [Tue, 12 Jan 2010 23:14:57 +0000 (15:14 -0800)]
rename the set() methods
Petri Lehtinen [Tue, 12 Jan 2010 19:29:16 +0000 (21:29 +0200)]
Update documentation
* Python is no longer required to run the tests
* Mention pkg-config support
* Fix some errors
Sean Middleditch [Tue, 12 Jan 2010 12:30:02 +0000 (04:30 -0800)]
remove some unnecessary checks
Sean Middleditch [Tue, 12 Jan 2010 12:26:30 +0000 (04:26 -0800)]
cleanup the take_ownership function a bit
Sean Middleditch [Tue, 12 Jan 2010 12:20:17 +0000 (04:20 -0800)]
added save_file and save_string methods
Sean Middleditch [Tue, 12 Jan 2010 12:13:26 +0000 (04:13 -0800)]
include jansson.h inside the jansson namespace
Sean Middleditch [Tue, 12 Jan 2010 09:41:17 +0000 (01:41 -0800)]
test object property assignment and clear
Sean Middleditch [Tue, 12 Jan 2010 09:34:58 +0000 (01:34 -0800)]
expand array assignment tests
Sean Middleditch [Tue, 12 Jan 2010 09:31:08 +0000 (01:31 -0800)]
add link to Jansson web to README
Sean Middleditch [Tue, 12 Jan 2010 09:29:44 +0000 (01:29 -0800)]
added README
Sean Middleditch [Tue, 12 Jan 2010 09:26:47 +0000 (01:26 -0800)]
cleaner assignment behavior
Sean Middleditch [Tue, 12 Jan 2010 09:10:38 +0000 (01:10 -0800)]
ignore test-bin output file
Sean Middleditch [Tue, 12 Jan 2010 09:10:20 +0000 (01:10 -0800)]
add tests
Sean Middleditch [Tue, 12 Jan 2010 09:10:09 +0000 (01:10 -0800)]
initial commit of janssonxx.h
Petri Lehtinen [Sun, 10 Jan 2010 19:01:59 +0000 (21:01 +0200)]
Fix memory leaks in json_equal() tests
Petri Lehtinen [Sun, 10 Jan 2010 19:01:07 +0000 (21:01 +0200)]
Fix memory leaks in json_*_deep_copy()
Petri Lehtinen [Sun, 10 Jan 2010 14:18:45 +0000 (16:18 +0200)]
Enable Valgrind support in the API suite
It was accidentally left out when the test system was refactored.
Petri Lehtinen [Sun, 10 Jan 2010 12:39:04 +0000 (14:39 +0200)]
Use _nocheck functions internally for speed
There are some places where we copy a string from an existing JSON
value. In these cases the string has already been checked for valid
UTF-8.
Petri Lehtinen [Thu, 7 Jan 2010 17:28:00 +0000 (19:28 +0200)]
Add pkg-config support
Thanks to Sean Middleditch for contributing.
Petri Lehtinen [Thu, 31 Dec 2009 13:56:28 +0000 (15:56 +0200)]
Add functions for shallow and deep copying JSON values
Petri Lehtinen [Thu, 31 Dec 2009 15:39:36 +0000 (17:39 +0200)]
Add equality test for JSON values
Petri Lehtinen [Mon, 21 Dec 2009 12:00:57 +0000 (14:00 +0200)]
Add check-exports test
Petri Lehtinen [Mon, 21 Dec 2009 12:00:40 +0000 (14:00 +0200)]
Add _nocheck functions
Added functions are:
* json_string_nocheck()
* json_string_set_nocheck()
* json_object_set_nocheck()
* json_object_set_new_nocheck()
These functions don't check that their string argument is valid UTF-8,
but assume that the user has already performed the check.
Petri Lehtinen [Mon, 21 Dec 2009 12:13:05 +0000 (14:13 +0200)]
Merge branch '1.1'
Petri Lehtinen [Mon, 21 Dec 2009 12:01:59 +0000 (14:01 +0200)]
Remove const qualifier from the json_t parameter in json_*_set() functions.
It's incorrect as these functions modify the value.
Petri Lehtinen [Thu, 17 Dec 2009 22:03:38 +0000 (00:03 +0200)]
Fix tests for real
The tests were broken by the "%.17g" fix that was merged from the 1.1
branch.
Petri Lehtinen [Sun, 20 Dec 2009 19:18:27 +0000 (21:18 +0200)]
Merge branch '1.1'
Conflicts:
configure.ac
doc/conf.py
Petri Lehtinen [Wed, 16 Dec 2009 20:05:55 +0000 (22:05 +0200)]
Enhance tests
* Now that JSON_SORT_KEYS is implemented, take it into use with the
valid and valid-strip suites. This is to ensure that the tests
remain valid even if the string hash function is changed in the
future.
* Remove test_dump API test. Instead, implement the same tests more
elegantly in the encoding-flags suite.
Petri Lehtinen [Fri, 18 Dec 2009 19:43:12 +0000 (21:43 +0200)]
jansson 1.1.3
Petri Lehtinen [Thu, 17 Dec 2009 21:42:13 +0000 (23:42 +0200)]
Encode reals correctly
This patch changes the sprintf format from "%0.17f" to "%.17g", as the
f format specifier doesn't print the exponent at all. This caused
losing precision in all but the most simple cases.
Because the g specifier doesn't print the decimal fraction or exponent
if they're not needed, a ".0" has to be appended by hand in these
cases. Otherwise the value's type changes from real to integer when
decoding again.
Thanks to Philip Grandinetti for reporting this issue.
Petri Lehtinen [Mon, 7 Dec 2009 11:16:45 +0000 (13:16 +0200)]
Implement JSON_SORT_KEYS encoding flag
With this flag, the objects are sorted by key when encoding.
Petri Lehtinen [Mon, 14 Dec 2009 21:01:36 +0000 (23:01 +0200)]
Refactor the test system
Petri Lehtinen [Sat, 5 Dec 2009 20:55:30 +0000 (22:55 +0200)]
Implement JSON_ENSURE_ASCII encoding flag
With this flag, all Unicode characters outside the ASCII range are
escaped.
Petri Lehtinen [Wed, 2 Dec 2009 21:48:50 +0000 (23:48 +0200)]
Use int32_t instead of plain int with Unicode code points
On some architectures, int just isn't big enough to hold all Unicode
code points.
Petri Lehtinen [Sun, 29 Nov 2009 11:04:00 +0000 (13:04 +0200)]
Only export symbols starting with "json_" in libjansson.la
This way we don't pollute the symbol namespace with internal symbols.
Petri Lehtinen [Sun, 29 Nov 2009 11:00:47 +0000 (13:00 +0200)]
Make parse_json static
Petri Lehtinen [Sat, 28 Nov 2009 11:39:06 +0000 (13:39 +0200)]
doc/github_commits.c Add copyright notice
Petri Lehtinen [Sun, 8 Nov 2009 20:01:02 +0000 (22:01 +0200)]
Merge branch '1.1'
Conflicts:
configure.ac
doc/conf.py
Petri Lehtinen [Sun, 8 Nov 2009 12:13:32 +0000 (14:13 +0200)]
jansson 1.1.2
Petri Lehtinen [Sat, 7 Nov 2009 12:45:45 +0000 (14:45 +0200)]
Don't include stdint.h in jansson.h
It's not needed
Petri Lehtinen [Wed, 4 Nov 2009 20:10:46 +0000 (22:10 +0200)]
Merge branch '1.1'
Conflicts:
test/.gitignore
test/testprogs/Makefile.am
Petri Lehtinen [Wed, 4 Nov 2009 19:24:22 +0000 (21:24 +0200)]
dump: Revise whitespace usage
- Never append newline to output
- By default, add spaces between array and object items for more
readable output
- Introduce the flag JSON_COMPACT to not add the aforementioned spaces
Petri Lehtinen [Tue, 3 Nov 2009 21:07:43 +0000 (23:07 +0200)]
Build documentation in make html target
To keep the distchecks for the documentation, the documentation has to
be built in the check target instead of distcheck-hook.
While at it, rename doc/.build to doc/_build. This naming is the
default with sphinx 0.6.2.
Petri Lehtinen [Thu, 29 Oct 2009 13:42:05 +0000 (15:42 +0200)]
load: Parse a badly put - sign correctly
Thanks to Manolis Delakis for reporting.
Petri Lehtinen [Tue, 27 Oct 2009 15:46:57 +0000 (17:46 +0200)]
json_load_file: Initialize the error struct properly
Failing to do this has the effect that the error message is not
returned when the input file cannot be opened (e.g. if it doesn't
exist).
Thanks to Martin Vopatek for reporting.