Browse Source

Reimport boost/iostreams as a separate project

bugaevskiy 2 years ago
parent
commit
cd36034234

+ 1 - 1
CMakeLists.darwin.txt

@@ -923,7 +923,7 @@ add_subdirectory(contrib/libs/poco/NetSSL_OpenSSL)
 add_subdirectory(contrib/libs/poco/Crypto)
 add_subdirectory(contrib/libs/apache/avro)
 add_subdirectory(contrib/restricted/boost/crc)
-add_subdirectory(contrib/restricted/boost/libs/iostreams)
+add_subdirectory(contrib/restricted/boost/iostreams)
 add_subdirectory(ydb/library/yql/providers/solomon/gateway)
 add_subdirectory(ydb/library/yql/providers/solomon/provider)
 add_subdirectory(ydb/library/yql/providers/solomon/expr_nodes)

+ 1 - 1
CMakeLists.linux.txt

@@ -927,7 +927,7 @@ add_subdirectory(contrib/libs/poco/NetSSL_OpenSSL)
 add_subdirectory(contrib/libs/poco/Crypto)
 add_subdirectory(contrib/libs/apache/avro)
 add_subdirectory(contrib/restricted/boost/crc)
-add_subdirectory(contrib/restricted/boost/libs/iostreams)
+add_subdirectory(contrib/restricted/boost/iostreams)
 add_subdirectory(ydb/library/yql/providers/solomon/gateway)
 add_subdirectory(ydb/library/yql/providers/solomon/provider)
 add_subdirectory(ydb/library/yql/providers/solomon/expr_nodes)

+ 1 - 1
contrib/libs/apache/avro/CMakeLists.txt

