Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:30

0001 #ifndef BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
0002 #define BOOST_ARCHIVE_TEXT_OARCHIVE_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 // text_oarchive.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 <ostream>
0020 #include <cstddef> // std::size_t
0021 
0022 #include <boost/config.hpp>
0023 #if defined(BOOST_NO_STDC_NAMESPACE)
0024 namespace std{
0025     using ::size_t;
0026 } // namespace std
0027 #endif
0028 
0029 #include <boost/archive/detail/auto_link_archive.hpp>
0030 #include <boost/archive/basic_text_oprimitive.hpp>
0031 #include <boost/archive/basic_text_oarchive.hpp>
0032 #include <boost/archive/detail/register_archive.hpp>
0033 #include <boost/serialization/item_version_type.hpp>
0034 
0035 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0036 
0037 #ifdef BOOST_MSVC
0038 #  pragma warning(push)
0039 #  pragma warning(disable : 4511 4512)
0040 #endif
0041 
0042 namespace boost {
0043 namespace archive {
0044 
0045 namespace detail {
0046     template<class Archive> class interface_oarchive;
0047 } // namespace detail
0048 
0049 template<class Archive>
0050 class BOOST_SYMBOL_VISIBLE text_oarchive_impl :
0051      /* protected ? */ public basic_text_oprimitive<std::ostream>,
0052      public basic_text_oarchive<Archive>
0053 {
0054 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0055 public:
0056 #else
0057 protected:
0058     friend class detail::interface_oarchive<Archive>;
0059     friend class basic_text_oarchive<Archive>;
0060     friend class save_access;
0061 #endif
0062     template<class T>
0063     void save(const T & t){
0064         this->newtoken();
0065         basic_text_oprimitive<std::ostream>::save(t);
0066     }
0067     void save(const version_type & t){
0068         save(static_cast<unsigned int>(t));
0069     }
0070     void save(const boost::serialization::item_version_type & t){
0071         save(static_cast<unsigned int>(t));
0072     }
0073     BOOST_ARCHIVE_DECL void
0074     save(const char * t);
0075     #ifndef BOOST_NO_INTRINSIC_WCHAR_T
0076     BOOST_ARCHIVE_DECL void
0077     save(const wchar_t * t);
0078     #endif
0079     BOOST_ARCHIVE_DECL void
0080     save(const std::string &s);
0081     #ifndef BOOST_NO_STD_WSTRING
0082     BOOST_ARCHIVE_DECL void
0083     save(const std::wstring &ws);
0084     #endif
0085     BOOST_ARCHIVE_DECL
0086     text_oarchive_impl(std::ostream & os, unsigned int flags);
0087     // don't import inline definitions! leave this as a reminder.
0088     //BOOST_ARCHIVE_DECL
0089     ~text_oarchive_impl() BOOST_OVERRIDE {}
0090 public:
0091     BOOST_ARCHIVE_DECL void
0092     save_binary(const void *address, std::size_t count);
0093 };
0094 
0095 // do not derive from this class.  If you want to extend this functionality
0096 // via inheritance, derived from text_oarchive_impl instead.  This will
0097 // preserve correct static polymorphism.
0098 class BOOST_SYMBOL_VISIBLE text_oarchive :
0099     public text_oarchive_impl<text_oarchive>
0100 {
0101 public:
0102     text_oarchive(std::ostream & os_, unsigned int flags = 0) :
0103         // note: added _ to suppress useless gcc warning
0104         text_oarchive_impl<text_oarchive>(os_, flags)
0105     {
0106         if(0 == (flags & no_header))
0107             init();
0108     }
0109     ~text_oarchive() BOOST_OVERRIDE {}
0110 };
0111 
0112 } // namespace archive
0113 } // namespace boost
0114 
0115 // required by export
0116 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive)
0117 
0118 #ifdef BOOST_MSVC
0119 #pragma warning(pop)
0120 #endif
0121 
0122 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0123 
0124 #endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP