Commit Graph

281 Commits

Author SHA1 Message Date
Petri Lehtinen
42621370c3 hashtable: Fix typo in comment 2010-02-11 21:17:19 +02:00
Petri Lehtinen
8e61b7c0f0 Merge branch 'c++-enhance-proxies' 2010-02-11 21:06:19 +02:00
Petri Lehtinen
35ddd2de20 Update CHANGES, change version to 1.2+ 2010-02-11 20:55:56 +02:00
Petri Lehtinen
f18ef5144a Implement JSON_PRESERVE_ORDER encoding flag
With this encoding flag, the object key-value pairs in output are in
the same order in which they were first inserted into the object.

To make this possible, a key of an object is now a serial number plus
a string. An object keeps an increasing counter which is used to
assign serial number to the keys. Hashing, comparison and public API
functions were changed to act only on the string part, i.e. the serial
number is ignored everywhere else but in the encoder, where it's used
to order object keys if JSON_PRESERVE_ORDER flag is used.
2010-02-11 20:48:56 +02:00
Petri Lehtinen
307167fb66 Optimize hashtable_set()
If a key already exists in the hashtable, use the existing pair
changing its value instead of removing the old one and allocating a
new pair.
2010-02-09 20:51:25 +02:00
Petri Lehtinen
7e8b128740 C++: Optimize PropertyProxy
When the property already exists in the object, we can store an
iterator pointing to that property, instead of duplicating the key.

When the property (key) is not present in the object, we still have to
duplicate the key.
2010-02-08 20:51:09 +02:00
Petri Lehtinen
acec2559a5 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.
2010-02-07 14:08:54 +02:00
Petri Lehtinen
286823227c Make int32_t available on all systems
Use AC_TYPE_INT32_T and include inttypes.h (if it exists) instead of
stdint.h for maximum portability.
2010-02-06 21:11:41 +02:00
Petri Lehtinen
8d75235ff2 Merge branch '1.2'
Conflicts:
	LICENSE
2010-02-04 21:13:57 +02:00
Petri Lehtinen
79e9dae9a0 Merge branch 'cleanup-c++-code' 2010-02-04 21:12:36 +02:00
Petri Lehtinen
f021ba00a2 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.
2010-02-04 21:10:04 +02:00
Petri Lehtinen
adb1b58627 C++: Add Value::dump_file(), load_file() and loads() that take an std::string 2010-02-04 21:08:42 +02:00
Petri Lehtinen
b8059a1880 C++: Rename some functions to better match the C API
Value::save_file -> Value::dump_file
Value::save_string -> Value::dumps
load_string -> loads
2010-02-04 21:08:38 +02:00
Petri Lehtinen
49d40f020b 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.
2010-02-04 20:50:02 +02:00
Petri Lehtinen
910a2f318b C++: Rename test.json to test_cpp.json 2010-02-04 20:49:01 +02:00
Petri Lehtinen
08dc8d9baf Add year 2010 to copyright notices 2010-02-02 21:26:11 +02:00
Petri Lehtinen
c9fc055351 Add myself as another copyright holder for jansson.hpp and jansson.ipp 2010-02-02 21:14:50 +02:00
Petri Lehtinen
d1a0c3ffc2 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().
2010-02-02 21:10:58 +02:00
Petri Lehtinen
b07e69c37a C++: Rename namespace json::_private to json::detail 2010-02-02 21:01:50 +02:00
Petri Lehtinen
2b43e7dbda C++: Untabify, reindent, delete trailing whitespace 2010-02-02 21:00:10 +02:00
Petri Lehtinen
5b1a666cf1 test/suites/api: Detect tests correctly
The C++ test case didn't work correctly in VPATH builds or with
VALGRIND=1.
2010-02-02 20:37:02 +02:00
Petri Lehtinen
b495b96547 Add functions json_object_iter_{at,set,set_new} 2010-02-01 21:07:19 +02:00
Petri Lehtinen
72e3948438 Merge branch '1.2' 2010-01-28 21:05:19 +02:00
Petri Lehtinen
f5662a82cd test/suites/api/test_object.c: Enhance tests for iterators 2010-01-28 21:04:21 +02:00
Petri Lehtinen
ab2e567685 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.
2010-01-28 20:58:26 +02:00
Petri Lehtinen
d8ea2f8c4b run-tests.sh: Print the test name correctly when VERBOSE=1 2010-01-28 20:57:52 +02:00
Petri Lehtinen
aaae37afba doc/Makefile.am: Don't remove changes.rst in clean 2010-01-26 21:19:48 +02:00
Petri Lehtinen
04f7e27877 Update LICENSE 2010-01-21 22:31:06 +02:00
Petri Lehtinen
3dd29366b8 Merge branch 'c++-api' 2010-01-21 22:29:26 +02:00
Petri Lehtinen
8c2ca3fae6 jansson 1.2 2010-01-21 21:49:10 +02:00
Petri Lehtinen
2ae279e0d4 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.
2010-01-21 21:49:04 +02:00
Petri Lehtinen
4c6cb6afd1 Distribute some missing files 2010-01-21 21:48:31 +02:00
Petri Lehtinen
78594e9bd3 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.
2010-01-21 20:53:05 +02:00
Petri Lehtinen
e921e63b54 CHANGES: Update for v1.2 2010-01-19 21:19:37 +02:00
Sean Middleditch
38950b081c add meaningful copyright to jansson-impl.hpp too 2010-01-18 21:55:41 -08:00
Sean Middleditch
56687e9b56 add meaningful copyright to jansson.hpp 2010-01-18 21:55:25 -08:00
Sean Middleditch
c9b33e3386 integrate jansson.hpp into build and test suite 2010-01-18 21:36:02 -08:00
Sean Middleditch
2ad4634de5 Merge branch 'master' of /home/elanthis/Source/janssonxx
Conflicts:
	.gitignore
2010-01-18 21:26:10 -08:00
Sean Middleditch
e080667729 replace json::from() with explicit Value() constructors 2010-01-18 19:24:25 -08:00
Sean Middleditch
ef6c35ae1b move static functions out of Value, add test driver to ensure linking works properly 2010-01-18 18:50:13 -08:00
Sean Middleditch
95bf762eeb rename jansson namespace to json 2010-01-18 18:37:13 -08:00
Petri Lehtinen
f9febb64c5 Merge branch '1.1'
Conflicts:
	Makefile.am
2010-01-17 13:57:20 +02:00
Sean Middleditch
dd36e4e838 rename files to match upstream's preferences 2010-01-16 20:27:13 -08:00
Sean Middleditch
df35adc438 add comments noting inefficiency of stream ops 2010-01-16 20:21:52 -08:00
Sean Middleditch
f88a5a0e6b added a couple minor comments 2010-01-16 20:17:48 -08:00
Sean Middleditch
cc06bc334a cleanup code 2010-01-16 20:15:33 -08:00
Sean Middleditch
2dc2b6bab7 rename ArrayProxy to ElementProxy and ObjectProxy to PropertyProxy 2010-01-16 01:40:16 -08:00
Sean Middleditch
49a64a6edf rename and move the _* private classes to _private namespace 2010-01-16 01:36:13 -08:00
Sean Middleditch
f0be52f9f8 add object property proxy support 2010-01-16 01:31:37 -08:00
Sean Middleditch
1bc0225441 add array element proxy support 2010-01-16 01:24:27 -08:00