Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:30

0001 #ifndef BOOST_ARCHIVE_XML_OARCHIVE_HPP
0002 #define BOOST_ARCHIVE_XML_OARCHIVE_HPP
0003 
0004 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // xml_oarchive.hpp
0011 
0012 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
0018 
0019 #include <ostream>
0020 
0021 #include <cstddef> // size_t
0022 #include <boost/config.hpp>
0023 #if defined(BOOST_NO_STDC_NAMESPACE)
0024 namespace std{
0025     using ::size_t;
0026 } // namespace std
0027 #endif
0028 
0029 #include <boost/archive/detail/auto_link_archive.hpp>
0030 #include <boost/archive/basic_text_oprimitive.hpp>
0031 #include <boost/archive/basic_xml_oarchive.hpp>
0032 #include <boost/archive/detail/register_archive.hpp>
0033 #include <boost/serialization/item_version_type.hpp>
0034 
0035 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0036 
0037 #ifdef BOOST_MSVC
0038 #  pragma warning(push)
0039 #  pragma warning(disable : 4511 4512)
0040 #endif
0041 
0042 namespace boost {
0043 namespace archive {
0044 
0045 namespace detail {
0046     template<class Archive> class interface_oarchive;
0047 } // namespace detail
0048 
0049 template<class Archive>
0050 class BOOST_SYMBOL_VISIBLE xml_oarchive_impl :
0051     public basic_text_oprimitive<std::ostream>,
0052     public basic_xml_oarchive<Archive>
0053 {
0054 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0055 public:
0056 #else
0057 protected:
0058     friend class detail::interface_oarchive<Archive>;
0059     friend class basic_xml_oarchive<Archive>;
0060     friend class save_access;
0061 #endif
0062     template<class T>
0063     void save(const T & t){
0064         basic_text_oprimitive<std::ostream>::save(t);
0065     }
0066     void
0067     save(const version_type & t){
0068         save(static_cast<unsigned int>(t));
0069     }
0070     void
0071     save(const boost::serialization::item_version_type & t){
0072         save(static_cast<unsigned int>(t));
0073     }
0074     BOOST_ARCHIVE_DECL void
0075     save(const char * t);
0076     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
0077     BOOST_ARCHIVE_DECL void
0078     save(const wchar_t * t);
0079     #endif
0080     BOOST_ARCHIVE_DECL void
0081     save(const std::string &s);
0082     #ifndef BOOST_NO_STD_WSTRING
0083     BOOST_ARCHIVE_DECL void
0084     save(const std::wstring &ws);
0085     #endif
0086     BOOST_ARCHIVE_DECL
0087     xml_oarchive_impl(std::ostream & os, unsigned int flags);
0088     BOOST_ARCHIVE_DECL
0089     ~xml_oarchive_impl() BOOST_OVERRIDE;
0090 public:
0091     BOOST_ARCHIVE_DECL
0092     void save_binary(const void *address, std::size_t count);
0093 };
0094 
0095 } // namespace archive
0096 } // namespace boost
0097 
0098 #ifdef BOOST_MSVC
0099 #pragma warning(pop)
0100 #endif
0101 
0102 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0103 #ifdef BOOST_MSVC
0104 #  pragma warning(push)
0105 #  pragma warning(disable : 4511 4512)
0106 #endif
0107 
0108 namespace boost {
0109 namespace archive {
0110 
0111 // we use the following because we can't use
0112 // typedef xml_oarchive_impl<xml_oarchive_impl<...> > xml_oarchive;
0113 
0114 // do not derive from this class.  If you want to extend this functionality
0115 // via inheritance, derived from xml_oarchive_impl instead.  This will
0116 // preserve correct static polymorphism.
0117 class BOOST_SYMBOL_VISIBLE xml_oarchive :
0118     public xml_oarchive_impl<xml_oarchive>
0119 {
0120 public:
0121     xml_oarchive(std::ostream & os, unsigned int flags = 0) :
0122         xml_oarchive_impl<xml_oarchive>(os, flags)
0123     {
0124         if(0 == (flags & no_header))
0125             init();
0126     }
0127     ~xml_oarchive() BOOST_OVERRIDE {}
0128 };
0129 
0130 } // namespace archive
0131 } // namespace boost
0132 
0133 // required by export
0134 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_oarchive)
0135 
0136 #ifdef BOOST_MSVC
0137 #pragma warning(pop)
0138 #endif
0139 
0140 #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP