1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/archive/xml_wiarchive.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,116 @@
1.4 +#ifndef BOOST_ARCHIVE_XML_WIARCHIVE_HPP
1.5 +#define BOOST_ARCHIVE_XML_WIARCHIVE_HPP
1.6 +
1.7 +// MS compatible compilers support #pragma once
1.8 +#if defined(_MSC_VER) && (_MSC_VER >= 1020)
1.9 +# pragma once
1.10 +#endif
1.11 +
1.12 +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
1.13 +// xml_wiarchive.hpp
1.14 +
1.15 +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
1.16 +// Use, modification and distribution is subject to the Boost Software
1.17 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.18 +// http://www.boost.org/LICENSE_1_0.txt)
1.19 +
1.20 +// See http://www.boost.org for updates, documentation, and revision history.
1.21 +
1.22 +#include <boost/config.hpp>
1.23 +#ifdef BOOST_NO_STD_WSTREAMBUF
1.24 +#error "wide char i/o not supported on this platform"
1.25 +#else
1.26 +
1.27 +#include <istream>
1.28 +
1.29 +//#include <boost/scoped_ptr.hpp>
1.30 +#include <boost/archive/detail/auto_link_warchive.hpp>
1.31 +#include <boost/archive/basic_text_iprimitive.hpp>
1.32 +#include <boost/archive/basic_xml_iarchive.hpp>
1.33 +
1.34 +#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
1.35 +
1.36 +namespace boost {
1.37 +namespace archive {
1.38 +
1.39 +template<class CharType>
1.40 +class basic_xml_grammar;
1.41 +typedef basic_xml_grammar<wchar_t> xml_wgrammar;
1.42 +
1.43 +template<class Archive>
1.44 +class xml_wiarchive_impl :
1.45 + public basic_text_iprimitive<std::wistream>,
1.46 + public basic_xml_iarchive<Archive>
1.47 +{
1.48 +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
1.49 +public:
1.50 +#else
1.51 + friend class detail::interface_iarchive<Archive>;
1.52 + friend class basic_xml_iarchive<Archive>;
1.53 + friend class load_access;
1.54 +protected:
1.55 +#endif
1.56 + // instances of micro xml parser to parse start preambles
1.57 + // scoped_ptr doesn't play nice with borland - so use a naked pointer
1.58 + // scoped_ptr<xml_wgrammar> gimpl;
1.59 + xml_wgrammar *gimpl;
1.60 + std::wistream & get_is(){
1.61 + return is;
1.62 + }
1.63 + template<class T>
1.64 + void load(T & t){
1.65 + basic_text_iprimitive<std::wistream>::load(t);
1.66 + }
1.67 + BOOST_WARCHIVE_DECL(void)
1.68 + load(char * t);
1.69 + #ifndef BOOST_NO_INTRINSIC_WCHAR_T
1.70 + BOOST_WARCHIVE_DECL(void)
1.71 + load(wchar_t * t);
1.72 + #endif
1.73 + BOOST_WARCHIVE_DECL(void)
1.74 + load(std::string &s);
1.75 + #ifndef BOOST_NO_STD_WSTRING
1.76 + BOOST_WARCHIVE_DECL(void)
1.77 + load(std::wstring &ws);
1.78 + #endif
1.79 + template<class T>
1.80 + void load_override(T & t, BOOST_PFTO int){
1.81 + basic_xml_iarchive<Archive>::load_override(t, 0);
1.82 + }
1.83 + BOOST_WARCHIVE_DECL(void)
1.84 + load_override(class_name_type & t, int);
1.85 + BOOST_WARCHIVE_DECL(void)
1.86 + init();
1.87 + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
1.88 + xml_wiarchive_impl(std::wistream & is, unsigned int flags) ;
1.89 + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
1.90 + ~xml_wiarchive_impl();
1.91 +};
1.92 +
1.93 +// we use the following because we can't use
1.94 +// typedef xml_wiarchive_impl<xml_wiarchive_impl<...> > xml_wiarchive;
1.95 +
1.96 +// do not derive from this class. If you want to extend this functionality
1.97 +// via inhertance, derived from xml_wiarchive_impl instead. This will
1.98 +// preserve correct static polymorphism.
1.99 +class xml_wiarchive :
1.100 + public xml_wiarchive_impl<xml_wiarchive>
1.101 +{
1.102 +public:
1.103 + xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
1.104 + xml_wiarchive_impl<xml_wiarchive>(is, flags)
1.105 + {}
1.106 + ~xml_wiarchive(){}
1.107 +};
1.108 +
1.109 +} // namespace archive
1.110 +} // namespace boost
1.111 +
1.112 +// required by smart_cast for compilers not implementing
1.113 +// partial template specialization
1.114 +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_wiarchive)
1.115 +
1.116 +#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
1.117 +
1.118 +#endif // BOOST_NO_STD_WSTREAMBUF
1.119 +#endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP