Update contrib.
1 #ifndef BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP
2 #define BOOST_ARCHIVE_TEXT_WOARCHIVE_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>
21 #ifdef BOOST_NO_STD_WSTREAMBUF
22 #error "wide char i/o not supported on this platform"
26 #include <cstddef> // size_t
28 #if defined(BOOST_NO_STDC_NAMESPACE)
34 #include <boost/archive/detail/auto_link_warchive.hpp>
35 #include <boost/archive/basic_text_oprimitive.hpp>
36 #include <boost/archive/basic_text_oarchive.hpp>
38 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
43 template<class Archive>
44 class text_woarchive_impl :
45 public basic_text_oprimitive<std::wostream>,
46 public basic_text_oarchive<Archive>
48 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
51 friend class detail::interface_oarchive<Archive>;
52 friend class basic_text_oarchive<Archive>;
53 friend class save_access;
57 void save(const T & t){
59 basic_text_oprimitive<std::wostream>::save(t);
61 BOOST_WARCHIVE_DECL(void)
63 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
64 BOOST_WARCHIVE_DECL(void)
65 save(const wchar_t * t);
67 BOOST_WARCHIVE_DECL(void)
68 save(const std::string &s);
69 #ifndef BOOST_NO_STD_WSTRING
70 BOOST_WARCHIVE_DECL(void)
71 save(const std::wstring &ws);
73 text_woarchive_impl(std::wostream & os, unsigned int flags) :
74 basic_text_oprimitive<std::wostream>(
76 0 != (flags & no_codecvt)
78 basic_text_oarchive<Archive>(flags)
80 if(0 == (flags & no_header))
81 basic_text_oarchive<Archive>::init();
84 void save_binary(const void *address, std::size_t count){
87 #if ! defined(__MWERKS__)
88 this->basic_text_oprimitive<std::wostream>::save_binary(
90 this->basic_text_oprimitive::save_binary(
96 this->delimiter = this->none;
101 // we use the following because we can't use
102 // typedef text_oarchive_impl<text_oarchive_impl<...> > text_oarchive;
104 // do not derive from this class. If you want to extend this functionality
105 // via inhertance, derived from text_oarchive_impl instead. This will
106 // preserve correct static polymorphism.
107 class text_woarchive :
108 public text_woarchive_impl<text_woarchive>
111 text_woarchive(std::wostream & os, unsigned int flags = 0) :
112 text_woarchive_impl<text_woarchive>(os, flags)
117 } // namespace archive
120 // required by smart_cast for compilers not implementing
121 // partial template specialization
122 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::text_woarchive)
124 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
126 #endif // BOOST_NO_STD_WSTREAMBUF
127 #endif // BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP