comparison DEPENDENCIES/generic/include/boost/archive/text_oarchive.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 #ifndef BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
2 #define BOOST_ARCHIVE_TEXT_OARCHIVE_HPP
3
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
6 # pragma once
7 #endif
8
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // text_oarchive.hpp
11
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)
16
17 // See http://www.boost.org for updates, documentation, and revision history.
18
19 #include <ostream>
20 #include <cstddef> // std::size_t
21
22 #include <boost/config.hpp>
23 #if defined(BOOST_NO_STDC_NAMESPACE)
24 namespace std{
25 using ::size_t;
26 } // namespace std
27 #endif
28
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>
34
35 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
36
37 #ifdef BOOST_MSVC
38 # pragma warning(push)
39 # pragma warning(disable : 4511 4512)
40 #endif
41
42 namespace boost {
43 namespace archive {
44
45 template<class Archive>
46 class text_oarchive_impl :
47 /* protected ? */ public basic_text_oprimitive<std::ostream>,
48 public basic_text_oarchive<Archive>
49 {
50 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
51 public:
52 #else
53 friend class detail::interface_oarchive<Archive>;
54 friend class basic_text_oarchive<Archive>;
55 friend class save_access;
56 protected:
57 #endif
58 template<class T>
59 void save(const T & t){
60 this->newtoken();
61 basic_text_oprimitive<std::ostream>::save(t);
62 }
63 void save(const version_type & t){
64 save(static_cast<const unsigned int>(t));
65 }
66 void save(const boost::serialization::item_version_type & t){
67 save(static_cast<const unsigned int>(t));
68 }
69 BOOST_ARCHIVE_DECL(void)
70 save(const char * t);
71 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
72 BOOST_ARCHIVE_DECL(void)
73 save(const wchar_t * t);
74 #endif
75 BOOST_ARCHIVE_DECL(void)
76 save(const std::string &s);
77 #ifndef BOOST_NO_STD_WSTRING
78 BOOST_ARCHIVE_DECL(void)
79 save(const std::wstring &ws);
80 #endif
81 BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
82 text_oarchive_impl(std::ostream & os, unsigned int flags);
83 // don't import inline definitions! leave this as a reminder.
84 //BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
85 ~text_oarchive_impl(){};
86 public:
87 BOOST_ARCHIVE_DECL(void)
88 save_binary(const void *address, std::size_t count);
89 };
90
91 // do not derive from this class. If you want to extend this functionality
92 // via inhertance, derived from text_oarchive_impl instead. This will
93 // preserve correct static polymorphism.
94 class text_oarchive :
95 public text_oarchive_impl<text_oarchive>
96 {
97 public:
98 text_oarchive(std::ostream & os_, unsigned int flags = 0) :
99 // note: added _ to suppress useless gcc warning
100 text_oarchive_impl<text_oarchive>(os_, flags)
101 {}
102 ~text_oarchive(){}
103 };
104
105 typedef text_oarchive naked_text_oarchive;
106
107 } // namespace archive
108 } // namespace boost
109
110 // required by export
111 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive)
112
113 #ifdef BOOST_MSVC
114 #pragma warning(pop)
115 #endif
116
117 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
118
119 #endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP