Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-02-21 17:30:31


Raw pointers to prmitives can't be serialized without some extra effort.

In your case, the easiet would be to create a string from your char data
and serialize it. When you load it, deserialize to a string then take the
pointer.

Robert Ramey

Surya Kiran Gullapalli wrote:
> I've modified my code and did something like this.
>
> std::stringstream ss ;
> boost::archive::binary_oarchive oa (ss) ;
> os << class_obj ;
>
> so i'm sending data to db api as
> (void *)ss.
>
> To retrieve data, I'm using something like this
>
> data=db.get_data() ;
> istringstream is (ios_base::binary) ;
> is << (char *)data.get_data() ;
> boost::archive::binary_iarchive (is) ;
>
> This time I'm getting stream_error exception.
>
> what I'm not able to figure out was how can i create a stringstream
> object from void * pointer.
>
> Thanks,
> Surya


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