Back to home page

EIC code displayed by LXR

 
 

    


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 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // xml_woarchive.hpp
0011 
0012 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
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 } // namespace std
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 } // namespace detail
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     //void end_preamble(){
0066     //    basic_xml_oarchive<Archive>::end_preamble();
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 // we use the following because we can't use
0104 // typedef xml_woarchive_impl<xml_woarchive_impl<...> > xml_woarchive;
0105 
0106 // do not derive from this class.  If you want to extend this functionality
0107 // via inheritance, derived from xml_woarchive_impl instead.  This will
0108 // preserve correct static polymorphism.
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 } // namespace archive
0123 } // namespace boost
0124 
0125 // required by export
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 // BOOST_NO_STD_WSTREAMBUF
0135 #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP