
13 Sep
2008
13 Sep
'08
6:52 p.m.
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