1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // text_iarchive_impl.ipp:
4 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org for updates, documentation, and revision history.
11 //////////////////////////////////////////////////////////////////////
12 // implementation of basic_text_iprimitive overrides for the combination
13 // of template parameters used to implement a text_iprimitive
15 #include <cstddef> // size_t, NULL
16 #include <boost/config.hpp>
17 #if defined(BOOST_NO_STDC_NAMESPACE)
23 #include <boost/detail/workaround.hpp> // RogueWave
25 #include <boost/archive/text_iarchive.hpp>
30 template<class Archive>
31 BOOST_ARCHIVE_DECL void
32 text_iarchive_impl<Archive>::load(char *s)
35 * this->This() >> size;
36 // skip separating space
38 // Works on all tested platforms
43 template<class Archive>
44 BOOST_ARCHIVE_DECL void
45 text_iarchive_impl<Archive>::load(std::string &s)
48 * this->This() >> size;
49 // skip separating space
51 // borland de-allocator fixup
52 #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
57 is.read(&(*s.begin()), size);
60 #ifndef BOOST_NO_CWCHAR
61 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
62 template<class Archive>
63 BOOST_ARCHIVE_DECL void
64 text_iarchive_impl<Archive>::load(wchar_t *ws)
67 * this->This() >> size;
68 // skip separating space
70 is.read((char *)ws, size * sizeof(wchar_t)/sizeof(char));
73 #endif // BOOST_NO_INTRINSIC_WCHAR_T
75 #ifndef BOOST_NO_STD_WSTRING
76 template<class Archive>
77 BOOST_ARCHIVE_DECL void
78 text_iarchive_impl<Archive>::load(std::wstring &ws)
81 * this->This() >> size;
82 // borland de-allocator fixup
83 #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
87 // skip separating space
89 is.read((char *)ws.data(), size * sizeof(wchar_t)/sizeof(char));
92 #endif // BOOST_NO_STD_WSTRING
93 #endif // BOOST_NO_CWCHAR
95 template<class Archive>
96 BOOST_ARCHIVE_DECL void
97 text_iarchive_impl<Archive>::load_override(class_name_type & t){
98 basic_text_iarchive<Archive>::load_override(t);
101 template<class Archive>
102 BOOST_ARCHIVE_DECL void
103 text_iarchive_impl<Archive>::init(){
104 basic_text_iarchive<Archive>::init();
107 template<class Archive>
109 text_iarchive_impl<Archive>::text_iarchive_impl(
113 basic_text_iprimitive<std::istream>(
115 0 != (flags & no_codecvt)
117 basic_text_iarchive<Archive>(flags)
119 if(0 == (flags & no_header))
120 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
123 this->basic_text_iarchive<Archive>::init();
127 } // namespace archive