   How could I serialize my classes easily?
  Hi!I have a class that represents a level (it has monsters, platforms, characters classes associated...), it uses STL containers and QString (which I could remove)My question is: How can I save automatically those classes on hard disck? I mean, without writing large Load/Save/Traverse methods, is there any way or library or STL function?I know BOOST have something, but I see a lot of code lines. Does Qt have anything? What do you recommend me? Is it possible writing a couple of code lines?Thanks in advance.   
Quote:Original post by ricardo_ruiz_lopezI know BOOST have something, but I see a lot of code lines. Does Qt have anything? What do you recommend me? Is it possible writing a couple of code lines?I'm afraid not. The introspection capabilities of C++ are negligible so if you want a pure C++ solution, something like the boost serialization library is probably your best bet.Another thing you might do is manipulate all the data you want to serialize using a more dynamic language such as Python or Lua. Serialization using such a language is typically much easier. Doing this, however, would replace the burden of writing serialization functions with that of writing C++<->Dynamic language bridge, though that kind of thing isn't too difficult with libraries like boost.python and luabind.Even easier would be to write your code in a more dynamic language from the outset, possibly writing performance critical parts in C(++).   ;  How about using reintepret_cast to serialize in to a file ? ;  Serialization is by no means an easy feat, and it gets even harder the longer you wait to add the feature.  This reference comes up often, but it only shows you a handful of the most useful tools.  You still have to come up with the best way to use them, and possibly think up a few tools of your own.   ;  Thanks! I'll read it.   