Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP
0002 #define BOOST_ARCHIVE_TEXT_WIARCHIVE_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 // text_wiarchive.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 <boost/config.hpp>
0020 #ifdef BOOST_NO_STD_WSTREAMBUF
0021 #error "wide char i/o not supported on this platform"
0022 #else
0023 
0024 #include <istream>
0025 
0026 #include <boost/archive/detail/auto_link_warchive.hpp>
0027 #include <boost/archive/basic_text_iprimitive.hpp>
0028 #include <boost/archive/basic_text_iarchive.hpp>
0029 #include <boost/archive/detail/register_archive.hpp>
0030 #include <boost/serialization/item_version_type.hpp>
0031 
0032 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0033 
0034 #ifdef BOOST_MSVC
0035 #  pragma warning(push)
0036 #  pragma warning(disable : 4511 4512)
0037 #endif
0038 
0039 namespace boost {
0040 namespace archive {
0041 
0042 namespace detail {
0043     template<class Archive> class interface_iarchive;
0044 } // namespace detail
0045 
0046 template<class Archive>
0047 class BOOST_SYMBOL_VISIBLE text_wiarchive_impl :
0048     public basic_text_iprimitive<std::wistream>,
0049     public basic_text_iarchive<Archive>
0050 {
0051 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0052 public:
0053 #else
0054 protected:
0055     #if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
0056         // for some inexplicable reason insertion of "class" generates compile erro
0057         // on msvc 7.1
0058         friend detail::interface_iarchive<Archive>;
0059         friend load_access;
0060     #else
0061         friend class detail::interface_iarchive<Archive>;
0062         friend class load_access;
0063     #endif
0064 #endif
0065     template<class T>
0066     void load(T & t){
0067         basic_text_iprimitive<std::wistream>::load(t);
0068     }
0069     void load(version_type & t){
0070         unsigned int v;
0071         load(v);
0072         t = version_type(v);
0073     }
0074     void load(boost::serialization::item_version_type & t){
0075         unsigned int v;
0076         load(v);
0077         t = boost::serialization::item_version_type(v);
0078     }
0079     BOOST_WARCHIVE_DECL void
0080     load(char * t);
0081     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
0082     BOOST_WARCHIVE_DECL void
0083     load(wchar_t * t);
0084     #endif
0085     BOOST_WARCHIVE_DECL void
0086     load(std::string &s);
0087     #ifndef BOOST_NO_STD_WSTRING
0088     BOOST_WARCHIVE_DECL void
0089     load(std::wstring &ws);
0090     #endif
0091     template<class T>
0092     void load_override(T & t){
0093         basic_text_iarchive<Archive>::load_override(t);
0094     }
0095     BOOST_WARCHIVE_DECL
0096     text_wiarchive_impl(std::wistream & is, unsigned int flags);
0097     ~text_wiarchive_impl() BOOST_OVERRIDE {}
0098 };
0099 
0100 } // namespace archive
0101 } // namespace boost
0102 
0103 #ifdef BOOST_MSVC
0104 #pragma warning(pop)
0105 #endif
0106 
0107 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0108 
0109 #ifdef BOOST_MSVC
0110 #  pragma warning(push)
0111 #  pragma warning(disable : 4511 4512)
0112 #endif
0113 
0114 namespace boost {
0115 namespace archive {
0116 
0117 class BOOST_SYMBOL_VISIBLE text_wiarchive :
0118     public text_wiarchive_impl<text_wiarchive>{
0119 public:
0120     text_wiarchive(std::wistream & is, unsigned int flags = 0) :
0121         text_wiarchive_impl<text_wiarchive>(is, flags)
0122     {
0123         if(0 == (flags & no_header))
0124             init();
0125     }
0126     ~text_wiarchive() BOOST_OVERRIDE {}
0127 };
0128 
0129 } // namespace archive
0130 } // namespace boost
0131 
0132 // required by export
0133 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_wiarchive)
0134 
0135 #ifdef BOOST_MSVC
0136 #pragma warning(pop)
0137 #endif
0138 
0139 #endif // BOOST_NO_STD_WSTREAMBUF
0140 #endif // BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP