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

Thiago Macieira thiago.macieira at intel.com
Fri Aug 17 17:08:52 CEST 2018


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.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Development mailing list