On Wed 05 Feb 2014 09:41:05 AM EST, Corinne Krych wrote:
Rather than a text diff i’d like something that compares data
structure (JSON like) diff.
I can use google diff by serialiazing to string but it’s a plain text diff rather than
object diff. Guess you can patch the stringyfied object an then convert it back to json
structure but less elegant and flexible than jsondiffpatch on object.
If you go this route you need to make sure that things like order of
variables, order of items in an array/collection, etc always come out
the same way.
Also you need to make sure your stringified / merged JSON is still
valid JSON.
You may be off using hashing of your objects and doing set comparisons.
Unfortunately I do not know of a library which makes that "free". I
used that on the DevNexus demo.
++
Corinne
On 05 Feb 2014, at 11:23, Christos Vasilakis <cvasilak(a)gmail.com> wrote:
> Hi Corinne,
>
> i did came across the following diff-match lib[1] might be interested to digg more,
as I have seen they all derive from google-diff
>
> [1]
https://github.com/inquisitiveSoft/DiffMatchPatch-ObjC [+podspec]
>
>
>
> On Wed, Feb 5, 2014 at 10:49 AM, Corinne Krych <corinnekrych(a)gmail.com> wrote:
> Hello Ladies and Gentlemen,
>
> I was looking for some diff/patch libraries to get differences between 2 objects
(either json format of map/array format) ideally in iOS (withpodspec) or in C/C++. To plug
into custom conflict management in you sync demo app. Like Luke did using jsondiffpatch in
JS [1].
>
> For comparing text there is google-diff-match-patch [2] lib that is implemented in
several langagues and format (including iOS).
>
> But i couldn’t find a jsondiff liek lib for iOS… I’m asking my favourite oracle
(i.e.: the mailing list), see if i get more lucky.
>
> ++
> Corinne
> [1]
https://github.com/benjamine/JsonDiffPatch
> [2]
https://github.com/JanX2/google-diff-match-patch
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/aerogear-dev
_______________________________________________
aerogear-dev mailing list
aerogear-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev