21 Aug
2010
21 Aug
'10
6:49 p.m.
"Oscar Pernas"
Is posible with boost serialization to write different objects to the same file?
Yes. Just serialize them one after the other: ar << x; ar << y; // Not necessarily the same type as x All that matters is that you deserialize the same types in the same order.
is possible to access to each object with an iterator or with position like binary files?
I'm not sure what you mean. Can you give an example? There is no random access to archives. If the number of objects isn't known at compile time you could serialize the count first so that the deserialization code can find out how many to deserialize. You could also put your objects in an STL container, a vector for example, and serialize that.