[857] | 1 | #ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
|
---|
| 2 | #define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_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 | // basic_text_iarchive.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 | // archives stored as text - note these ar templated on the basic
|
---|
| 20 | // stream templates to accommodate wide (and other?) kind of characters
|
---|
| 21 | //
|
---|
| 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
|
---|
| 26 |
|
---|
| 27 | #include <boost/config.hpp>
|
---|
| 28 | #include <boost/pfto.hpp>
|
---|
| 29 | #include <boost/detail/workaround.hpp>
|
---|
| 30 |
|
---|
| 31 | #include <boost/archive/detail/iserializer.hpp>
|
---|
| 32 | #include <boost/archive/detail/interface_iarchive.hpp>
|
---|
| 33 | #include <boost/archive/detail/common_iarchive.hpp>
|
---|
| 34 |
|
---|
| 35 | #include <boost/serialization/string.hpp>
|
---|
| 36 |
|
---|
| 37 | #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
---|
| 38 |
|
---|
| 39 | namespace boost {
|
---|
| 40 | namespace archive {
|
---|
| 41 |
|
---|
| 42 | /////////////////////////////////////////////////////////////////////////
|
---|
| 43 | // class basic_text_iarchive - read serialized objects from a input text stream
|
---|
| 44 | template<class Archive>
|
---|
| 45 | class basic_text_iarchive :
|
---|
| 46 | public detail::common_iarchive<Archive>
|
---|
| 47 | {
|
---|
| 48 | #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
---|
| 49 | public:
|
---|
| 50 | #elif defined(BOOST_MSVC)
|
---|
| 51 | // for some inexplicable reason insertion of "class" generates compile erro
|
---|
| 52 | // on msvc 7.1
|
---|
| 53 | friend detail::interface_iarchive<Archive>;
|
---|
| 54 | protected:
|
---|
| 55 | #else
|
---|
| 56 | friend class detail::interface_iarchive<Archive>;
|
---|
| 57 | protected:
|
---|
| 58 | #endif
|
---|
| 59 | // intermediate level to support override of operators
|
---|
| 60 | // fot templates in the absence of partial function
|
---|
| 61 | // template ordering
|
---|
| 62 | template<class T>
|
---|
| 63 | void load_override(T & t, BOOST_PFTO int){
|
---|
| 64 | archive::load(* this->This(), t);
|
---|
| 65 | }
|
---|
| 66 | // text file don't include the optional information
|
---|
| 67 | void load_override(class_id_optional_type & /*t*/, int){}
|
---|
| 68 |
|
---|
| 69 | BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
---|
| 70 | load_override(class_name_type & t, int);
|
---|
| 71 |
|
---|
| 72 | BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
---|
| 73 | init(void);
|
---|
| 74 |
|
---|
| 75 | basic_text_iarchive(unsigned int flags) :
|
---|
| 76 | detail::common_iarchive<Archive>(flags)
|
---|
| 77 | {}
|
---|
| 78 |
|
---|
| 79 | ~basic_text_iarchive(){}
|
---|
| 80 | };
|
---|
| 81 |
|
---|
| 82 | } // namespace archive
|
---|
| 83 | } // namespace boost
|
---|
| 84 |
|
---|
| 85 | #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
---|
| 86 |
|
---|
| 87 | #endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
|
---|