First public contribution.
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
42 BOOST_WARCHIVE_DECL(std::wostream &)
43 operator<<(std::wostream &os, const char *t);
45 BOOST_WARCHIVE_DECL(std::wostream &)
46 operator<<(std::wostream &os, const char t);
48 template<class Archive>
49 class xml_woarchive_impl :
50 public basic_text_oprimitive<std::wostream>,
51 public basic_xml_oarchive<Archive>
53 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
56 friend class detail::interface_oarchive<Archive>;
57 friend class basic_xml_oarchive<Archive>;
58 friend class save_access;
62 basic_xml_oarchive<Archive>::end_preamble();
67 basic_text_oprimitive<std::wostream>::save(t);
69 BOOST_WARCHIVE_DECL(void)
71 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
72 BOOST_WARCHIVE_DECL(void)
73 save(const wchar_t * t);
75 BOOST_WARCHIVE_DECL(void)
76 save(const std::string &s);
77 #ifndef BOOST_NO_STD_WSTRING
78 BOOST_WARCHIVE_DECL(void)
79 save(const std::wstring &ws);
81 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
82 xml_woarchive_impl(std::wostream & os, unsigned int flags);
83 ~xml_woarchive_impl(){}
86 save_binary(const void *address, std::size_t count){
88 #if ! defined(__MWERKS__)
89 this->basic_text_oprimitive<std::wostream>::save_binary(
91 this->basic_text_oprimitive::save_binary(
96 this->indent_next = true;
100 // we use the following because we can't use
101 // typedef xml_woarchive_impl<xml_woarchive_impl<...> > xml_woarchive;
103 // do not derive from this class. If you want to extend this functionality
104 // via inhertance, derived from xml_woarchive_impl instead. This will
105 // preserve correct static polymorphism.
106 class xml_woarchive :
107 public xml_woarchive_impl<xml_woarchive>
110 xml_woarchive(std::wostream & os, unsigned int flags = 0) :
111 xml_woarchive_impl<xml_woarchive>(os, flags)
116 } // namespace archive
119 // required by smart_cast for compilers not implementing
120 // partial template specialization
121 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_woarchive)
123 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
125 #endif // BOOST_NO_STD_WSTREAMBUF
126 #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP