File indexing completed on 2025-01-18 09:28:30
0001 #ifndef BOOST_ARCHIVE_XML_WOARCHIVE_HPP
0002 #define BOOST_ARCHIVE_XML_WOARCHIVE_HPP
0003
0004
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <boost/config.hpp>
0020 #ifdef BOOST_NO_STD_WSTREAMBUF
0021 #error "wide char i/o not supported on this platform"
0022 #else
0023 #include <cstddef> // size_t
0024 #if defined(BOOST_NO_STDC_NAMESPACE)
0025 namespace std{
0026 using ::size_t;
0027 }
0028 #endif
0029
0030 #include <ostream>
0031
0032 #include <boost/archive/detail/auto_link_warchive.hpp>
0033 #include <boost/archive/basic_text_oprimitive.hpp>
0034 #include <boost/archive/basic_xml_oarchive.hpp>
0035 #include <boost/archive/detail/register_archive.hpp>
0036 #include <boost/serialization/item_version_type.hpp>
0037
0038 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0039
0040 #ifdef BOOST_MSVC
0041 # pragma warning(push)
0042 # pragma warning(disable : 4511 4512)
0043 #endif
0044
0045 namespace boost {
0046 namespace archive {
0047
0048 namespace detail {
0049 template<class Archive> class interface_oarchive;
0050 }
0051
0052 template<class Archive>
0053 class BOOST_SYMBOL_VISIBLE xml_woarchive_impl :
0054 public basic_text_oprimitive<std::wostream>,
0055 public basic_xml_oarchive<Archive>
0056 {
0057 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0058 public:
0059 #else
0060 protected:
0061 friend class detail::interface_oarchive<Archive>;
0062 friend class basic_xml_oarchive<Archive>;
0063 friend class save_access;
0064 #endif
0065
0066
0067
0068 template<class T>
0069 void
0070 save(const T & t){
0071 basic_text_oprimitive<std::wostream>::save(t);
0072 }
0073 void
0074 save(const version_type & t){
0075 save(static_cast<unsigned int>(t));
0076 }
0077 void
0078 save(const boost::serialization::item_version_type & t){
0079 save(static_cast<unsigned int>(t));
0080 }
0081 BOOST_WARCHIVE_DECL void
0082 save(const char * t);
0083 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
0084 BOOST_WARCHIVE_DECL void
0085 save(const wchar_t * t);
0086 #endif
0087 BOOST_WARCHIVE_DECL void
0088 save(const std::string &s);
0089 #ifndef BOOST_NO_STD_WSTRING
0090 BOOST_WARCHIVE_DECL void
0091 save(const std::wstring &ws);
0092 #endif
0093 BOOST_WARCHIVE_DECL
0094 xml_woarchive_impl(std::wostream & os, unsigned int flags);
0095 BOOST_WARCHIVE_DECL
0096 ~xml_woarchive_impl() BOOST_OVERRIDE;
0097 public:
0098 BOOST_WARCHIVE_DECL void
0099 save_binary(const void *address, std::size_t count);
0100
0101 };
0102
0103
0104
0105
0106
0107
0108
0109 class BOOST_SYMBOL_VISIBLE xml_woarchive :
0110 public xml_woarchive_impl<xml_woarchive>
0111 {
0112 public:
0113 xml_woarchive(std::wostream & os, unsigned int flags = 0) :
0114 xml_woarchive_impl<xml_woarchive>(os, flags)
0115 {
0116 if(0 == (flags & no_header))
0117 init();
0118 }
0119 ~xml_woarchive() BOOST_OVERRIDE {}
0120 };
0121
0122 }
0123 }
0124
0125
0126 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_woarchive)
0127
0128 #ifdef BOOST_MSVC
0129 #pragma warning(pop)
0130 #endif
0131
0132 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0133
0134 #endif
0135 #endif