Boost logo

Boost Users :

From: Gary Granger (granger_at_[hidden])
Date: 2007-04-23 14:48:01


I have just recently written classes where I derive from xml_oarchive
and xml_iarchive, and one of the extensions I added is to report the
stream location and other context (such as the tag name) when there's an
exception. I originally wrote the derived archives to cache the
serialized name/value pairs into a configuration "dictionary". The idea
is to be able to modify the dictionary at runtime, such as in a
configuration editor, and from the modified configuration restore or
reconfigure application objects. I have attached the implementation
file, in case you'd like to borrow the exception handling code, or
whatever. The references to a ConfigNode class are for the
configuration dictionary, but the archives can still be used with
regular iostreams to get the exception location reporting. It might
take some time to parse everything, and I'm sorry I don't have time to
explain it further, but maybe it will be a useful example.

As an aside, I also added support to these archives for embedding XML
data in CDATA sections rather than escaping them. The attached
xml_cdata.h is the wrapper for that.

gary





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