Re: encoding c++ objects for file saving
Re: encoding c++ objects for file saving
- Subject: Re: encoding c++ objects for file saving
- From: "stephen joseph butler" <email@hidden>
- Date: Thu, 1 Mar 2007 11:09:46 -0600
2007/3/1, lina peterseil <email@hidden>:
Hi list,
I am wondering if anyone could help me!
I am trying to save a c++ object (which contains a member variable which is
a boost sparse array) to file using NSCoder methods. these metods only take
objective c objects, so i tried wrapping my c++ object in an objective c
class, this worked, but my c++ object member variables were nil coming back
out. I presume that i actually have to encode the member variables of my c++
class seperately. How do i do this, seeing as i need my objects to be
objective c if i want to encode or decode them?
Any suggestions would be appreciated!
Lina
Since you're already using Boost, you might want to consider Boost's
own serialization library:
<http://www.boost.org/libs/serialization/doc/index.html>. I'm not
familiar with it, but it looks like you should be able to serialize to
an array sink, and then take the bytes from that array and stuff it in
an NSData for Obj-C.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden