Commit Graph

14 Commits

Author SHA1 Message Date
Max Bruckner cb6445f47b reformatting: cJSON_strcasecmp 2016-10-13 23:26:53 +07:00
Dave Gamble 3a7bd6924a Utility function to generate the patch between two objects. 2016-05-29 18:16:19 +01:00
Dave Gamble e79fa9472b cJSONUtils_MergePatch with tests from the RFC. 2016-05-29 17:39:54 +01:00
Kevin Branigan 361b9a58cb Merge pull request #19 from FSMaxB/fix_boolean
fix boolean expression
2015-10-18 17:03:47 -04:00
Max Bruckner 58bc383b28 fix memory leaks 2015-10-14 11:02:56 +02:00
Max Bruckner ec71726ef8 fix boolean expression
This expression was always false.
2015-10-13 20:33:37 +02:00
Dave Gamble 8004ed3115 Fix bug with the sort.
git-svn-id: svn://svn.code.sf.net/p/cjson/code@73 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-13 20:33:06 +00:00
Dave Gamble 174c62902c Since we anticipate repeated comparisons, add in a test for sorted lists, which can reduce
cost for sorted objects to O(N)


git-svn-id: svn://svn.code.sf.net/p/cjson/code@72 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-13 20:31:33 +00:00
Dave Gamble 491cf029b2 Rework cJSON_Utils object compare functions to use an O(N) algorithm on sorted lists.
It's a bit of a shame to use the sorts, because cJSON is otherwise incredibly stable (json->cJSON->json is unmodified modulo formatting),
but it means we get usable performance, rather than O(N^2) which will make CPUs cry.


git-svn-id: svn://svn.code.sf.net/p/cjson/code@71 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-13 19:53:27 +00:00
Dave Gamble c4ddd7aaa3 Correct comment and variable declaration style to be more compatible. Added cJSONUtils_SortObject for sorting the members of an object alphabetically.
git-svn-id: svn://svn.code.sf.net/p/cjson/code@70 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-13 19:19:26 +00:00
Dave Gamble 060e6563c0 Add more patch functionality and some more utils.
Also add a new #define to cJSON.h for SetNumberValue.


git-svn-id: svn://svn.code.sf.net/p/cjson/code@66 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-11 01:29:40 +00:00
Dave Gamble 3c6b3cc617 start of JSON Patch implementation. cJSON gained a cJSON_InsertItemToArray which pushes elements up by one.
This is needed for JSON Patch. Everything but Test is implemented for ApplyPatches.


git-svn-id: svn://svn.code.sf.net/p/cjson/code@65 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-10 14:17:59 +00:00
Dave Gamble 858671cc7f rework cJSONUtils_GetPointer to avoid malloc/free by using strcmp with pointer-encoding awareness.
git-svn-id: svn://svn.code.sf.net/p/cjson/code@64 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-10 12:14:59 +00:00
Dave Gamble c0f5e2056b add cJSON_Utils which includes JSON Pointer implementation
git-svn-id: svn://svn.code.sf.net/p/cjson/code@63 e3330c51-1366-4df0-8b21-3ccf24e3d50e
2015-02-09 18:29:05 +00:00