1 #ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
2 #define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // basic_text_iarchive.hpp
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.
19 // archives stored as text - note these ar templated on the basic
20 // stream templates to accommodate wide (and other?) kind of characters
22 // note the fact that on libraries without wide characters, ostream is
23 // is not a specialization of basic_ostream which in fact is not defined
24 // in such cases. So we can't use basic_ostream<IStream::char_type> but rather
25 // use two template parameters
27 #include <boost/config.hpp>
28 #include <boost/pfto.hpp>
29 #include <boost/detail/workaround.hpp>
31 #include <boost/archive/detail/common_iarchive.hpp>
32 #include <boost/serialization/string.hpp>
34 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
39 /////////////////////////////////////////////////////////////////////////
40 // class basic_text_iarchive - read serialized objects from a input text stream
41 template<class Archive>
42 class basic_text_iarchive :
43 public detail::common_iarchive<Archive>
46 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
48 #elif defined(BOOST_MSVC)
49 // for some inexplicable reason insertion of "class" generates compile erro
51 friend detail::interface_iarchive<Archive>;
53 friend class detail::interface_iarchive<Archive>;
55 // intermediate level to support override of operators
56 // fot templates in the absence of partial function
58 typedef detail::common_iarchive<Archive> detail_common_iarchive;
60 void load_override(T & t, BOOST_PFTO int)
62 this->detail_common_iarchive::load_override(t, 0);
65 // Borland compilers has a problem with strong type. Try to fix this here
66 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
67 void load_override(version_type & t, int){
70 t.t = version_type(x);
74 // text file don't include the optional information
75 void load_override(class_id_optional_type & /*t*/, int){}
77 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
78 load_override(class_name_type & t, int);
80 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
83 basic_text_iarchive(unsigned int flags) :
84 detail::common_iarchive<Archive>(flags)
86 ~basic_text_iarchive(){}
89 } // namespace archive
92 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
94 #endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP