[Development] unified data model API in QtCore => thin wrapper proposal

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Wed Aug 22 16:46:39 CEST 2018


On 17 Aug 2018, at 17:08, Thiago Macieira <thiago.macieira at intel.com> wrote:
> 
> On Friday, 17 August 2018 02:50:32 PDT Tor Arne Vestbø wrote:
>>> Unless someone can volunteer to test. I *think* my design is slightly
>>> better than QJsonValue, so the following should work:
>>> 
>>> value[1]["hello"][32] = false;
>> 
>> That’s great news. I assume it’s also easy to convert from and to JSON, so
>> that one could use QCbor as an intermediate data format if one needs to
>> modify JSON In place and write it out again?
> 
> Please note I said that I *think* it should work, not that it does work. Could 
> you give it a try and see if it makes your life easier?
> 
> Now, looking at the code, I don't think it does work. I thought that 
> QCborValue::operator[] returned QCborValueRefs, but it doesn't. Adding a set 
> of non-const overloads returning QCborValueRef might be the trick. And it's a 
> trick we can add to QJsonValue too.
> 
> Converting from JSON is lossless and converting that content back to JSON is 
> lossless too. It's just not particularly efficient today.

This library looks really nice:

https://cocoapods.org/pods/nlohmann_json

Tor Arne 

> 
> -- 
> Thiago Macieira - thiago.macieira (AT) intel.com
>  Software Architect - Intel Open Source Technology Center
> 
> 
> 
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list