TheKedge
5th April 2007, 14:35
Sorry if this is a silly question:
I've got a (very simple) class with lots of member variables. It's more like a 'struct' with a clear() function.
I want to get all the member variables written into a file (and later have the file read in again). I thought I might define operators '<<' and '>>' for the class.
But I still don't quite see it. That won't help my QDataStream, will it?
Instead, should I write a 'serialise(QDataStream& out)' and a 'QDataStream serialise()'
or 'QByteArray serialise()' and 'serialise(QByteArray)' and then write/read that to/from the file?
thanks
K
I've got a (very simple) class with lots of member variables. It's more like a 'struct' with a clear() function.
I want to get all the member variables written into a file (and later have the file read in again). I thought I might define operators '<<' and '>>' for the class.
But I still don't quite see it. That won't help my QDataStream, will it?
Instead, should I write a 'serialise(QDataStream& out)' and a 'QDataStream serialise()'
or 'QByteArray serialise()' and 'serialise(QByteArray)' and then write/read that to/from the file?
thanks
K