|
Boost Users : |
Subject: Re: [Boost-users] binary serialization, what's missing
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2009-11-25 10:52:49
Avi Bahra wrote:
> Jeff Wrote:
> >Are the underlying streams opened as binary?
> >
> >Jeff
>
> Yes, This is how I save, the the restore is analogous.
> Using boost 1.39
>
> void save(bool binary) const {
>
> if (binary) {
> std::ofstream ofs( fileName_.c_str(), ios::binary );
> boost::archive::binary_oarchive oa( ofs );
> oa << *this;
> }
> else {
> std::ofstream ofs( fileName_.c_str() );
> boost::archive::text_oarchive oa( ofs );
> oa << *this;
> }
> }
>
> Ok I was trying eventually to use the portable binary archive,
> however I suspect that would crash as well.
> I will try to create a standalone program that shows the crash using
> the binary archive first.
So are you saying you get a "Crash" when saving? Are you sure it
"crashes" or are you failing to catch an exception being thrown by the
serialization library?
Can you stream out to an ostringstream?
Jeff
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