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