Boost logo

Boost Users :

Subject: [Boost-users] [serialization] mingw Deriving from boost::archive::xml_iarchive
From: Ken (ken.appleby_at_[hidden])
Date: 2012-06-23 08:51:52


Hi,

We have a boost archive class derived from
boost::archive::xml_iarchive_impl, like this:

class XmlInputArchive :
      public boost::archive::xml_iarchive_impl< XmlInputArchive >,
      public boost::archive::detail::shared_ptr_helper

Its purpose is to provide diagnostics information when deserialising xml
archive input, ie. which tag is failing.

In porting from 1_41 to 1_49 on mingw this no longer links because the
boost::archive::basic_xml_grammar<char> class's symbols are no longer
exported from the serialization library.

The functions this class overrides are the protected functions:

void load_start( const char * name );
void load_end( const char * name );

The existing boost::archive::xml_iarchive class derives from
xml_iarchive_impl, and as these functions are protected in the latter,
they are not available to a class derived from
boost::archive::xml_iarchive class directly. And, for the same reason,
we can't create an archive class that delegates to a
boost::archive::xml_iarchive instance.

So neither deriving from boost::archive::xml_iarchive nor using one as a
delegate are feasible solutions.

Is there a way of creating an xml_iarchive class that has access to the
load_start, load_end functions? Or perhaps there is another way to get
the diagnostics information about which xml tags are being processed?

Thanks,

Ken Appleby


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