But Qt can do this, you only need to tell what and how. Nokia can't provide serialisation of data for each and every case. That's why there is a mechanism to do this yourself.
Some suggestions to make it yourself a little bit easier.
Forget about the << and >> operators, instead do one of the following:
1. If you only need to send text and not binary data, use a QTextStream
2. If you need to send binary data too, use a QDataStream
In both cases, you can do one of the following:
1. Each segment of your stream has a certain predefined length (like in the old'en days), then you can parse it based on segment length.
2. Use a separator like a comma for example.
Both the above suggestions are stupid, you waste bandwidth in the first case and you make it yourself difficult by excluding control characters in the second case.
Therefor I suggest you use the following class:
http://doc.qt.nokia.com/4.6/qxmlstreamwriter.html
and
http://doc.qt.nokia.com/4.6/qxmlstreamreader.html
They are very easy to use and you can keep your code top level without going into the gory details. You can even plug those directly into a tcp socket.
Bookmarks