@@ -29,7 +29,7 @@ target_link_libraries(libs-apache-avro PUBLIC
   contrib-libs-snappy
   contrib-restricted-boost
   restricted-boost-crc
-  boost-libs-iostreams
+  restricted-boost-iostreams
 )
 target_sources(libs-apache-avro PRIVATE
   ${CMAKE_SOURCE_DIR}/contrib/libs/apache/avro/impl/BinaryDecoder.cc

+ 0 - 417
contrib/restricted/boost/boost/iostreams/code_converter.hpp

@@ -1,417 +0,0 @@
-// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
-// (C) Copyright 2003-2007 Jonathan Turkanis
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
-
-// See http://www.boost.org/libs/iostreams for documentation.
-
-// Contains machinery for performing code conversion.
-
-#ifndef BOOST_IOSTREAMS_CODE_CONVERTER_HPP_INCLUDED
-#define BOOST_IOSTREAMS_CODE_CONVERTER_HPP_INCLUDED
-
-#if defined(_MSC_VER)
-# pragma once
-#endif
-
-#include <boost/iostreams/detail/config/wide_streams.hpp>
-#if defined(BOOST_IOSTREAMS_NO_WIDE_STREAMS) || \
-    defined(BOOST_IOSTREAMS_NO_LOCALE) \
-    /**/
-# error code conversion not supported on this platform
-#endif
-
-#include <algorithm>                       // max.
-#include <cstring>                         // memcpy.
-#include <exception>
-#include <boost/config.hpp>                // DEDUCED_TYPENAME, 
-#include <boost/iostreams/char_traits.hpp>
-#include <boost/iostreams/constants.hpp>   // default_filter_buffer_size.
-#include <boost/iostreams/detail/adapter/concept_adapter.hpp>
-#include <boost/iostreams/detail/adapter/direct_adapter.hpp>
-#include <boost/iostreams/detail/buffer.hpp>
-#include <boost/iostreams/detail/call_traits.hpp>
-#include <boost/iostreams/detail/codecvt_holder.hpp>
-#include <boost/iostreams/detail/codecvt_helper.hpp>
-#include <boost/iostreams/detail/double_object.hpp>
-#include <boost/iostreams/detail/execute.hpp>
-#include <boost/iostreams/detail/forward.hpp>
-#include <boost/iostreams/detail/functional.hpp>
-#include <boost/iostreams/detail/ios.hpp> // failure, openmode, int types, streamsize.
-#include <boost/iostreams/detail/optional.hpp>
-#include <boost/iostreams/detail/select.hpp>
-#include <boost/iostreams/traits.hpp>
-#include <boost/iostreams/operations.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/is_same.hpp>
-
-// Must come last.
-#include <boost/iostreams/detail/config/disable_warnings.hpp> // Borland 5.x
-
-namespace boost { namespace iostreams {
-
-struct code_conversion_error : BOOST_IOSTREAMS_FAILURE {
-    code_conversion_error() 
-        : BOOST_IOSTREAMS_FAILURE("code conversion error")
-        { }
-};
-
-namespace detail {
-
-//--------------Definition of strncpy_if_same---------------------------------//
-
-// Helper template for strncpy_if_same, below.
-template<bool B>
-struct strncpy_if_same_impl;
-
-template<>
-struct strncpy_if_same_impl<true> {
-    template<typename Ch>
-    static Ch* copy(Ch* tgt, const Ch* src, std::streamsize n)
-    { return BOOST_IOSTREAMS_CHAR_TRAITS(Ch)::copy(tgt, src, n); }
-};
-
-template<>
-struct strncpy_if_same_impl<false> {
-    template<typename Src, typename Tgt>
-    static Tgt* copy(Tgt* tgt, const Src*, std::streamsize) { return tgt; }
-};
-
-template<typename Src, typename Tgt>
-Tgt* strncpy_if_same(Tgt* tgt, const Src* src, std::streamsize n)
-{
-    typedef strncpy_if_same_impl<is_same<Src, Tgt>::value> impl;
-    return impl::copy(tgt, src, n);
-}
-
-//--------------Definition of conversion_buffer-------------------------------//
-
-// Buffer and conversion state for reading.
-template<typename Codecvt, typename Alloc>
-class conversion_buffer 
-    : public buffer<
-                 BOOST_DEDUCED_TYPENAME detail::codecvt_extern<Codecvt>::type,
-                 Alloc
-             > 
-{
-public:
-    typedef typename Codecvt::state_type state_type;
-    conversion_buffer() 
-        : buffer<
-              BOOST_DEDUCED_TYPENAME detail::codecvt_extern<Codecvt>::type,
-              Alloc
-          >(0) 
-    { 
-        reset(); 
-    }
-    state_type& state() { return state_; }
-    void reset() 
-    { 
-        if (this->size()) 
-            this->set(0, 0);
-        state_ = state_type(); 
-    }
-private:
-    state_type state_;
-};
-
-//--------------Definition of converter_impl----------------------------------//
-
-// Contains member data, open/is_open/close and buffer management functions.
-template<typename Device, typename Codecvt, typename Alloc>
-struct code_converter_impl {
-    typedef typename codecvt_extern<Codecvt>::type          extern_type;
-    typedef typename category_of<Device>::type              device_category;
-    typedef is_convertible<device_category, input>          can_read;
-    typedef is_convertible<device_category, output>         can_write;
-    typedef is_convertible<device_category, bidirectional>  is_bidir;
-    typedef typename 
-            iostreams::select<  // Disambiguation for Tru64.
-                is_bidir, bidirectional,
-                can_read, input,
-                can_write, output
-            >::type                                         mode;      
-    typedef typename
-            mpl::if_<
-                is_direct<Device>,
-                direct_adapter<Device>,
-                Device
-            >::type                                         device_type;
-    typedef optional< concept_adapter<device_type> >        storage_type;
-    typedef is_convertible<device_category, two_sequence>   is_double;
-    typedef conversion_buffer<Codecvt, Alloc>               buffer_type;
-
-    code_converter_impl() : cvt_(), flags_(0) { }
-
-    ~code_converter_impl()
-    { 
-        try { 
-            if (flags_ & f_open) close(); 
-        } catch (...) { /* */ } 
-    }
-
-    template <class T>
-    void open(const T& dev, std::streamsize buffer_size)
-    {
-        if (flags_ & f_open)
-            boost::throw_exception(BOOST_IOSTREAMS_FAILURE("already open"));
-        if (buffer_size == -1)
-            buffer_size = default_filter_buffer_size;
-        std::streamsize max_length = cvt_.get().max_length();
-        buffer_size = (std::max)(buffer_size, 2 * max_length);
-        if (can_read::value) {
-            buf_.first().resize(buffer_size);
-            buf_.first().set(0, 0);
-        }
-        if (can_write::value && !is_double::value) {
-            buf_.second().resize(buffer_size);
-            buf_.second().set(0, 0);
-        }
-        dev_.reset(concept_adapter<device_type>(dev));
-        flags_ = f_open;
-    }
-
-    void close()
-    {
-        detail::execute_all(
-            detail::call_member_close(*this, BOOST_IOS::in),
-            detail::call_member_close(*this, BOOST_IOS::out)
-        );
-    }
-
-    void close(BOOST_IOS::openmode which)
-    {
-        if (which == BOOST_IOS::in && (flags_ & f_input_closed) == 0) {
-            flags_ |= f_input_closed;
-            iostreams::close(dev(), BOOST_IOS::in);
-        }
-        if (which == BOOST_IOS::out && (flags_ & f_output_closed) == 0) {
-            flags_ |= f_output_closed;
-            detail::execute_all(
-                detail::flush_buffer(buf_.second(), dev(), can_write::value),
-                detail::call_close(dev(), BOOST_IOS::out),
-                detail::call_reset(dev_),
-                detail::call_reset(buf_.first()),
-                detail::call_reset(buf_.second())
-            );
-        }
-    }
-
-    bool is_open() const { return (flags_ & f_open) != 0;}
-
-    device_type& dev() { return **dev_; }
-
-    enum flag_type {
-        f_open             = 1,
-        f_input_closed     = f_open << 1,
-        f_output_closed    = f_input_closed << 1
-    };
-
-    codecvt_holder<Codecvt>  cvt_;
-    storage_type             dev_;
-    double_object<
-        buffer_type, 
-        is_double
-    >                        buf_;
-    int                      flags_;
-};
-
-} // End namespace detail.
-
-//--------------Definition of converter---------------------------------------//
-
-#define BOOST_IOSTREAMS_CONVERTER_PARAMS() , std::streamsize buffer_size = -1
-#define BOOST_IOSTREAMS_CONVERTER_ARGS() , buffer_size
-
-template<typename Device, typename Codecvt, typename Alloc>
-struct code_converter_base {
-    typedef detail::code_converter_impl<
-                Device, Codecvt, Alloc
-            > impl_type;
-    code_converter_base() : pimpl_(new impl_type) { }
-    shared_ptr<impl_type> pimpl_;
-};
-
-template< typename Device, 
-          typename Codecvt = detail::default_codecvt, 
-          typename Alloc = std::allocator<char> >
-class code_converter 
-    : protected code_converter_base<Device, Codecvt, Alloc>
-{
-private:
-    typedef detail::code_converter_impl<
-                Device, Codecvt, Alloc
-            >                                                       impl_type;
-    typedef typename impl_type::device_type                         device_type;
-    typedef typename impl_type::buffer_type                         buffer_type;
-    typedef typename detail::codecvt_holder<Codecvt>::codecvt_type  codecvt_type;
-    typedef typename detail::codecvt_intern<Codecvt>::type          intern_type;
-    typedef typename detail::codecvt_extern<Codecvt>::type          extern_type;
-    typedef typename detail::codecvt_state<Codecvt>::type           state_type;
-public:
-    typedef intern_type                                             char_type;    
-    struct category 
-        : impl_type::mode, device_tag, closable_tag, localizable_tag
-        { };
-    BOOST_STATIC_ASSERT((
-        is_same<
-            extern_type, 
-            BOOST_DEDUCED_TYPENAME char_type_of<Device>::type
-        >::value
-    ));
-public:
-    code_converter() { }
-    BOOST_IOSTREAMS_FORWARD( code_converter, open_impl, Device,
-                             BOOST_IOSTREAMS_CONVERTER_PARAMS, 
-                             BOOST_IOSTREAMS_CONVERTER_ARGS )
-
-        // fstream-like interface.
-
-    bool is_open() const { return this->pimpl_->is_open(); }
-    void close(BOOST_IOS::openmode which = BOOST_IOS::in | BOOST_IOS::out )
-    { impl().close(which); }
-
-        // Device interface.
-
-    std::streamsize read(char_type*, std::streamsize);
-    std::streamsize write(const char_type*, std::streamsize);
-    void imbue(const std::locale& loc) { impl().cvt_.imbue(loc); }
-
-        // Direct device access.
-
-    Device& operator*() { return detail::unwrap_direct(dev()); }
-    Device* operator->() { return &detail::unwrap_direct(dev()); }
-private:
-    template<typename T> // Used for forwarding.
-    void open_impl(const T& t BOOST_IOSTREAMS_CONVERTER_PARAMS()) 
-    { 
-        impl().open(t BOOST_IOSTREAMS_CONVERTER_ARGS()); 
-    }
-
-    const codecvt_type& cvt() { return impl().cvt_.get(); }
-    device_type& dev() { return impl().dev(); }
-    buffer_type& in() { return impl().buf_.first(); }
-    buffer_type& out() { return impl().buf_.second(); }
-    impl_type& impl() { return *this->pimpl_; }
-};
-
-//--------------Implementation of converter-----------------------------------//
-
-// Implementation note: if end of stream contains a partial character,
-// it is ignored.
-template<typename Device, typename Codevt, typename Alloc>
-std::streamsize code_converter<Device, Codevt, Alloc>::read
-    (char_type* s, std::streamsize n)
-{
-    const extern_type*   next;        // Next external char.
-    intern_type*         nint;        // Next internal char.
-    std::streamsize      total = 0;   // Characters read.
-    int                  status = iostreams::char_traits<char>::good();
-    bool                 partial = false;
-    buffer_type&         buf = in();
-
-    do {
-
-        // Fill buffer.
-        if (buf.ptr() == buf.eptr() || partial) {
-            status = buf.fill(dev());
-            if (buf.ptr() == buf.eptr())
-                break;
-            partial = false;
-        }
-
-        // Convert.
-        std::codecvt_base::result result =
-            cvt().in( buf.state(),
-                      buf.ptr(), buf.eptr(), next,
-                      s + total, s + n, nint );
-        buf.ptr() += next - buf.ptr();
-        total = static_cast<std::streamsize>(nint - s);
-
-        switch (result) {
-        case std::codecvt_base::partial:
-            partial = true;
-            break;
-        case std::codecvt_base::ok:
-            break;
-        case std::codecvt_base::noconv:
-            {
-                std::streamsize amt = 
-                    std::min<std::streamsize>(next - buf.ptr(), n - total);
-                detail::strncpy_if_same(s + total, buf.ptr(), amt);
-                total += amt;
-            }
-            break;
-        case std::codecvt_base::error:
-        default:
-            buf.state() = state_type();
-            boost::throw_exception(code_conversion_error());
-        }
-
-    } while (total < n && status != EOF && status != WOULD_BLOCK);
-
-    return total == 0 && status == EOF ? -1 : total;
-}
-
-template<typename Device, typename Codevt, typename Alloc>
-std::streamsize code_converter<Device, Codevt, Alloc>::write
-    (const char_type* s, std::streamsize n)
-{
-    buffer_type&        buf = out();
-    extern_type*        next;              // Next external char.
-    const intern_type*  nint;              // Next internal char.
-    std::streamsize     total = 0;         // Characters written.
-    bool                partial = false;
-
-    while (total < n) {
-
-        // Empty buffer.
-        if (buf.eptr() == buf.end() || partial) {
-            if (!buf.flush(dev()))
-                break;
-            partial = false;
-        }
-       
-        // Convert.
-        std::codecvt_base::result result =
-            cvt().out( buf.state(),
-                       s + total, s + n, nint,
-                       buf.eptr(), buf.end(), next );
-        int progress = (int) (next - buf.eptr());
-        buf.eptr() += progress;
-
-        switch (result) {
-        case std::codecvt_base::partial:
-            partial = true;
-            BOOST_FALLTHROUGH;
-        case std::codecvt_base::ok:
-            total = static_cast<std::streamsize>(nint - s);
-            break;
-        case std::codecvt_base::noconv:
-            {
-                std::streamsize amt = 
-                    std::min<std::streamsize>( nint - total - s, 
-                                               buf.end() - buf.eptr() );
-                detail::strncpy_if_same(buf.eptr(), s + total, amt);
-                total += amt;
-            }
-            break;
-        case std::codecvt_base::error:
-        default:
-            buf.state() = state_type();
-            boost::throw_exception(code_conversion_error());
-        }
-    }
-    return total;
-}
-
-//----------------------------------------------------------------------------//
-
-} } // End namespaces iostreams, boost.
-
-#include <boost/iostreams/detail/config/enable_warnings.hpp> // Borland 5.x
-
-#endif // #ifndef BOOST_IOSTREAMS_CODE_CONVERTER_HPP_INCLUDED

+ 0 - 260
contrib/restricted/boost/boost/iostreams/combine.hpp

@@ -1,260 +0,0 @@
-// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
-// (C) Copyright 2003-2007 Jonathan Turkanis
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
-
-// See http://www.boost.org/libs/iostreams for documentation.
-
-// To do: add support for random-access.
-
-#ifndef BOOST_IOSTREAMS_COMBINE_HPP_INCLUDED
-#define BOOST_IOSTREAMS_COMBINE_HPP_INCLUDED
-
-#if defined(_MSC_VER)
-# pragma once
-#endif              
-
-#include <boost/config.hpp> // NO_STD_LOCALE, DEDUCED_TYPENAME.
-#ifndef BOOST_NO_STD_LOCALE
-# include <locale>
-#endif
-#include <boost/iostreams/detail/ios.hpp>   
-#include <boost/iostreams/detail/wrap_unwrap.hpp>       
-#include <boost/iostreams/traits.hpp>         
-#include <boost/iostreams/operations.hpp>        
-#include <boost/mpl/if.hpp>    
-#include <boost/static_assert.hpp>  
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/is_same.hpp> 
-
-// Must come last.
-#include <boost/iostreams/detail/config/disable_warnings.hpp>
-
-namespace boost { namespace iostreams {
-
-namespace detail {
-
-//
-// Template name: combined_device.
-// Description: Model of Device defined in terms of a Source/Sink pair.
-// Template parameters:
-//      Source - A model of Source, with the same char_type and traits_type
-//          as Sink.
-//      Sink - A model of Sink, with the same char_type and traits_type
-//          as Source.
-//
-template<typename Source, typename Sink>
-class combined_device {
-private:
-    typedef typename category_of<Source>::type  in_category;
-    typedef typename category_of<Sink>::type    out_category;
-    typedef typename char_type_of<Sink>::type   sink_char_type;
-public:
-    typedef typename char_type_of<Source>::type char_type;
-    struct category
-        : bidirectional, 
-          device_tag, 
-          closable_tag, 
-          localizable_tag
-        { };
-    BOOST_STATIC_ASSERT(is_device<Source>::value);
-    BOOST_STATIC_ASSERT(is_device<Sink>::value);
-    BOOST_STATIC_ASSERT((is_convertible<in_category, input>::value));
-    BOOST_STATIC_ASSERT((is_convertible<out_category, output>::value));
-    BOOST_STATIC_ASSERT((is_same<char_type, sink_char_type>::value));
-    combined_device(const Source& src, const Sink& snk);
-    std::streamsize read(char_type* s, std::streamsize n);
-    std::streamsize write(const char_type* s, std::streamsize n);
-    void close(BOOST_IOS::openmode);
-    #ifndef BOOST_NO_STD_LOCALE
-        void imbue(const std::locale& loc);
-    #endif
-private:
-    Source  src_;
-    Sink    sink_;
-};
-
-//
-// Template name: combined_filter.
-// Description: Model of Device defined in terms of a Source/Sink pair.
-// Template parameters:
-//      InputFilter - A model of InputFilter, with the same char_type as 
-//          OutputFilter.
-//      OutputFilter - A model of OutputFilter, with the same char_type as 
-//          InputFilter.
-//
-template<typename InputFilter, typename OutputFilter>
-class combined_filter {
-private:
-    typedef typename category_of<InputFilter>::type    in_category;
-    typedef typename category_of<OutputFilter>::type   out_category;
-    typedef typename char_type_of<OutputFilter>::type  output_char_type;
-public:
-    typedef typename char_type_of<InputFilter>::type   char_type;
-    struct category 
-        : multichar_bidirectional_filter_tag,
-          closable_tag, 
-          localizable_tag
-        { };
-    BOOST_STATIC_ASSERT(is_filter<InputFilter>::value);
-    BOOST_STATIC_ASSERT(is_filter<OutputFilter>::value);
-    BOOST_STATIC_ASSERT((is_convertible<in_category, input>::value));
-    BOOST_STATIC_ASSERT((is_convertible<out_category, output>::value));
-    BOOST_STATIC_ASSERT((is_same<char_type, output_char_type>::value));
-    combined_filter(const InputFilter& in, const OutputFilter& out);
-
-    template<typename Source>
-    std::streamsize read(Source& src, char_type* s, std::streamsize n)
-    { return boost::iostreams::read(in_, src, s, n); }
-
-    template<typename Sink>
-    std::streamsize write(Sink& snk, const char_type* s, std::streamsize n)
-    { return boost::iostreams::write(out_, snk, s, n); }
-
-    template<typename Sink>
-    void close(Sink& snk, BOOST_IOS::openmode which)
-    {
-        if (which == BOOST_IOS::in) {
-            if (is_convertible<in_category, dual_use>::value) {
-                iostreams::close(in_, snk, BOOST_IOS::in);
-            } else {
-                detail::close_all(in_, snk);
-            }
-        }
-        if (which == BOOST_IOS::out) {
-            if (is_convertible<out_category, dual_use>::value) {
-                iostreams::close(out_, snk, BOOST_IOS::out);
-            } else {
-                detail::close_all(out_, snk);
-            }
-        }
-    }
-    #ifndef BOOST_NO_STD_LOCALE
-        void imbue(const std::locale& loc);
-    #endif
-private:
-    InputFilter   in_;
-    OutputFilter  out_;
-};
-
-template<typename In, typename Out>
-struct combination_traits 
-    : mpl::if_<
-          is_device<In>,
-          combined_device<
-              typename wrapped_type<In>::type,
-              typename wrapped_type<Out>::type
-          >,
-          combined_filter<
-              typename wrapped_type<In>::type,
-              typename wrapped_type<Out>::type
-          >
-      >
-    { };
-
-} // End namespace detail.
-
-template<typename In, typename Out>
-struct combination : detail::combination_traits<In, Out>::type {
-    typedef typename detail::combination_traits<In, Out>::type  base_type;
-    typedef typename detail::wrapped_type<In>::type          in_type;
-    typedef typename detail::wrapped_type<Out>::type         out_type;
-    combination(const in_type& in, const out_type& out)
-        : base_type(in, out) { }
-};
-
-namespace detail {
-
-// Workaround for VC6 ETI bug.
-template<typename In, typename Out>
-struct combine_traits {
-    typedef combination<
-                BOOST_DEDUCED_TYPENAME detail::unwrapped_type<In>::type, 
-                BOOST_DEDUCED_TYPENAME detail::unwrapped_type<Out>::type
-            > type;
-};
-
-} // End namespace detail.
-
-//
-// Template name: combine.
-// Description: Takes a Source/Sink pair or InputFilter/OutputFilter pair and
-//      returns a Source or Filter which performs input using the first member
-//      of the pair and output using the second member of the pair.
-// Template parameters:
-//      In - A model of Source or InputFilter, with the same char_type as Out.
-//      Out - A model of Sink or OutputFilter, with the same char_type as In.
-//
-template<typename In, typename Out>
-typename detail::combine_traits<In, Out>::type
-combine(const In& in, const Out& out) 
-{ 
-    typedef typename detail::combine_traits<In, Out>::type return_type;
-    return return_type(in, out); 
-}
-
-//----------------------------------------------------------------------------//
-
-namespace detail {
-
-//--------------Implementation of combined_device-----------------------------//
-
-template<typename Source, typename Sink>
-inline combined_device<Source, Sink>::combined_device
-    (const Source& src, const Sink& snk)
-    : src_(src), sink_(snk) { }
-
-template<typename Source, typename Sink>
-inline std::streamsize
-combined_device<Source, Sink>::read(char_type* s, std::streamsize n)
-{ return iostreams::read(src_, s, n); }
-
-template<typename Source, typename Sink>
-inline std::streamsize
-combined_device<Source, Sink>::write(const char_type* s, std::streamsize n)
-{ return iostreams::write(sink_, s, n); }
-
-template<typename Source, typename Sink>
-inline void
-combined_device<Source, Sink>::close(BOOST_IOS::openmode which)
-{ 
-    if (which == BOOST_IOS::in)
-        detail::close_all(src_); 
-    if (which == BOOST_IOS::out)
-        detail::close_all(sink_); 
-}
-
-#ifndef BOOST_NO_STD_LOCALE
-    template<typename Source, typename Sink>
-    void combined_device<Source, Sink>::imbue(const std::locale& loc)
-    {
-        iostreams::imbue(src_, loc);
-        iostreams::imbue(sink_, loc);
-    }
-#endif
-
-//--------------Implementation of filter_pair---------------------------------//
-
-template<typename InputFilter, typename OutputFilter>
-inline combined_filter<InputFilter, OutputFilter>::combined_filter
-    (const InputFilter& in, const OutputFilter& out) : in_(in), out_(out)
-    { }
-
-#ifndef BOOST_NO_STD_LOCALE
-    template<typename InputFilter, typename OutputFilter>
-    void combined_filter<InputFilter, OutputFilter>::imbue
-        (const std::locale& loc)
-    {
-        iostreams::imbue(in_, loc);
-        iostreams::imbue(out_, loc);
-    }
-#endif
-
-
-} // End namespace detail.
-
-} } // End namespaces iostreams, boost.
-
-#include <boost/iostreams/detail/config/enable_warnings.hpp>
-
-#endif // #ifndef BOOST_IOSTREAMS_COMBINE_HPP_INCLUDED

+ 0 - 493
contrib/restricted/boost/boost/iostreams/compose.hpp

@@ -1,493 +0,0 @@
-// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
-// (C) Copyright 2005-2007 Jonathan Turkanis
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
-
-// See http://www.boost.org/libs/iostreams for documentation.
-
-// Note: bidirectional streams are not supported.
-
-#ifndef BOOST_IOSTREAMS_COMPOSE_HPP_INCLUDED
-#define BOOST_IOSTREAMS_COMPOSE_HPP_INCLUDED
-
-#if defined(_MSC_VER)
-# pragma once
-#endif
-
-#include <algorithm>          // min.
-#include <utility>            // pair.
-#include <boost/config.hpp>   // DEDUCED_TYPENAME.
-#include <boost/iostreams/categories.hpp>
-#include <boost/iostreams/detail/adapter/direct_adapter.hpp>
-#include <boost/iostreams/detail/call_traits.hpp>
-#include <boost/iostreams/detail/enable_if_stream.hpp>
-#include <boost/iostreams/detail/execute.hpp>
-#include <boost/iostreams/detail/functional.hpp>
-#include <boost/iostreams/operations.hpp>
-#include <boost/iostreams/traits.hpp>      // mode_of, is_direct.
-#include <boost/mpl/if.hpp>
-#include <boost/ref.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-
-// Must come last.
-#include <boost/iostreams/detail/config/disable_warnings.hpp>  // MSVC.
-
-namespace boost { namespace iostreams {
-
-namespace detail {
-
-template< typename First, 
-          typename Second,
-          typename FirstMode = 
-              BOOST_DEDUCED_TYPENAME mode_of<First>::type,
-          typename SecondMode = 
-              BOOST_DEDUCED_TYPENAME mode_of<Second>::type >
-struct composite_mode
-    : select<
-          is_convertible<SecondMode, FirstMode>, FirstMode,
-          is_convertible<FirstMode, SecondMode>, SecondMode,
-          is_convertible<SecondMode, input>,     input,
-          else_,                                 output
-      >
-    { };
-
-//
-// Template name: composite_device.
-// Description: Provides a Device view of a Filter, Device pair.
-// Template parameters:
-//      Filter - A model of Filter.
-//      Device - An indirect model of Device.
-//
-template< typename Filter,
-          typename Device,
-          typename Mode =
-              BOOST_DEDUCED_TYPENAME composite_mode<Filter, Device>::type >
-class composite_device {
-private:
-    typedef typename detail::param_type<Device>::type       param_type;
-    typedef typename mode_of<Filter>::type                  filter_mode;
-    typedef typename mode_of<Device>::type                  device_mode;
-    typedef typename
-            iostreams::select<  // Disambiguation for Tru64.
-                is_direct<Device>,  direct_adapter<Device>,
-                is_std_io<Device>,  Device&,
-                else_,              Device
-            >::type                                         value_type;
-    BOOST_STATIC_ASSERT(is_filter<Filter>::value);
-    BOOST_STATIC_ASSERT(is_device<Device>::value);
-public:
-    typedef typename char_type_of<Filter>::type             char_type;
-    struct category
-        : Mode,
-          device_tag,
-          closable_tag,
-          flushable_tag,
-          localizable_tag,
-          optimally_buffered_tag
-        { };
-    composite_device(const Filter& flt, param_type dev);
-    std::streamsize read(char_type* s, std::streamsize n);
-    std::streamsize write(const char_type* s, std::streamsize n);
-    std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
-                         BOOST_IOS::openmode which =
-                             BOOST_IOS::in | BOOST_IOS::out );
-
-    void close();
-    void close(BOOST_IOS::openmode which);
-    bool flush();
-    std::streamsize optimal_buffer_size() const;
-
-    template<typename Locale> // Avoid dependency on <locale>
-    void imbue(const Locale& loc)
-    {
-        iostreams::imbue(filter_, loc);
-        iostreams::imbue(device_, loc);
-    }
-
-    Filter& first() { return filter_; }
-    Device& second() { return device_; }
-private:
-    Filter      filter_;
-    value_type  device_;
-};
-
-//
-// Template name: composite_device.
-// Description: Provides a Device view of a Filter, Device pair.
-// Template parameters:
-//      Filter - A model of Filter.
-//      Device - An indirect model of Device.
-//
-template< typename Filter1, 
-          typename Filter2,
-          typename Mode =
-              BOOST_DEDUCED_TYPENAME composite_mode<Filter1, Filter2>::type >
-class composite_filter {
-private:
-    typedef reference_wrapper<Filter2>           filter_ref;
-    typedef typename mode_of<Filter1>::type      first_mode;
-    typedef typename mode_of<Filter2>::type      second_mode;
-
-    // A dual-use filter cannot be composed with a read-write filter
-    BOOST_STATIC_ASSERT(
-        !(is_convertible<first_mode, dual_use>::value) ||
-        !(is_convertible<second_mode, input>::value) ||
-        !(is_convertible<second_mode, output>::value) ||
-         (is_convertible<second_mode, dual_use>::value)
-    );
-    BOOST_STATIC_ASSERT(
-        !(is_convertible<second_mode, dual_use>::value) ||
-        !(is_convertible<first_mode, input>::value) ||
-        !(is_convertible<first_mode, output>::value) ||
-         (is_convertible<first_mode, dual_use>::value)
-    );
-    BOOST_STATIC_ASSERT(is_filter<Filter1>::value);
-    BOOST_STATIC_ASSERT(is_filter<Filter2>::value);
-public:
-    typedef typename char_type_of<Filter1>::type  char_type;
-    struct category
-        : Mode,
-          filter_tag,
-          multichar_tag,
-          closable_tag,
-          flushable_tag,
-          localizable_tag,
-          optimally_buffered_tag
-        { };
-    composite_filter(const Filter1& filter1, const Filter2& filter2)
-        : filter1_(filter1), filter2_(filter2)
-        { }
-
-    template<typename Source>
-    std::streamsize read(Source& src, char_type* s, std::streamsize n)
-    {
-        composite_device<filter_ref, Source> cmp(boost::ref(filter2_), src);
-        return iostreams::read(filter1_, cmp, s, n);
-    }
-
-    template<typename Sink>
-    std::streamsize write(Sink& snk, const char_type* s, std::streamsize n)
-    {
-        composite_device<filter_ref, Sink> cmp(boost::ref(filter2_), snk);
-        return iostreams::write(filter1_, cmp, s, n);
-    }
-
-    template<typename Device>
-    std::streampos seek( Device& dev, stream_offset off, BOOST_IOS::seekdir way,
-                         BOOST_IOS::openmode which =
-                             BOOST_IOS::in | BOOST_IOS::out )
-    {
-        composite_device<filter_ref, Device> cmp(boost::ref(filter2_), dev);
-        return iostreams::seek(filter1_, cmp, off, way, which);
-    }
-
-    template<typename Device>
-    void close(Device& dev)
-    {
-        BOOST_STATIC_ASSERT((!is_convertible<category, two_sequence>::value));
-        BOOST_STATIC_ASSERT((!is_convertible<category, dual_use>::value));
-
-        // Create a new device by composing the second filter2_ with dev.
-        composite_device<filter_ref, Device> cmp(boost::ref(filter2_), dev);
-
-        // Close input sequences in reverse order and output sequences in 
-        // forward order
-        if (!is_convertible<first_mode, dual_use>::value) {
-            detail::execute_all(
-                detail::call_close(filter2_, dev, BOOST_IOS::in),
-                detail::call_close(filter1_, cmp, BOOST_IOS::in),
-                detail::call_close(filter1_, cmp, BOOST_IOS::out),
-                detail::call_close(filter2_, dev, BOOST_IOS::out)
-            );
-        } else if (is_convertible<second_mode, input>::value) {
-            detail::execute_all(
-                detail::call_close(filter2_, dev, BOOST_IOS::in),
-                detail::call_close(filter1_, cmp, BOOST_IOS::in)
-            );
-        } else {
-            detail::execute_all(
-                detail::call_close(filter1_, cmp, BOOST_IOS::out),
-                detail::call_close(filter2_, dev, BOOST_IOS::out)
-            );
-        }
-    }
-
-    template<typename Device>
-    void close(Device& dev, BOOST_IOS::openmode which)
-    {
-        BOOST_STATIC_ASSERT(
-            (is_convertible<category, two_sequence>::value) ||
-            (is_convertible<category, dual_use>::value)
-        );
-
-        // Create a new device by composing the second filter2_ with dev.
-        composite_device<filter_ref, Device> cmp(boost::ref(filter2_), dev);
-
-        // Close input sequences in reverse order
-        if ( which == BOOST_IOS::in &&
-             ( !is_convertible<first_mode, dual_use>::value ||
-                is_convertible<second_mode, input>::value ) )
-        {
-            detail::execute_all(
-                detail::call_close(filter2_, dev, BOOST_IOS::in),
-                detail::call_close(filter1_, cmp, BOOST_IOS::in)
-            );
-        }
-
-        // Close output sequences in forward order
-        if ( which == BOOST_IOS::out &&
-             ( !is_convertible<first_mode, dual_use>::value ||
-                is_convertible<second_mode, output>::value ) )
-        {
-            detail::execute_all(
-                detail::call_close(filter1_, cmp, BOOST_IOS::out),
-                detail::call_close(filter2_, dev, BOOST_IOS::out)
-            );
-        }
-    }
-
-    template<typename Device>
-    bool flush(Device& dev)
-    {
-        composite_device<Filter2, Device> cmp(filter2_, dev);
-        return iostreams::flush(filter1_, cmp);
-    }
-
-    std::streamsize optimal_buffer_size() const
-    {
-        std::streamsize first = iostreams::optimal_buffer_size(filter1_);
-        std::streamsize second = iostreams::optimal_buffer_size(filter2_);
-        return first < second ? second : first;
-    }
-
-    template<typename Locale> // Avoid dependency on <locale>
-    void imbue(const Locale& loc)
-    {   // To do: consider using RAII.
-        iostreams::imbue(filter1_, loc);
-        iostreams::imbue(filter2_, loc);
-    }
-
-    Filter1& first() { return filter1_; }
-    Filter2& second() { return filter2_; }
-private:
-    Filter1  filter1_;
-    Filter2  filter2_;
-};
-
-template<typename Filter, typename FilterOrDevice>
-struct composite_traits
-    : mpl::if_<
-          is_device<FilterOrDevice>,
-          composite_device<Filter, FilterOrDevice>,
-          composite_filter<Filter, FilterOrDevice>
-      >
-    { };
-
-} // End namespace detail.
-
-template<typename Filter, typename FilterOrDevice>
-struct composite : detail::composite_traits<Filter, FilterOrDevice>::type {
-    typedef typename detail::param_type<FilterOrDevice>::type param_type;
-    typedef typename detail::composite_traits<Filter, FilterOrDevice>::type base;
-    composite(const Filter& flt, param_type dev)
-        : base(flt, dev)
-        { }
-};
-
-//--------------Implementation of compose-------------------------------------//
-
-// Note: The following workarounds are patterned after resolve.hpp. It has not
-// yet been confirmed that they are necessary.
-
-#ifndef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //-------------------------//
-# ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //-------------------------------//
-
-template<typename Filter, typename FilterOrDevice>
-composite<Filter, FilterOrDevice>
-compose( const Filter& filter, const FilterOrDevice& fod
-         BOOST_IOSTREAMS_DISABLE_IF_STREAM(FilterOrDevice) )
-{ return composite<Filter, FilterOrDevice>(filter, fod); }
-
-template<typename Filter, typename Ch, typename Tr>
-composite< Filter, std::basic_streambuf<Ch, Tr> >
-compose(const Filter& filter, std::basic_streambuf<Ch, Tr>& sb)
-{ return composite< Filter, std::basic_streambuf<Ch, Tr> >(filter, sb); }
-
-template<typename Filter, typename Ch, typename Tr>
-composite< Filter, std::basic_istream<Ch, Tr> >
-compose(const Filter& filter, std::basic_istream<Ch, Tr>& is)
-{ return composite< Filter, std::basic_istream<Ch, Tr> >(filter, is); }
-
-template<typename Filter, typename Ch, typename Tr>
-composite< Filter, std::basic_ostream<Ch, Tr> >
-compose(const Filter& filter, std::basic_ostream<Ch, Tr>& os)
-{ return composite< Filter, std::basic_ostream<Ch, Tr> >(filter, os); }
-
-template<typename Filter, typename Ch, typename Tr>
-composite< Filter, std::basic_iostream<Ch, Tr> >
-compose(const Filter& filter, std::basic_iostream<Ch, Tr>& io)
-{ return composite< Filter, std::basic_iostream<Ch, Tr> >(filter, io); }
-
-# else // # ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //---------------------//
-
-template<typename Filter, typename FilterOrDevice>
-composite<Filter, FilterOrDevice>
-compose( const Filter& filter, const FilterOrDevice& fod
-         BOOST_IOSTREAMS_DISABLE_IF_STREAM(FilterOrDevice) )
-{ return composite<Filter, FilterOrDevice>(filter, fod); }
-
-template<typename Filter>
-composite<Filter, std::streambuf>
-compose(const Filter& filter, std::streambuf& sb)
-{ return composite<Filter, std::streambuf>(filter, sb); }
-
-template<typename Filter>
-composite<Filter, std::istream>
-compose(const Filter& filter, std::istream& is)
-{ return composite<Filter, std::istream>(filter, is); }
-
-template<typename Filter>
-composite<Filter, std::ostream>
-compose(const Filter& filter, std::ostream& os)
-{ return composite<Filter, std::ostream>(filter, os); }
-
-template<typename Filter>
-composite<Filter, std::iostream>
-compose(const Filter& filter, std::iostream& io)
-{ return composite<Filter, std::iostream>(filter, io); }
-
-# endif // # ifndef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES //--------------------//
-#else // #ifndef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //----------------//
-
-template<typename Filter, typename Stream>
-composite<Filter, Stream>
-compose(const Filter& flt, const Stream& strm, mpl::true_)
-{   // Bad overload resolution.
-    return composite<Filter, Stream>(flt, const_cast<Stream&>(strm));
-}
-
-template<typename Filter, typename FilterOrDevice>
-composite<Filter, FilterOrDevice>
-compose(const Filter& flt, const FilterOrDevice& fod, mpl::false_)
-{ return composite<Filter, FilterOrDevice>(flt, fod); }
-
-template<typename Filter, typename FilterOrDevice>
-composite<Filter, FilterOrDevice>
-compose( const Filter& flt, const FilterOrDevice& fod
-         BOOST_IOSTREAMS_DISABLE_IF_STREAM(T) )
-{ return compose(flt, fod, is_std_io<FilterOrDevice>()); }
-
-# if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && \
-     !defined(__GNUC__) // ---------------------------------------------------//
-
-template<typename Filter, typename FilterOrDevice>
-composite<Filter, FilterOrDevice>
-compose (const Filter& filter, FilterOrDevice& fod)
-{ return composite<Filter, FilterOrDevice>(filter, fod); }
-
-# endif // Borland 5.x or GCC //--------------------------------//
-#endif // #ifndef BOOST_IOSTREAMS_BROKEN_OVERLOAD_RESOLUTION //---------------//
-
-//----------------------------------------------------------------------------//
-
-namespace detail {
-
-//--------------Implementation of composite_device---------------------------//
-
-template<typename Filter, typename Device, typename Mode>
-composite_device<Filter, Device, Mode>::composite_device
-    (const Filter& flt, param_type dev)
-    : filter_(flt), device_(dev)
-    { }
-
-template<typename Filter, typename Device, typename Mode>
-inline std::streamsize composite_device<Filter, Device, Mode>::read
-    (char_type* s, std::streamsize n)
-{ return iostreams::read(filter_, device_, s, n); }
-
-template<typename Filter, typename Device, typename Mode>
-inline std::streamsize composite_device<Filter, Device, Mode>::write
-    (const char_type* s, std::streamsize n)
-{ return iostreams::write(filter_, device_, s, n); }
-
-template<typename Filter, typename Device, typename Mode>
-std::streampos composite_device<Filter, Device, Mode>::seek
-    (stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
-{ return iostreams::seek(filter_, device_, off, way, which); }
-
-template<typename Filter, typename Device, typename Mode>
-void composite_device<Filter, Device, Mode>::close()
-{
-    BOOST_STATIC_ASSERT((!is_convertible<Mode, two_sequence>::value));
-    BOOST_STATIC_ASSERT(
-        !(is_convertible<filter_mode, dual_use>::value) ||
-        !(is_convertible<device_mode, input>::value) ||
-        !(is_convertible<device_mode, output>::value)
-    );
-
-    // Close input sequences in reverse order and output sequences 
-    // in forward order
-    if (!is_convertible<filter_mode, dual_use>::value) {
-        detail::execute_all(
-            detail::call_close(device_, BOOST_IOS::in),
-            detail::call_close(filter_, device_, BOOST_IOS::in),
-            detail::call_close(filter_, device_, BOOST_IOS::out),
-            detail::call_close(device_, BOOST_IOS::out)
-        );
-    } else if (is_convertible<device_mode, input>::value) {
-        detail::execute_all(
-            detail::call_close(device_, BOOST_IOS::in),
-            detail::call_close(filter_, device_, BOOST_IOS::in)
-        );
-    } else {
-        detail::execute_all(
-            detail::call_close(filter_, device_, BOOST_IOS::out),
-            detail::call_close(device_, BOOST_IOS::out)
-        );
-    }
-}
-
-template<typename Filter, typename Device, typename Mode>
-void composite_device<Filter, Device, Mode>::close(BOOST_IOS::openmode which)
-{
-    BOOST_STATIC_ASSERT((is_convertible<Mode, two_sequence>::value));
-    BOOST_STATIC_ASSERT(!(is_convertible<filter_mode, dual_use>::value));
-
-    // Close input sequences in reverse order
-    if (which == BOOST_IOS::in) {
-        detail::execute_all(
-            detail::call_close(device_, BOOST_IOS::in),
-            detail::call_close(filter_, device_, BOOST_IOS::in) 
-        );
-    }
-
-    // Close output sequences in forward order
-    if (which == BOOST_IOS::out) {
-        detail::execute_all(
-            detail::call_close(filter_, device_, BOOST_IOS::out),
-            detail::call_close(device_, BOOST_IOS::out)
-        );
-    }
-}
-
-template<typename Filter, typename Device, typename Mode>
-bool composite_device<Filter, Device, Mode>::flush()
-{
-    bool r1 = iostreams::flush(filter_, device_);
-    bool r2 = iostreams::flush(device_);
-    return r1 && r2;
-}
-
-template<typename Filter, typename Device, typename Mode>
-std::streamsize
-composite_device<Filter, Device, Mode>::optimal_buffer_size() const
-{ return iostreams::optimal_buffer_size(device_); }
-
-} // End namespace detail.
-
-} } // End namespaces iostreams, boost.
-
-#include <boost/iostreams/detail/config/enable_warnings.hpp>
-
-#endif // #ifndef BOOST_IOSTREAMS_COMPOSE_HPP_INCLUDED

+ 0 - 249
contrib/restricted/boost/boost/iostreams/copy.hpp

@@ -1,249 +0,0 @@
-// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
-// (C) Copyright 2003-2007 Jonathan Turkanis
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
-
-// See http://www.boost.org/libs/iostreams for documentation.
-
-// Contains: The function template copy, which reads data from a Source 
-// and writes it to a Sink until the end of the sequence is reached, returning 
-// the number of characters transfered.
-
-// The implementation is complicated by the need to handle smart adapters
-// and direct devices.
-
-#ifndef BOOST_IOSTREAMS_COPY_HPP_INCLUDED
-#define BOOST_IOSTREAMS_COPY_HPP_INCLUDED
-
-#if defined(_MSC_VER)
-# pragma once
-#endif              
-
-#include <boost/config.hpp>                 // Make sure ptrdiff_t is in std.
-#include <algorithm>                        // copy, min.
-#include <cstddef>                          // ptrdiff_t.
-#include <utility>                          // pair.
-#include <boost/bind.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/iostreams/chain.hpp>
-#include <boost/iostreams/constants.hpp>
-#include <boost/iostreams/detail/adapter/non_blocking_adapter.hpp>        
-#include <boost/iostreams/detail/buffer.hpp>
-#include <boost/iostreams/detail/enable_if_stream.hpp>  
-#include <boost/iostreams/detail/execute.hpp>
-#include <boost/iostreams/detail/functional.hpp>
-#include <boost/iostreams/detail/ios.hpp>   // failure, streamsize.                   
-#include <boost/iostreams/detail/resolve.hpp>                   
-#include <boost/iostreams/detail/wrap_unwrap.hpp>
-#include <boost/iostreams/operations.hpp>  // read, write, close.
-#include <boost/iostreams/pipeline.hpp>
-#include <boost/static_assert.hpp>  
-#include <boost/type_traits/is_same.hpp> 
-
-namespace boost { namespace iostreams {
-
-namespace detail {
-
-    // The following four overloads of copy_impl() optimize 
-    // copying in the case that one or both of the two devices
-    // models Direct (see 
-    // http://www.boost.org/libs/iostreams/doc/index.html?path=4.1.1.4)
-
-// Copy from a direct source to a direct sink
-template<typename Source, typename Sink>
-std::streamsize copy_impl( Source& src, Sink& snk, 
-                           std::streamsize /* buffer_size */,
-                           mpl::true_, mpl::true_ )
-{   
-    using namespace std;
-    typedef typename char_type_of<Source>::type  char_type;
-    typedef std::pair<char_type*, char_type*>    pair_type;
-    pair_type p1 = iostreams::input_sequence(src);
-    pair_type p2 = iostreams::output_sequence(snk);
-    std::streamsize total = 
-        static_cast<std::streamsize>(
-            (std::min)(p1.second - p1.first, p2.second - p2.first)
-        );
-    std::copy(p1.first, p1.first + total, p2.first);
-    return total;
-}
-
-// Copy from a direct source to an indirect sink
-template<typename Source, typename Sink>
-std::streamsize copy_impl( Source& src, Sink& snk, 
-                           std::streamsize /* buffer_size */,
-                           mpl::true_, mpl::false_ )
-{
-    using namespace std;
-    typedef typename char_type_of<Source>::type  char_type;
-    typedef std::pair<char_type*, char_type*>    pair_type;
-    pair_type p = iostreams::input_sequence(src);
-    std::streamsize size, total;
-    for ( total = 0, size = static_cast<std::streamsize>(p.second - p.first);
-          total < size; )
-    {
-        std::streamsize amt = 
-            iostreams::write(snk, p.first + total, size - total); 
-        total += amt;
-    }
-    return total;
-}
-
-// Copy from an indirect source to a direct sink
-template<typename Source, typename Sink>
-std::streamsize copy_impl( Source& src, Sink& snk, 
-                           std::streamsize buffer_size,
-                           mpl::false_, mpl::true_ )
-{
-    typedef typename char_type_of<Source>::type  char_type;
-    typedef std::pair<char_type*, char_type*>    pair_type;
-    detail::basic_buffer<char_type>  buf(buffer_size);
-    pair_type                        p = snk.output_sequence();
-    std::streamsize                  total = 0;
-    std::ptrdiff_t                   capacity = p.second - p.first;
-    while (true) {
-        std::streamsize amt = 
-            iostreams::read(
-                src, 
-                buf.data(),
-                buffer_size < capacity - total ?
-                    buffer_size :
-                    static_cast<std::streamsize>(capacity - total)
-            );
-        if (amt == -1)
-            break;
-        std::copy(buf.data(), buf.data() + amt, p.first + total);
-        total += amt;
-    }
-    return total;
-}
-
-// Copy from an indirect source to an indirect sink
-template<typename Source, typename Sink>
-std::streamsize copy_impl( Source& src, Sink& snk, 
-                           std::streamsize buffer_size,
-                           mpl::false_, mpl::false_ )
-{ 
-    typedef typename char_type_of<Source>::type char_type;
-    detail::basic_buffer<char_type>  buf(buffer_size);
-    non_blocking_adapter<Sink>       nb(snk);
-    std::streamsize                  total = 0;
-    bool                             done = false;
-    while (!done) {
-        std::streamsize amt;
-        done = (amt = iostreams::read(src, buf.data(), buffer_size)) == -1;
-        if (amt != -1) {
-            iostreams::write(nb, buf.data(), amt);
-            total += amt;
-        }
-    }
-    return total;
-}
-
-    // The following function object is used with 
-    // boost::iostreams::detail::execute() in the primary 
-    // overload of copy_impl(), below
-
-// Function object that delegates to one of the above four 
-// overloads of compl_impl()
-template<typename Source, typename Sink>
-class copy_operation {
-public:
-    typedef std::streamsize result_type;
-    copy_operation(Source& src, Sink& snk, std::streamsize buffer_size)
-        : src_(src), snk_(snk), buffer_size_(buffer_size)
-        { }
-    std::streamsize operator()() 
-    {
-        return copy_impl( src_, snk_, buffer_size_, 
-                          is_direct<Source>(), is_direct<Sink>() );
-    }
-    copy_operation(copy_operation const& other) = default;
-private:
-    BOOST_DELETED_FUNCTION(copy_operation& operator=(const copy_operation&));
-    Source&          src_;
-    Sink&            snk_;
-    std::streamsize  buffer_size_;
-};
-
-// Primary overload of copy_impl. Delegates to one of the above four 
-// overloads of compl_impl(), depending on which of the two given 
-// devices, if any, models Direct (see 
-// http://www.boost.org/libs/iostreams/doc/index.html?path=4.1.1.4)
-template<typename Source, typename Sink>
-std::streamsize copy_impl(Source src, Sink snk, std::streamsize buffer_size)
-{
-    using namespace std;
-    typedef typename char_type_of<Source>::type  src_char;
-    typedef typename char_type_of<Sink>::type    snk_char;
-    BOOST_STATIC_ASSERT((is_same<src_char, snk_char>::value));
-    return detail::execute_all(
-               copy_operation<Source, Sink>(src, snk, buffer_size),
-               detail::call_close_all(src),
-               detail::call_close_all(snk)
-           );
-}
-
-} // End namespace detail.
-                    
-//------------------Definition of copy----------------------------------------//
-
-// Overload of copy() for the case where neither the source nor the sink is
-// a standard stream or stream buffer
-template<typename Source, typename Sink>
-std::streamsize
-copy( const Source& src, const Sink& snk,
-      std::streamsize buffer_size = default_device_buffer_size
-      BOOST_IOSTREAMS_DISABLE_IF_STREAM(Source)
-      BOOST_IOSTREAMS_DISABLE_IF_STREAM(Sink) )
-{ 
-    typedef typename char_type_of<Source>::type char_type;
-    return detail::copy_impl( detail::resolve<input, char_type>(src), 
-                              detail::resolve<output, char_type>(snk), 
-                              buffer_size ); 
-}
-
-// Overload of copy() for the case where the source, but not the sink, is
-// a standard stream or stream buffer
-template<typename Source, typename Sink>
-std::streamsize
-copy( Source& src, const Sink& snk,
-      std::streamsize buffer_size = default_device_buffer_size
-      BOOST_IOSTREAMS_ENABLE_IF_STREAM(Source)
-      BOOST_IOSTREAMS_DISABLE_IF_STREAM(Sink) ) 
-{ 
-    typedef typename char_type_of<Source>::type char_type;
-    return detail::copy_impl( detail::wrap(src), 
-                              detail::resolve<output, char_type>(snk), 
-                              buffer_size );
-}
-
-// Overload of copy() for the case where the sink, but not the source, is
-// a standard stream or stream buffer
-template<typename Source, typename Sink>
-std::streamsize
-copy( const Source& src, Sink& snk,
-      std::streamsize buffer_size = default_device_buffer_size
-      BOOST_IOSTREAMS_DISABLE_IF_STREAM(Source)
-      BOOST_IOSTREAMS_ENABLE_IF_STREAM(Sink) ) 
-{ 
-    typedef typename char_type_of<Source>::type char_type;
-    return detail::copy_impl( detail::resolve<input, char_type>(src), 
-                              detail::wrap(snk), buffer_size );
-}
-
-// Overload of copy() for the case where neither the source nor the sink is
-// a standard stream or stream buffer
-template<typename Source, typename Sink>
-std::streamsize
-copy( Source& src, Sink& snk,
-      std::streamsize buffer_size = default_device_buffer_size
-      BOOST_IOSTREAMS_ENABLE_IF_STREAM(Source)
-      BOOST_IOSTREAMS_ENABLE_IF_STREAM(Sink) ) 
-{ 
-    return detail::copy_impl(detail::wrap(src), detail::wrap(snk), buffer_size);
-}
-
-} } // End namespaces iostreams, boost.
-
-#endif // #ifndef BOOST_IOSTREAMS_COPY_HPP_INCLUDED

+ 0 - 46
contrib/restricted/boost/boost/iostreams/detail/absolute_path.hpp

@@ -1,46 +0,0 @@
-/*
- * Distributed under the Boost Software License, Version 1.0.(See accompanying 
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
- * 
- * See http://www.boost.org/libs/iostreams for documentation.
-
- * File:        boost/iostreams/detail/execute.hpp
- * Date:        Thu Dec 06 13:21:54 MST 2007
- * Copyright:   2007-2008 CodeRage, LLC
- * Author:      Jonathan Turkanis
- * Contact:     turkanis at coderage dot com
- *
- * Defines the function boost::iostreams::detail::absolute_path, used for 
- * debug output for mapped files.
- */
-
-#ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
-#define BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED
-
-#include <string>
-#include <boost/iostreams/detail/config/windows_posix.hpp>
-#ifdef BOOST_IOSTREAMS_WINDOWS
-# include <cctype>
-#endif
-#include <boost/iostreams/detail/current_directory.hpp>
-
-namespace boost { namespace iostreams { namespace detail {
-
-// Resolves the given path relative to the current working directory
-inline std::string absolute_path(const std::string& path)
-{
-#ifdef BOOST_IOSTREAMS_WINDOWS
-    return path.size() && (path[0] == '/' || path[0] == '\\') ||
-           path.size() > 1 && std::isalpha(path[0]) && path[1] == ':' ?
-               path :
-               current_directory() + '\\' + path;
-#else // #ifdef BOOST_IOSTREAMS_WINDOWS
-    return path.size() && (path[0] == '/') ?
-        path :
-        current_directory() + '/' + path;
-#endif // #ifdef BOOST_IOSTREAMS_WINDOWS
-}
-
-} } } // End namespaces detail, iostreams, boost.
-
-#endif // #ifndef BOOST_IOSTREAMS_DETAIL_ABSOLUTE_PATH_HPP_INCLUDED

+ 0 - 67
contrib/restricted/boost/boost/iostreams/detail/adapter/device_adapter.hpp

@@ -1,67 +0,0 @@
-/*
- * Defines the class template boost::iostreams::detail::device_adapter,
- * a convenience base class for device adapters.
- *
- * File:        boost/iostreams/detail/adapter/filter_adapter.hpp
- * Date:        Mon Nov 26 14:35:48 MST 2007
- * 
- * Copyright:   2007-2008 CodeRage, LLC
- * Author:      Jonathan Turkanis
- * Contact:     turkanis at coderage dot com
- *
- * Distributed under the Boost Software License, Version 1.0.(See accompanying 
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
- * 
- * See http://www.boost.org/libs/iostreams for documentation.
- */
-
-#ifndef BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
-#define BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
-
-#include <boost/iostreams/categories.hpp>
-#include <boost/iostreams/detail/call_traits.hpp>
-#include <boost/iostreams/detail/ios.hpp>
-#include <boost/iostreams/operations.hpp>
-#include <boost/iostreams/traits.hpp>
-#include <boost/static_assert.hpp>
-
-namespace boost { namespace iostreams { namespace detail {
-
-template<typename T>
-class device_adapter {
-private:
-    typedef typename detail::value_type<T>::type value_type;
-    typedef typename detail::param_type<T>::type param_type;
-public:
-    explicit device_adapter(param_type t) : t_(t) { }
-    T& component() { return t_; }
-
-    void close() 
-    {
-        detail::close_all(t_);
-    }
-
-    void close(BOOST_IOS::openmode which) 
-    { 
-        iostreams::close(t_, which); 
-    }
-
-    bool flush() 
-    { 
-        return iostreams::flush(t_); 
-    }
-
-    template<typename Locale> // Avoid dependency on <locale>
-    void imbue(const Locale& loc) { iostreams::imbue(t_, loc); }
-
-    std::streamsize optimal_buffer_size() const 
-    { return iostreams::optimal_buffer_size(t_); }
-public:
-    value_type t_;
-};
-
-//----------------------------------------------------------------------------//
-
-} } } // End namespaces detail, iostreams, boost.
-
-#endif // #ifndef BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED

+ 0 - 281
contrib/restricted/boost/boost/iostreams/detail/adapter/direct_adapter.hpp

@@ -1,281 +0,0 @@
-// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
-// (C) Copyright 2003-2007 Jonathan Turkanis
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
-
-// See http://www.boost.org/libs/iostreams for documentation.
-
-#ifndef BOOST_IOSTREAMS_DETAIL_DIRECT_ADAPTER_HPP_INCLUDED
-#define BOOST_IOSTREAMS_DETAIL_DIRECT_ADAPTER_HPP_INCLUDED
-
-#if defined(_MSC_VER)
-# pragma once
-#endif              
-
-#include <boost/config.hpp>       // SFINAE, MSVC, put ptrdiff_t in std.
-#include <algorithm>              // copy, min.
-#include <cstddef>                // ptrdiff_t.
-#include <boost/detail/workaround.hpp>
-#include <boost/iostreams/categories.hpp>
-#include <boost/iostreams/detail/config/limits.hpp>        // forwarding.
-#include <boost/iostreams/detail/config/wide_streams.hpp>  // locale.
-#include <boost/iostreams/detail/double_object.hpp>
-#include <boost/iostreams/detail/error.hpp>
-#include <boost/iostreams/detail/ios.hpp>  // openmode, seekdir, int types.
-#include <boost/iostreams/traits.hpp>      // mode_of, is_direct.
-#include <boost/iostreams/operations.hpp>
-#include <boost/mpl/bool.hpp> 
-#include <boost/mpl/or.hpp> 
-#include <boost/preprocessor/iteration/local.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-
-// Must come last.
-#include <boost/iostreams/detail/config/disable_warnings.hpp> // VC7.1
-
-namespace boost { namespace iostreams { namespace detail {
-                    
-//------------------Definition of direct_adapter_base-------------------------//
-
-// Put all initialization in base class to faciliate forwarding.
-template<typename Direct>
-class direct_adapter_base {
-public:
-    typedef typename char_type_of<Direct>::type  char_type;
-    typedef typename mode_of<Direct>::type       mode_type;
-    struct category 
-        : mode_type,
-          device_tag,
-          closable_tag
-          #ifndef BOOST_IOSTREAMS_NO_LOCALE
-          , localizable_tag
-          #endif
-        { };
-protected:
-    explicit direct_adapter_base(const Direct& d);
-    typedef is_convertible<category, two_sequence> is_double;
-    struct pointers {
-        char_type *beg, *ptr, *end;
-    };
-    void init_input(mpl::true_);
-    void init_input(mpl::false_) { }
-    void init_output(mpl::true_);
-    void init_output(mpl::false_) { }
-    double_object<pointers, is_double>  ptrs_;
-    Direct                              d_;
-};
-
-template<typename Direct>
-class direct_adapter : private direct_adapter_base<Direct> {
-private:
-    typedef direct_adapter_base<Direct>      base_type;
-    typedef typename base_type::pointers     pointers;
-    typedef typename base_type::is_double    is_double;
-    using base_type::ptrs_;
-    using base_type::d_;
-public:
-    typedef typename base_type::char_type    char_type;
-    typedef typename base_type::category     category;
-
-        // Constructors
-
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
-    direct_adapter(const Direct& d) : base_type(d) { }   
-    direct_adapter(const direct_adapter& d) : base_type(d) { }
-# define BOOST_PP_LOCAL_LIMITS (1, BOOST_IOSTREAMS_MAX_FORWARDING_ARITY)
-#else
-    template<typename U>
-    struct is_direct
-        : mpl::or_< 
-              is_same<U, direct_adapter<Direct> >, 
-              is_same<U, Direct> 
-          >
-        { };
-    template<typename U>
-    direct_adapter(const U& u) 
-        : base_type(forward(u, is_direct<U>()))
-        { }
-# define BOOST_PP_LOCAL_LIMITS (2, BOOST_IOSTREAMS_MAX_FORWARDING_ARITY)
-#endif
-
-#define BOOST_PP_LOCAL_MACRO(n) \
-    template<BOOST_PP_ENUM_PARAMS(n, typename P)> \
-    direct_adapter(BOOST_PP_ENUM_BINARY_PARAMS(n, const P, &p)) \
-        : base_type(Direct(BOOST_PP_ENUM_PARAMS(n, p))) \
-        { } \
-    /**/
-#include BOOST_PP_LOCAL_ITERATE()
-#undef BOOST_PP_LOCAL_MACRO
-
-        // Device interface.
-
-    std::streamsize read(char_type* s, std::streamsize n);
-    std::streamsize write(const char_type* s, std::streamsize n);
-    std::streampos seek( stream_offset, BOOST_IOS::seekdir,
-                         BOOST_IOS::openmode = BOOST_IOS::in | BOOST_IOS::out );
-    void close();
-    void close(BOOST_IOS::openmode which);
-#ifndef BOOST_IOSTREAMS_NO_LOCALE
-    void imbue(const std::locale&);
-#endif
-
-        // Direct device access.
-
-    Direct& operator*() { return d_; }
-    Direct* operator->() { return &d_; }
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
-private:
-    template<typename U>
-    static Direct forward(const U& u, mpl::true_) { return u; }
-    template<typename U>
-    static Direct forward(const U& u, mpl::false_) { return Direct(u); }
-#endif
-};
-
-//--------------Definition of wrap_direct and unwrap_direct-------------------//
-
-template<typename Device>
-struct wrap_direct_traits 
-    : mpl::if_<
-          is_direct<Device>,
-          direct_adapter<Device>,
-          Device
-      >
-    { };
-
-template<typename Device>
-typename wrap_direct_traits<Device>::type
-inline wrap_direct(Device dev) 
-{ 
-    typedef typename wrap_direct_traits<Device>::type type;
-    return type(dev); 
-}
-
-template<typename Device>
-inline Device& unwrap_direct(Device& d) { return d; }  
-
-template<typename Device>
-inline Device& unwrap_direct(direct_adapter<Device>& d) { return *d; }  
-
-//--------------Implementation of direct_adapter_base-------------------------//
-
-template<typename Direct>
-direct_adapter_base<Direct>::direct_adapter_base(const Direct& d) : d_(d)
-{
-    init_input(is_convertible<category, input>());
-    init_output(is_convertible<category, output>());
-}
-
-template<typename Direct>
-void direct_adapter_base<Direct>::init_input(mpl::true_) 
-{
-    std::pair<char_type*, char_type*> seq = iostreams::input_sequence(d_);
-    ptrs_.first().beg = seq.first;
-    ptrs_.first().ptr = seq.first;
-    ptrs_.first().end = seq.second;
-}
-
-template<typename Direct>
-void direct_adapter_base<Direct>::init_output(mpl::true_) 
-{
-    std::pair<char_type*, char_type*> seq = iostreams::output_sequence(d_);
-    ptrs_.second().beg = seq.first;
-    ptrs_.second().ptr = seq.first;
-    ptrs_.second().end = seq.second;
-}
-
-//--------------Implementation of direct_adapter------------------------------//
-
-template<typename Direct>
-inline std::streamsize direct_adapter<Direct>::read
-    (char_type* s, std::streamsize n)
-{
-    using namespace std;
-    pointers& get = ptrs_.first();
-    std::streamsize avail = 
-        static_cast<std::streamsize>(get.end - get.ptr);
-    std::streamsize result = (std::min)(n, avail);
-    std::copy(get.ptr, get.ptr + result, s);
-    get.ptr += result;
-    return result != 0 ? result : -1;
-}
-
-template<typename Direct>
-inline std::streamsize direct_adapter<Direct>::write
-    (const char_type* s, std::streamsize n)
-{
-    using namespace std;
-    pointers& put = ptrs_.second();
-    if (n > static_cast<std::streamsize>(put.end - put.ptr))
-        boost::throw_exception(write_area_exhausted());
-    std::copy(s, s + n, put.ptr);
-    put.ptr += n;
-    return n;
-}
-
-template<typename Direct>
-inline std::streampos direct_adapter<Direct>::seek
-    ( stream_offset off, BOOST_IOS::seekdir way, 
-      BOOST_IOS::openmode which )
-{
-    using namespace std;
-    pointers& get = ptrs_.first();
-    pointers& put = ptrs_.second();
-    if (way == BOOST_IOS::cur && get.ptr != put.ptr)
-       boost::throw_exception(bad_seek());
-    ptrdiff_t next = 0;
-    if ((which & BOOST_IOS::in) || !is_double::value) {
-        if (way == BOOST_IOS::beg)
-            next = off; 
-        else if (way == BOOST_IOS::cur)
-            next = get.ptr - get.beg + off; 
-        else
-            next = get.end - get.beg + off; 
-        if (next >= 0 && next <= get.end - get.beg)
-            get.ptr = get.beg + next;
-        else
-            boost::throw_exception(bad_seek());
-    }
-    if ((which & BOOST_IOS::out) && is_double::value) {
-        if (way == BOOST_IOS::beg)
-            next = off; 
-        else if (way == BOOST_IOS::cur)
-            next = put.ptr - put.beg + off; 
-        else
-            next = put.end - put.beg + off; 
-        if (next >= 0 && next <= put.end - put.beg)
-            put.ptr = put.beg + next;
-        else
-            boost::throw_exception(bad_seek());
-    }
-    return offset_to_position(next);
-}
-
-template<typename Direct>
-void direct_adapter<Direct>::close() 
-{ 
-    BOOST_STATIC_ASSERT((!is_convertible<category, two_sequence>::value));
-    detail::close_all(d_);
-}
-
-template<typename Direct>
-void direct_adapter<Direct>::close(BOOST_IOS::openmode which) 
-{ 
-    BOOST_STATIC_ASSERT((is_convertible<category, two_sequence>::value));
-    boost::iostreams::close(d_, which);
-}
-
-#ifndef BOOST_IOSTREAMS_NO_LOCALE
-    template<typename Direct>
-    void direct_adapter<Direct>::imbue(const std::locale& loc) 
-    { boost::iostreams::imbue(d_, loc); }
-#endif
-
-} } } // End namespaces detail, iostreams, boost.
-
-#include <boost/iostreams/detail/config/enable_warnings.hpp>
-
-#endif // #ifndef BOOST_IOSTREAMS_DETAIL_DIRECT_ADAPTER_HPP_INCLUDED

Some files were not shown because too many files changed in this diff