1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // text_text_wiarchive_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 #include <cstddef> // size_t, NULL
13 #include <boost/config.hpp>
14 #if defined(BOOST_NO_STDC_NAMESPACE)
20 #include <boost/detail/workaround.hpp> // fixup for RogueWave
22 #ifndef BOOST_NO_STD_WSTREAMBUF
23 #include <boost/archive/basic_text_iprimitive.hpp>
28 //////////////////////////////////////////////////////////////////////
29 // implementation of wiprimtives functions
31 template<class Archive>
32 BOOST_WARCHIVE_DECL(void)
33 text_wiarchive_impl<Archive>::load(char *s)
36 * this->This() >> size;
37 // skip separating space
40 *s++ = is.narrow(is.get(), '\0');
45 template<class Archive>
46 BOOST_WARCHIVE_DECL(void)
47 text_wiarchive_impl<Archive>::load(std::string &s)
50 * this->This() >> size;
51 // skip separating space
53 #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
59 int x = is.narrow(is.get(), '\0');
64 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
65 template<class Archive>
66 BOOST_WARCHIVE_DECL(void)
67 text_wiarchive_impl<Archive>::load(wchar_t *s)
70 * this->This() >> size;
71 // skip separating space
73 // Works on all tested platforms
79 #ifndef BOOST_NO_STD_WSTRING
80 template<class Archive>
81 BOOST_WARCHIVE_DECL(void)
82 text_wiarchive_impl<Archive>::load(std::wstring &ws)
85 * this->This() >> size;
86 // skip separating space
88 // borland complains about resize
89 // borland de-allocator fixup
90 #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
94 // note breaking a rule here - is this a problem on some platform
95 is.read(const_cast<wchar_t *>(ws.data()), size);
99 template<class Archive>
100 BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
101 text_wiarchive_impl<Archive>::text_wiarchive_impl(
105 basic_text_iprimitive<std::wistream>(
107 0 != (flags & no_codecvt)
109 basic_text_iarchive<Archive>(flags)
111 if(0 == (flags & no_header))
112 basic_text_iarchive<Archive>::init();
118 #endif // BOOST_NO_STD_WSTREAMBUF