Update contrib.
1 #ifndef BOOST_ARCHIVE_XML_WIARCHIVE_HPP
2 #define BOOST_ARCHIVE_XML_WIARCHIVE_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/config.hpp>
20 #ifdef BOOST_NO_STD_WSTREAMBUF
21 #error "wide char i/o not supported on this platform"
26 //#include <boost/scoped_ptr.hpp>
27 #include <boost/archive/detail/auto_link_warchive.hpp>
28 #include <boost/archive/basic_text_iprimitive.hpp>
29 #include <boost/archive/basic_xml_iarchive.hpp>
31 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
36 template<class CharType>
37 class basic_xml_grammar;
38 typedef basic_xml_grammar<wchar_t> xml_wgrammar;
40 template<class Archive>
41 class xml_wiarchive_impl :
42 public basic_text_iprimitive<std::wistream>,
43 public basic_xml_iarchive<Archive>
45 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
48 friend class detail::interface_iarchive<Archive>;
49 friend class basic_xml_iarchive<Archive>;
50 friend class load_access;
53 // instances of micro xml parser to parse start preambles
54 // scoped_ptr doesn't play nice with borland - so use a naked pointer
55 // scoped_ptr<xml_wgrammar> gimpl;
57 std::wistream & get_is(){
62 basic_text_iprimitive<std::wistream>::load(t);
64 BOOST_WARCHIVE_DECL(void)
66 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
67 BOOST_WARCHIVE_DECL(void)
70 BOOST_WARCHIVE_DECL(void)
72 #ifndef BOOST_NO_STD_WSTRING
73 BOOST_WARCHIVE_DECL(void)
74 load(std::wstring &ws);
77 void load_override(T & t, BOOST_PFTO int){
78 basic_xml_iarchive<Archive>::load_override(t, 0);
80 BOOST_WARCHIVE_DECL(void)
81 load_override(class_name_type & t, int);
82 BOOST_WARCHIVE_DECL(void)
84 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
85 xml_wiarchive_impl(std::wistream & is, unsigned int flags) ;
86 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
87 ~xml_wiarchive_impl();
90 // we use the following because we can't use
91 // typedef xml_wiarchive_impl<xml_wiarchive_impl<...> > xml_wiarchive;
93 // do not derive from this class. If you want to extend this functionality
94 // via inhertance, derived from xml_wiarchive_impl instead. This will
95 // preserve correct static polymorphism.
97 public xml_wiarchive_impl<xml_wiarchive>
100 xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
101 xml_wiarchive_impl<xml_wiarchive>(is, flags)
106 } // namespace archive
109 // required by smart_cast for compilers not implementing
110 // partial template specialization
111 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_wiarchive)
113 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
115 #endif // BOOST_NO_STD_WSTREAMBUF
116 #endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP