os/ossrv/ossrv_pub/boost_apis/boost/archive/xml_woarchive.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/archive/xml_woarchive.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,126 @@
     1.4 +#ifndef BOOST_ARCHIVE_XML_WOARCHIVE_HPP
     1.5 +#define BOOST_ARCHIVE_XML_WOARCHIVE_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_woarchive.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 <cstddef> // size_t
    1.28 +#if defined(BOOST_NO_STDC_NAMESPACE)
    1.29 +namespace std{ 
    1.30 +    using ::size_t; 
    1.31 +} // namespace std
    1.32 +#endif
    1.33 +
    1.34 +#include <ostream>
    1.35 +
    1.36 +#include <boost/archive/detail/auto_link_warchive.hpp>
    1.37 +#include <boost/archive/basic_text_oprimitive.hpp>
    1.38 +#include <boost/archive/basic_xml_oarchive.hpp>
    1.39 +
    1.40 +#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
    1.41 +
    1.42 +namespace boost {
    1.43 +namespace archive {
    1.44 +
    1.45 +BOOST_WARCHIVE_DECL(std::wostream &)
    1.46 +operator<<(std::wostream &os, const char *t);
    1.47 +
    1.48 +BOOST_WARCHIVE_DECL(std::wostream &)
    1.49 +operator<<(std::wostream &os, const char t);
    1.50 +
    1.51 +template<class Archive>
    1.52 +class xml_woarchive_impl : 
    1.53 +    public basic_text_oprimitive<std::wostream>,
    1.54 +    public basic_xml_oarchive<Archive>
    1.55 +{
    1.56 +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
    1.57 +public:
    1.58 +#else
    1.59 +    friend class detail::interface_oarchive<Archive>;
    1.60 +    friend class basic_xml_oarchive<Archive>;
    1.61 +    friend class save_access;
    1.62 +protected:
    1.63 +#endif
    1.64 +    void end_preamble(){
    1.65 +        basic_xml_oarchive<Archive>::end_preamble();
    1.66 +    }
    1.67 +    template<class T>
    1.68 +    void 
    1.69 +    save(const T & t){
    1.70 +        basic_text_oprimitive<std::wostream>::save(t);
    1.71 +    }
    1.72 +    BOOST_WARCHIVE_DECL(void)
    1.73 +    save(const char * t);
    1.74 +    #ifndef BOOST_NO_INTRINSIC_WCHAR_T
    1.75 +    BOOST_WARCHIVE_DECL(void) 
    1.76 +    save(const wchar_t * t);
    1.77 +    #endif
    1.78 +    BOOST_WARCHIVE_DECL(void) 
    1.79 +    save(const std::string &s);
    1.80 +    #ifndef BOOST_NO_STD_WSTRING
    1.81 +    BOOST_WARCHIVE_DECL(void)
    1.82 +    save(const std::wstring &ws);
    1.83 +    #endif
    1.84 +    BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) 
    1.85 +    xml_woarchive_impl(std::wostream & os, unsigned int flags);
    1.86 +    ~xml_woarchive_impl(){}
    1.87 +public:
    1.88 +    void 
    1.89 +    save_binary(const void *address, std::size_t count){
    1.90 +        this->end_preamble();
    1.91 +        #if ! defined(__MWERKS__)
    1.92 +        this->basic_text_oprimitive<std::wostream>::save_binary(
    1.93 +        #else
    1.94 +        this->basic_text_oprimitive::save_binary(
    1.95 +        #endif
    1.96 +            address, 
    1.97 +            count
    1.98 +        );
    1.99 +        this->indent_next = true;
   1.100 +    }
   1.101 +};
   1.102 +
   1.103 +// we use the following because we can't use
   1.104 +// typedef xml_woarchive_impl<xml_woarchive_impl<...> > xml_woarchive;
   1.105 +
   1.106 +// do not derive from this class.  If you want to extend this functionality
   1.107 +// via inhertance, derived from xml_woarchive_impl instead.  This will
   1.108 +// preserve correct static polymorphism.
   1.109 +class xml_woarchive : 
   1.110 +    public xml_woarchive_impl<xml_woarchive>
   1.111 +{
   1.112 +public:
   1.113 +    xml_woarchive(std::wostream & os, unsigned int flags = 0) :
   1.114 +        xml_woarchive_impl<xml_woarchive>(os, flags)
   1.115 +    {}
   1.116 +    ~xml_woarchive(){}
   1.117 +};
   1.118 +
   1.119 +} // namespace archive
   1.120 +} // namespace boost
   1.121 +
   1.122 +// required by smart_cast for compilers not implementing 
   1.123 +// partial template specialization
   1.124 +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_woarchive)
   1.125 +
   1.126 +#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
   1.127 +
   1.128 +#endif // BOOST_NO_STD_WSTREAMBUF
   1.129 +#endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP