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