Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BOOST_ARCHIVE_XML_IARCHIVE_HPP
0002 #define BOOST_ARCHIVE_XML_IARCHIVE_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_iarchive.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 <istream>
0020 
0021 #include <boost/scoped_ptr.hpp>
0022 #include <boost/archive/detail/auto_link_archive.hpp>
0023 #include <boost/archive/basic_text_iprimitive.hpp>
0024 #include <boost/archive/basic_xml_iarchive.hpp>
0025 #include <boost/archive/detail/register_archive.hpp>
0026 #include <boost/serialization/item_version_type.hpp>
0027 
0028 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0029 
0030 #ifdef BOOST_MSVC
0031 #  pragma warning(push)
0032 #  pragma warning(disable : 4511 4512)
0033 #endif
0034 
0035 namespace boost {
0036 namespace archive {
0037 
0038 namespace detail {
0039     template<class Archive> class interface_iarchive;
0040 } // namespace detail
0041 
0042 template<class CharType>
0043 class basic_xml_grammar;
0044 typedef basic_xml_grammar<char> xml_grammar;
0045 
0046 template<class Archive>
0047 class BOOST_SYMBOL_VISIBLE xml_iarchive_impl :
0048     public basic_text_iprimitive<std::istream>,
0049     public basic_xml_iarchive<Archive>
0050 {
0051 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0052 public:
0053 #else
0054 protected:
0055     friend class detail::interface_iarchive<Archive>;
0056     friend class basic_xml_iarchive<Archive>;
0057     friend class load_access;
0058 #endif
0059     // use boost:scoped_ptr to implement automatic deletion;
0060     boost::scoped_ptr<xml_grammar> gimpl;
0061 
0062     std::istream & get_is(){
0063         return is;
0064     }
0065     template<class T>
0066     void load(T & t){
0067         basic_text_iprimitive<std::istream>::load(t);
0068     }
0069     void
0070     load(version_type & t){
0071         unsigned int v;
0072         load(v);
0073         t = version_type(v);
0074     }
0075     void
0076     load(boost::serialization::item_version_type & t){
0077         unsigned int v;
0078         load(v);
0079         t = boost::serialization::item_version_type(v);
0080     }
0081     BOOST_ARCHIVE_DECL void
0082     load(char * t);
0083     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
0084     BOOST_ARCHIVE_DECL void
0085     load(wchar_t * t);
0086     #endif
0087     BOOST_ARCHIVE_DECL void
0088     load(std::string &s);
0089     #ifndef BOOST_NO_STD_WSTRING
0090     BOOST_ARCHIVE_DECL void
0091     load(std::wstring &ws);
0092     #endif
0093     template<class T>
0094     void load_override(T & t){
0095         basic_xml_iarchive<Archive>::load_override(t);
0096     }
0097     BOOST_ARCHIVE_DECL void
0098     load_override(class_name_type & t);
0099     BOOST_ARCHIVE_DECL void
0100     init();
0101     BOOST_ARCHIVE_DECL
0102     xml_iarchive_impl(std::istream & is, unsigned int flags);
0103     BOOST_ARCHIVE_DECL
0104     ~xml_iarchive_impl() BOOST_OVERRIDE;
0105 };
0106 
0107 } // namespace archive
0108 } // namespace boost
0109 
0110 #ifdef BOOST_MSVC
0111 #pragma warning(pop)
0112 #endif
0113 
0114 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0115 #ifdef BOOST_MSVC
0116 #  pragma warning(push)
0117 #  pragma warning(disable : 4511 4512)
0118 #endif
0119 
0120 namespace boost {
0121 namespace archive {
0122 
0123 class BOOST_SYMBOL_VISIBLE xml_iarchive :
0124     public xml_iarchive_impl<xml_iarchive>{
0125 public:
0126     xml_iarchive(std::istream & is, unsigned int flags = 0) :
0127         xml_iarchive_impl<xml_iarchive>(is, flags)
0128     {
0129         if(0 == (flags & no_header))
0130             init();
0131     }
0132     ~xml_iarchive() BOOST_OVERRIDE {}
0133 };
0134 
0135 } // namespace archive
0136 } // namespace boost
0137 
0138 // required by export
0139 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_iarchive)
0140 
0141 #ifdef BOOST_MSVC
0142 #pragma warning(pop)
0143 #endif
0144 
0145 #endif // BOOST_ARCHIVE_XML_IARCHIVE_HPP