File indexing completed on 2025-01-18 09:28:29
0001 #ifndef BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
0002 #define BOOST_ARCHIVE_BASIC_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
0020
0021
0022
0023
0024
0025
0026
0027 #include <boost/config.hpp>
0028 #include <boost/detail/workaround.hpp>
0029 #include <boost/archive/detail/common_oarchive.hpp>
0030 #include <boost/serialization/string.hpp>
0031
0032 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
0033
0034 #ifdef BOOST_MSVC
0035 # pragma warning(push)
0036 # pragma warning(disable : 4511 4512)
0037 #endif
0038
0039 namespace boost {
0040 namespace archive {
0041
0042 namespace detail {
0043 template<class Archive> class interface_oarchive;
0044 }
0045
0046
0047
0048 template<class Archive>
0049 class BOOST_SYMBOL_VISIBLE basic_text_oarchive :
0050 public detail::common_oarchive<Archive>
0051 {
0052 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0053 public:
0054 #else
0055 protected:
0056 #if BOOST_WORKAROUND(BOOST_MSVC, < 1500)
0057
0058
0059 friend detail::interface_oarchive<Archive>;
0060 #else
0061 friend class detail::interface_oarchive<Archive>;
0062 #endif
0063 #endif
0064
0065 enum {
0066 none,
0067 eol,
0068 space
0069 } delimiter;
0070
0071 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0072 newtoken();
0073
0074 void newline(){
0075 delimiter = eol;
0076 }
0077
0078
0079
0080 typedef detail::common_oarchive<Archive> detail_common_oarchive;
0081 template<class T>
0082 void save_override(T & t){
0083 this->detail_common_oarchive::save_override(t);
0084 }
0085
0086
0087 void save_override(const object_id_type & t){
0088 this->This()->newline();
0089 this->detail_common_oarchive::save_override(t);
0090 }
0091
0092
0093 void save_override(const class_id_optional_type & ){}
0094
0095 void save_override(const class_name_type & t){
0096 const std::string s(t);
0097 * this->This() << s;
0098 }
0099
0100 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0101 init();
0102
0103 basic_text_oarchive(unsigned int flags) :
0104 detail::common_oarchive<Archive>(flags),
0105 delimiter(none)
0106 {}
0107 ~basic_text_oarchive() BOOST_OVERRIDE {}
0108 };
0109
0110 }
0111 }
0112
0113 #ifdef BOOST_MSVC
0114 #pragma warning(pop)
0115 #endif
0116
0117 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
0118
0119 #endif