1 #ifndef BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP
2 #define BOOST_ARCHIVE_TEXT_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/archive/detail/auto_link_warchive.hpp>
27 #include <boost/archive/basic_text_iprimitive.hpp>
28 #include <boost/archive/basic_text_iarchive.hpp>
30 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
35 template<class Archive
>
36 class text_wiarchive_impl
:
37 public basic_text_iprimitive
<std::wistream
>,
38 public basic_text_iarchive
<Archive
>
40 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
43 friend class detail::interface_iarchive
<Archive
>;
44 friend class basic_text_iarchive
<Archive
>;
45 friend class load_access
;
50 basic_text_iprimitive
<std::wistream
>::load(t
);
52 BOOST_WARCHIVE_DECL(void)
54 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
55 BOOST_WARCHIVE_DECL(void)
58 BOOST_WARCHIVE_DECL(void)
60 #ifndef BOOST_NO_STD_WSTRING
61 BOOST_WARCHIVE_DECL(void)
62 load(std::wstring
&ws
);
64 // note: the following should not needed - but one compiler (vc 7.1)
65 // fails to compile one test (test_shared_ptr) without it !!!
67 void load_override(T
& t
, BOOST_PFTO
int){
68 basic_text_iarchive
<Archive
>::load_override(t
, 0);
70 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
71 text_wiarchive_impl(std::wistream
& is
, unsigned int flags
);
72 ~text_wiarchive_impl(){};
75 // do not derive from the classes below. If you want to extend this functionality
76 // via inhertance, derived from text_iarchive_impl instead. This will
77 // preserve correct static polymorphism.
79 // same as text_wiarchive below - without the shared_ptr_helper
80 class naked_text_wiarchive
:
81 public text_wiarchive_impl
<naked_text_wiarchive
>
84 naked_text_wiarchive(std::wistream
& is
, unsigned int flags
= 0) :
85 text_wiarchive_impl
<naked_text_wiarchive
>(is
, flags
)
87 ~naked_text_wiarchive(){}
90 } // namespace archive
93 // note special treatment of shared_ptr. This type needs a special
94 // structure associated with every archive. We created a "mix-in"
95 // class to provide this functionality. Since shared_ptr holds a
96 // special esteem in the boost library - we included it here by default.
97 #include <boost/archive/shared_ptr_helper.hpp>
102 class text_wiarchive
:
103 public text_wiarchive_impl
<text_wiarchive
>,
104 public detail::shared_ptr_helper
107 text_wiarchive(std::wistream
& is
, unsigned int flags
= 0) :
108 text_wiarchive_impl
<text_wiarchive
>(is
, flags
)
113 } // namespace archive
116 // required by export
117 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_wiarchive
)
119 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
121 #endif // BOOST_NO_STD_WSTREAMBUF
122 #endif // BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP