1 #ifndef BOOST_ARCHIVE_XML_WOARCHIVE_HPP
2 #define BOOST_ARCHIVE_XML_WOARCHIVE_HPP
4 // MS compatible compilers support #pragma once
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"
23 #include <cstddef> // size_t
24 #if defined(BOOST_NO_STDC_NAMESPACE)
32 //#include <boost/smart_ptr/scoped_ptr.hpp>
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>
36 #include <boost/archive/detail/register_archive.hpp>
37 #include <boost/serialization/item_version_type.hpp>
38 //#include <boost/archive/detail/utf8_codecvt_facet.hpp>
40 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
43 # pragma warning(push)
44 # pragma warning(disable : 4511 4512)
51 template<class Archive> class interface_oarchive;
54 template<class Archive>
55 class BOOST_SYMBOL_VISIBLE xml_woarchive_impl :
56 public basic_text_oprimitive<std::wostream>,
57 public basic_xml_oarchive<Archive>
59 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
63 friend class detail::interface_oarchive<Archive>;
64 friend class basic_xml_oarchive<Archive>;
65 friend class save_access;
67 //void end_preamble(){
68 // basic_xml_oarchive<Archive>::end_preamble();
73 basic_text_oprimitive<std::wostream>::save(t);
76 save(const version_type & t){
77 save(static_cast<const unsigned int>(t));
80 save(const boost::serialization::item_version_type & t){
81 save(static_cast<const unsigned int>(t));
83 BOOST_WARCHIVE_DECL void
85 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
86 BOOST_WARCHIVE_DECL void
87 save(const wchar_t * t);
89 BOOST_WARCHIVE_DECL void
90 save(const std::string &s);
91 #ifndef BOOST_NO_STD_WSTRING
92 BOOST_WARCHIVE_DECL void
93 save(const std::wstring &ws);
96 xml_woarchive_impl(std::wostream & os, unsigned int flags);
98 ~xml_woarchive_impl();
100 BOOST_WARCHIVE_DECL void
101 save_binary(const void *address, std::size_t count);
105 // we use the following because we can't use
106 // typedef xml_woarchive_impl<xml_woarchive_impl<...> > xml_woarchive;
108 // do not derive from this class. If you want to extend this functionality
109 // via inhertance, derived from xml_woarchive_impl instead. This will
110 // preserve correct static polymorphism.
111 class BOOST_SYMBOL_VISIBLE xml_woarchive :
112 public xml_woarchive_impl<xml_woarchive>
115 xml_woarchive(std::wostream & os, unsigned int flags = 0) :
116 xml_woarchive_impl<xml_woarchive>(os, flags)
121 } // namespace archive
124 // required by export
125 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_woarchive)
131 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
133 #endif // BOOST_NO_STD_WSTREAMBUF
134 #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP