Boost Users :
From: Bo Peng (ben.bob_at_[hidden])
Date: 2006-01-23 15:04:02
> I think the most practical way would be to try to create and archive with
> the "suspect" stream.
I am not quite sure what you mean since the files are written by
text_oarchive etc, and should be read by corresponding streams such as
text_iarchive. I do not know how to write some type information at the
beginning of the files and use a general iarchive to read it first.
> construction of an archive from a stream reads the serialization header. If
> the header doesn't contain what is expected - I think an exception is thrown.
This is what I am doing: try to guess the file type by file extension.
If fails, use try/catch to read the file using different iarchive
objects. I think it would be better to judge the file type by file
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net