]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP |
2 | #define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP | |
3 | ||
4 | // MS compatible compilers support #pragma once | |
5 | #if defined(_MSC_VER) | |
6 | # pragma once | |
7 | #endif | |
8 | ||
9 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 | |
10 | // binary_iarchive_impl.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 <istream> | |
20 | #include <boost/archive/basic_binary_iprimitive.hpp> | |
21 | #include <boost/archive/basic_binary_iarchive.hpp> | |
22 | ||
23 | #ifdef BOOST_MSVC | |
24 | # pragma warning(push) | |
25 | # pragma warning(disable : 4511 4512) | |
26 | #endif | |
27 | ||
28 | namespace boost { | |
29 | namespace archive { | |
30 | ||
31 | namespace detail { | |
32 | template<class Archive> class interface_iarchive; | |
33 | } // namespace detail | |
34 | ||
35 | template<class Archive, class Elem, class Tr> | |
36 | class BOOST_SYMBOL_VISIBLE binary_iarchive_impl : | |
37 | public basic_binary_iprimitive<Archive, Elem, Tr>, | |
38 | public basic_binary_iarchive<Archive> | |
39 | { | |
40 | #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS | |
41 | public: | |
42 | #else | |
43 | protected: | |
44 | #if BOOST_WORKAROUND(BOOST_MSVC, < 1500) | |
45 | // for some inexplicable reason insertion of "class" generates compile erro | |
46 | // on msvc 7.1 | |
47 | friend detail::interface_iarchive<Archive>; | |
48 | friend basic_binary_iarchive<Archive>; | |
49 | friend load_access; | |
50 | #else | |
51 | friend class detail::interface_iarchive<Archive>; | |
52 | friend class basic_binary_iarchive<Archive>; | |
53 | friend class load_access; | |
54 | #endif | |
55 | #endif | |
56 | template<class T> | |
57 | void load_override(T & t){ | |
58 | this->basic_binary_iarchive<Archive>::load_override(t); | |
59 | } | |
60 | void init(unsigned int flags){ | |
61 | if(0 != (flags & no_header)){ | |
62 | return; | |
63 | } | |
64 | #if ! defined(__MWERKS__) | |
65 | this->basic_binary_iarchive<Archive>::init(); | |
66 | this->basic_binary_iprimitive<Archive, Elem, Tr>::init(); | |
67 | #else | |
68 | basic_binary_iarchive<Archive>::init(); | |
69 | basic_binary_iprimitive<Archive, Elem, Tr>::init(); | |
70 | #endif | |
71 | } | |
72 | binary_iarchive_impl( | |
73 | std::basic_streambuf<Elem, Tr> & bsb, | |
74 | unsigned int flags | |
75 | ) : | |
76 | basic_binary_iprimitive<Archive, Elem, Tr>( | |
77 | bsb, | |
78 | 0 != (flags & no_codecvt) | |
79 | ), | |
80 | basic_binary_iarchive<Archive>(flags) | |
81 | { | |
82 | init(flags); | |
83 | } | |
84 | binary_iarchive_impl( | |
85 | std::basic_istream<Elem, Tr> & is, | |
86 | unsigned int flags | |
87 | ) : | |
88 | basic_binary_iprimitive<Archive, Elem, Tr>( | |
89 | * is.rdbuf(), | |
90 | 0 != (flags & no_codecvt) | |
91 | ), | |
92 | basic_binary_iarchive<Archive>(flags) | |
93 | { | |
94 | init(flags); | |
95 | } | |
96 | }; | |
97 | ||
98 | } // namespace archive | |
99 | } // namespace boost | |
100 | ||
101 | #ifdef BOOST_MSVC | |
102 | #pragma warning(pop) | |
103 | #endif | |
104 | ||
105 | #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP |