Andreas Aardal Hanssen schreef op 8-11-2013 13:28:
On 08 Nov 2013, at 12:41, Yves Bailly <[email protected]
<mailto:[email protected]>> wrote:
]I would recommend against using QDataStream for anything else than
reading back what was written using QDataStream.
This is what I called a step backward.
It's just stating a fact. QDataStream isn't a generic cross-framework
class, it's not based on any standard. Its internal structure is
completely undocumented.
Wrong. It *is* documented:
http://qt-project.org/doc/qt-4.8/datastreamformat.html
It's compatible only with itself, and then, only with specific
versions of itself. It even encodes the QDataStream format version in
the stream itself.
No, it does not. You actually should set the version used explicitly in
both the reader and the writer code especially _because_ the version is
not in the data stream.
So it's not a step backward. It's just a special-purpose class used
for more than it's designed for.
Personally I think using fstream or htons is perfectly fine. Both are
portable, beyond what QDataStream does.
I think that creating some "raw" class is ridiculous. It will end up
looking very, very much like QDataStream, only supporting less data
types. Seems like a pointless excersise to me.
André
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development