1 #ifndef BOOST_ARCHIVE_XML_WOARCHIVE_HPP
2 #define BOOST_ARCHIVE_XML_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>
20 #ifdef BOOST_NO_STD_WSTREAMBUF
21 #error "wide char i/o not supported on this platform"
24 #include <cstddef> // size_t
25 #if defined(BOOST_NO_STDC_NAMESPACE)
33 #include <boost/archive/detail/auto_link_warchive.hpp>
34 #include <boost/archive/basic_text_oprimitive.hpp>
35 #include <boost/archive/basic_xml_oarchive.hpp>
37 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
43 BOOST_WARCHIVE_DECL(std::wostream
&)
44 operator<<(std::wostream
&os
, const char *t
);
46 BOOST_WARCHIVE_DECL(std::wostream
&)
47 operator<<(std::wostream
&os
, const char t
);
50 template<class Archive
>
51 class xml_woarchive_impl
:
52 public basic_text_oprimitive
<std::wostream
>,
53 public basic_xml_oarchive
<Archive
>
55 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
58 friend class detail::interface_oarchive
<Archive
>;
59 friend class basic_xml_oarchive
<Archive
>;
60 friend class save_access
;
63 //void end_preamble(){
64 // basic_xml_oarchive<Archive>::end_preamble();
69 basic_text_oprimitive
<std::wostream
>::save(t
);
71 BOOST_WARCHIVE_DECL(void)
73 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
74 BOOST_WARCHIVE_DECL(void)
75 save(const wchar_t * t
);
77 BOOST_WARCHIVE_DECL(void)
78 save(const std::string
&s
);
79 #ifndef BOOST_NO_STD_WSTRING
80 BOOST_WARCHIVE_DECL(void)
81 save(const std::wstring
&ws
);
83 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
84 xml_woarchive_impl(std::wostream
& os
, unsigned int flags
);
85 ~xml_woarchive_impl(){}
88 save_binary(const void *address
, std::size_t count
){
90 #if ! defined(__MWERKS__)
91 this->basic_text_oprimitive
<std::wostream
>::save_binary(
93 this->basic_text_oprimitive::save_binary(
98 this->indent_next
= true;
102 // we use the following because we can't use
103 // typedef xml_woarchive_impl<xml_woarchive_impl<...> > xml_woarchive;
105 // do not derive from this class. If you want to extend this functionality
106 // via inhertance, derived from xml_woarchive_impl instead. This will
107 // preserve correct static polymorphism.
108 class xml_woarchive
:
109 public xml_woarchive_impl
<xml_woarchive
>
112 xml_woarchive(std::wostream
& os
, unsigned int flags
= 0) :
113 xml_woarchive_impl
<xml_woarchive
>(os
, flags
)
118 typedef xml_woarchive naked_xml_woarchive
;
120 } // namespace archive
123 // required by export
124 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_woarchive
)
126 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
128 #endif // BOOST_NO_STD_WSTREAMBUF
129 #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP