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
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
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 }
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 }
0048
0049 template<class Archive>
0050 class BOOST_SYMBOL_VISIBLE text_oarchive_impl :
0051 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
0088
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
0096
0097
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
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 }
0113 }
0114
0115
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