1 #ifndef BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
2 #define BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
20 #include <cstddef> // std::size_t
22 #include <boost/config.hpp>
23 #if defined(BOOST_NO_STDC_NAMESPACE)
29 #include <boost/archive/detail/auto_link_archive.hpp>
30 #include <boost/archive/basic_text_oprimitive.hpp>
31 #include <boost/archive/basic_text_oarchive.hpp>
32 #include <boost/archive/detail/register_archive.hpp>
33 #include <boost/serialization/item_version_type.hpp>
35 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
38 # pragma warning(push)
39 # pragma warning(disable : 4511 4512)
46 template<class Archive> class interface_oarchive;
49 template<class Archive>
50 class BOOST_SYMBOL_VISIBLE text_oarchive_impl :
51 /* protected ? */ public basic_text_oprimitive<std::ostream>,
52 public basic_text_oarchive<Archive>
54 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
58 friend class detail::interface_oarchive<Archive>;
59 friend class basic_text_oarchive<Archive>;
60 friend class save_access;
63 void save(const T & t){
65 basic_text_oprimitive<std::ostream>::save(t);
67 void save(const version_type & t){
68 save(static_cast<const unsigned int>(t));
70 void save(const boost::serialization::item_version_type & t){
71 save(static_cast<const unsigned int>(t));
73 BOOST_ARCHIVE_DECL void
75 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
76 BOOST_ARCHIVE_DECL void
77 save(const wchar_t * t);
79 BOOST_ARCHIVE_DECL void
80 save(const std::string &s);
81 #ifndef BOOST_NO_STD_WSTRING
82 BOOST_ARCHIVE_DECL void
83 save(const std::wstring &ws);
86 text_oarchive_impl(std::ostream & os, unsigned int flags);
87 // don't import inline definitions! leave this as a reminder.
89 ~text_oarchive_impl(){};
91 BOOST_ARCHIVE_DECL void
92 save_binary(const void *address, std::size_t count);
95 // do not derive from this class. If you want to extend this functionality
96 // via inhertance, derived from text_oarchive_impl instead. This will
97 // preserve correct static polymorphism.
98 class BOOST_SYMBOL_VISIBLE text_oarchive :
99 public text_oarchive_impl<text_oarchive>
102 text_oarchive(std::ostream & os_, unsigned int flags = 0) :
103 // note: added _ to suppress useless gcc warning
104 text_oarchive_impl<text_oarchive>(os_, flags)
109 } // namespace archive
112 // required by export
113 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive)
119 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
121 #endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP