Boost logo

Boost Users :

Subject: [Boost-users] Serialization: storing different representations in different archive types
From: Simon Fraser (smfr_at_[hidden])
Date: 2008-09-13 14:52:39


I have a program that saves program state in both binary and XML
archives. I'd like to store one of the model objects in my program in
different formats, depending on whether the output archive is XML or
binary: for XML archives, I'd like to use a human readable-format, and
for binary archives I'd like to use a much more compact representation.

I don't see any methods on Archive that let me ask if the output is a
textual format (text or XML). I could dynamic_cast in my load/save
methods, but that doesn't extend to new kinds of archives that may be
implemented in future.

Is there a way to do what I want to do?

Thanks
Simon


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