How to serialize classes Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
knuth
Knows some wx things
Knows some wx things
Posts: 41
Joined: Wed Sep 10, 2008 7:32 pm

How to serialize classes

Post by knuth »

How do I serialize/deserialize a class in c++ and (with) wxWidgets?

I want a class in a string/wxString form and after i do things with it (save to a file , load, etc) i want to deserialize it -> put the data in a new object.

Tanx in advance.
User avatar
tierra
Site Admin
Site Admin
Posts: 1355
Joined: Sun Aug 29, 2004 7:14 pm
Location: Salt Lake City, Utah, USA
Contact:

Post by tierra »

wxWidgets doesn't provide anything to do this. I think most people resort to using boost::serialization, but there's other serialization libraries out there too I think.
User avatar
T-Rex
Moderator
Moderator
Posts: 1249
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Post by T-Rex »

I'm using wxXmlSerializer from wxCode and it works fine for me.
vsp
Knows some wx things
Knows some wx things
Posts: 35
Joined: Mon Feb 21, 2005 12:52 pm

Post by vsp »

If you want to serialize to binary file, then you can use wxSerialize like CArchive in MFC.
vsp
Knows some wx things
Knows some wx things
Posts: 35
Joined: Mon Feb 21, 2005 12:52 pm

Post by vsp »

If you want to serialize to binary file, then you can use wxSerialize like CArchive in MFC.
knuth
Knows some wx things
Knows some wx things
Posts: 41
Joined: Wed Sep 10, 2008 7:32 pm

Post by knuth »

Tanx guys for your answers.

I haven't tried wxXmlSerializer nor wxSerialize ;
Just played a little bit with boost. I hope it'll do his job.

Cheers
Post Reply