Boost logo

Boost Users :

From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2005-08-12 11:12:25


In using xml_archive_exception, I find that I need to #include
<boost/archive/basic_xml_archive.hpp>. This required searching through the
boost directory since the documentation does not mention this requirement.
The only mention in the docs is to #include
<boost/archive/archive_exception.hpp>, which is insufficient. I would have
expected that xml_archive_exception is part of the interface for an
xml_(i|o)archive and would be included when #include-ing
<boost/archive/xml_(i|o)archive.hpp>. Alternatively, perhaps this class
should be placed in <boost/archive/xml_archive_exception.hpp> and documented
as such, to be consistent with <boost/archive/archive_exception.hpp>.

Additionally, I find the overlap of exception_code misleading when
debugging. I caught an archive_exception& and and code returns 0 -
'no_exception'( within the context of an archive_exception ). At this point
what() returns null also. Of course, catching an xml_archive_exception helps
because what() returns a reasonable description.

I run into the above, when loading a file, but that file was generated by a
legacy product(not xml or an archive). I had (erroneously)expected that
xml_archive would throw an xml_archive_exception equivalent to
exception_code==invalid_signature. It would be nice to have a some better
granularity on archive_parsing_error, that would tell me that the input does
not start with an xml header, or it's xml but not an xml_archive, or it
passed those two, and some other error occurs.


Jeff Flinn

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at