can serialize multi-class into a single Archive?

I want to serialize multiple class into a single file. that's: class object {}; ofstream ofs; ofs.open("data.txt"); boost::archive::text_oarchive oa(ofs); while (get_next_object(object_t obj)) { oa << obj; } It is ok when I use text_iarchive to read back these objects. Now I want to append some objects to a Archive, I need to reopen the data file "data.txt" with (ios_base::app | ios_base::out), and serialize some object to the new-opend Archive. then when I use text_iarchive to load, I got error messages. I checked some manuals, and use boost::archive::no_header to skip the archive headers like "22 serialization::archive" when appending objects. but still I got error messages when loading. can anyone tell me how to store and append objects to a single Archive, and load correctly. tks.
participants (1)
-
pengdw