1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // basic_xml_iarchive.ipp:
4 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org for updates, documentation, and revision history.
11 #include <boost/assert.hpp>
12 #include <cstddef> // NULL
15 #include <boost/serialization/throw_exception.hpp>
16 #include <boost/archive/xml_archive_exception.hpp>
17 #include <boost/archive/basic_xml_iarchive.hpp>
18 #include <boost/serialization/tracking.hpp>
23 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
24 // implementation of xml_text_archive
26 template<class Archive>
27 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
28 basic_xml_iarchive<Archive>::load_start(const char *name){
32 bool result = this->This()->gimpl->parse_start_tag(this->This()->get_is());
34 boost::serialization::throw_exception(
35 archive_exception(archive_exception::input_stream_error)
38 // don't check start tag at highest level
42 template<class Archive>
43 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
44 basic_xml_iarchive<Archive>::load_end(const char *name){
48 bool result = this->This()->gimpl->parse_end_tag(this->This()->get_is());
50 boost::serialization::throw_exception(
51 archive_exception(archive_exception::input_stream_error)
55 // don't check start tag at highest level
59 if(0 == (this->get_flags() & no_xml_tag_checking)){
60 // double check that the tag matches what is expected - useful for debug
61 if(0 != name[this->This()->gimpl->rv.object_name.size()]
63 this->This()->gimpl->rv.object_name.begin(),
64 this->This()->gimpl->rv.object_name.end(),
68 boost::serialization::throw_exception(
69 xml_archive_exception(
70 xml_archive_exception::xml_archive_tag_mismatch,
78 template<class Archive>
79 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
80 basic_xml_iarchive<Archive>::load_override(object_id_type & t){
81 t = object_id_type(this->This()->gimpl->rv.object_id);
84 template<class Archive>
85 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
86 basic_xml_iarchive<Archive>::load_override(version_type & t){
87 t = version_type(this->This()->gimpl->rv.version);
90 template<class Archive>
91 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
92 basic_xml_iarchive<Archive>::load_override(class_id_type & t){
93 t = class_id_type(this->This()->gimpl->rv.class_id);
96 template<class Archive>
97 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
98 basic_xml_iarchive<Archive>::load_override(tracking_type & t){
99 t = this->This()->gimpl->rv.tracking_level;
102 template<class Archive>
103 BOOST_ARCHIVE_OR_WARCHIVE_DECL
104 basic_xml_iarchive<Archive>::basic_xml_iarchive(unsigned int flags) :
105 detail::common_iarchive<Archive>(flags),
108 template<class Archive>
109 BOOST_ARCHIVE_OR_WARCHIVE_DECL
110 basic_xml_iarchive<Archive>::~basic_xml_iarchive(){
113 } // namespace archive