File indexing completed on 2025-01-18 09:28:30
0001 #ifndef BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP
0002 #define BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP
0003
0004
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <boost/config.hpp>
0020 #include <boost/mpl/assert.hpp>
0021
0022 #include <boost/archive/detail/common_oarchive.hpp>
0023 #include <boost/serialization/nvp.hpp>
0024 #include <boost/serialization/string.hpp>
0025
0026 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0027
0028 #ifdef BOOST_MSVC
0029 # pragma warning(push)
0030 # pragma warning(disable : 4511 4512)
0031 #endif
0032
0033 namespace boost {
0034 namespace archive {
0035
0036 namespace detail {
0037 template<class Archive> class interface_oarchive;
0038 }
0039
0040
0041
0042 template<class Archive>
0043 class BOOST_SYMBOL_VISIBLE basic_xml_oarchive :
0044 public detail::common_oarchive<Archive>
0045 {
0046
0047 unsigned int depth;
0048 bool pending_preamble;
0049 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0050 public:
0051 #else
0052 protected:
0053 friend class detail::interface_oarchive<Archive>;
0054 #endif
0055 bool indent_next;
0056 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0057 indent();
0058 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0059 init();
0060 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0061 windup();
0062 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0063 write_attribute(
0064 const char *attribute_name,
0065 int t,
0066 const char *conjunction = "=\""
0067 );
0068 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0069 write_attribute(
0070 const char *attribute_name,
0071 const char *key
0072 );
0073
0074 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0075 save_start(const char *name);
0076 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0077 save_end(const char *name);
0078 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0079 end_preamble();
0080
0081
0082
0083 template<class T>
0084 void save_override(T & t)
0085 {
0086
0087
0088
0089 BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
0090 this->detail_common_oarchive::save_override(t);
0091 }
0092
0093
0094 typedef detail::common_oarchive<Archive> detail_common_oarchive;
0095 template<class T>
0096 void save_override(
0097 const ::boost::serialization::nvp< T > & t
0098 ){
0099 this->This()->save_start(t.name());
0100 this->detail_common_oarchive::save_override(t.const_value());
0101 this->This()->save_end(t.name());
0102 }
0103
0104
0105
0106 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0107 save_override(const class_id_type & t);
0108 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0109 save_override(const class_id_optional_type & t);
0110 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0111 save_override(const class_id_reference_type & t);
0112 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0113 save_override(const object_id_type & t);
0114 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0115 save_override(const object_reference_type & t);
0116 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0117 save_override(const version_type & t);
0118 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0119 save_override(const class_name_type & t);
0120 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0121 save_override(const tracking_type & t);
0122
0123 BOOST_ARCHIVE_OR_WARCHIVE_DECL
0124 basic_xml_oarchive(unsigned int flags);
0125 BOOST_ARCHIVE_OR_WARCHIVE_DECL
0126 ~basic_xml_oarchive() BOOST_OVERRIDE;
0127 };
0128
0129 }
0130 }
0131
0132 #ifdef BOOST_MSVC
0133 #pragma warning(pop)
0134 #endif
0135
0136 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0137
0138 #endif