[Interest] json file handling
Thiago Macieira
thiago.macieira at intel.com
Wed Apr 15 17:25:09 CEST 2015
On Wednesday 15 April 2015 16:36:15 André Somers wrote:
> > The dilemma I'm in is, how can I tell the json writer to "append" to a
> > current json file without loading the whole file back in memory (eg
> > read json from file->edit in Qt->write back to file). Because, after a
> > while, I suppose the file will get quite large.
>
> I don't think JSON is particulary suitable for this kind of application
> (and neither is XML).
CBOR might be, since it does support "undefined length" maps and arrays.
As for XML, the format may not be suitable but QXmlStreamWriter is since it
keeps the state of which tags it needs to close and allows you to simply
stream data into it. On the receiver side, QXmlStreamReader is capable of
receiving incomplete data and making the best it can with what has been
completed.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest
mailing list