[Boostheaders-commits] r41 - in pkg/BH/inst/include/boost: . detail iostreams iostreams/detail iostreams/detail/adapter iostreams/detail/broken_overload_resolution iostreams/detail/config iostreams/detail/streambuf iostreams/detail/vc6 iostreams/device iostreams/filter random test
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat May 4 03:45:39 CEST 2013
Author: edd
Date: 2013-05-04 03:45:38 +0200 (Sat, 04 May 2013)
New Revision: 41
Added:
pkg/BH/inst/include/boost/detail/is_incrementable.hpp
pkg/BH/inst/include/boost/iostreams/
pkg/BH/inst/include/boost/iostreams/categories.hpp
pkg/BH/inst/include/boost/iostreams/chain.hpp
pkg/BH/inst/include/boost/iostreams/char_traits.hpp
pkg/BH/inst/include/boost/iostreams/checked_operations.hpp
pkg/BH/inst/include/boost/iostreams/close.hpp
pkg/BH/inst/include/boost/iostreams/code_converter.hpp
pkg/BH/inst/include/boost/iostreams/combine.hpp
pkg/BH/inst/include/boost/iostreams/compose.hpp
pkg/BH/inst/include/boost/iostreams/concepts.hpp
pkg/BH/inst/include/boost/iostreams/constants.hpp
pkg/BH/inst/include/boost/iostreams/copy.hpp
pkg/BH/inst/include/boost/iostreams/detail/
pkg/BH/inst/include/boost/iostreams/detail/absolute_path.hpp
pkg/BH/inst/include/boost/iostreams/detail/access_control.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/
pkg/BH/inst/include/boost/iostreams/detail/adapter/concept_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/device_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/direct_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/filter_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/mode_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/non_blocking_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/output_iterator_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/adapter/range_adapter.hpp
pkg/BH/inst/include/boost/iostreams/detail/add_facet.hpp
pkg/BH/inst/include/boost/iostreams/detail/bool_trait_def.hpp
pkg/BH/inst/include/boost/iostreams/detail/broken_overload_resolution/
pkg/BH/inst/include/boost/iostreams/detail/broken_overload_resolution/forward.hpp
pkg/BH/inst/include/boost/iostreams/detail/broken_overload_resolution/stream.hpp
pkg/BH/inst/include/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp
pkg/BH/inst/include/boost/iostreams/detail/buffer.hpp
pkg/BH/inst/include/boost/iostreams/detail/call_traits.hpp
pkg/BH/inst/include/boost/iostreams/detail/char_traits.hpp
pkg/BH/inst/include/boost/iostreams/detail/codecvt_helper.hpp
pkg/BH/inst/include/boost/iostreams/detail/codecvt_holder.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/
pkg/BH/inst/include/boost/iostreams/detail/config/auto_link.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/bzip2.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/codecvt.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/disable_warnings.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/dyn_link.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/enable_warnings.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/fpos.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/gcc.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/limits.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/overload_resolution.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/rtl.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/unreachable_return.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/wide_streams.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/windows_posix.hpp
pkg/BH/inst/include/boost/iostreams/detail/config/zlib.hpp
pkg/BH/inst/include/boost/iostreams/detail/counted_array.hpp
pkg/BH/inst/include/boost/iostreams/detail/current_directory.hpp
pkg/BH/inst/include/boost/iostreams/detail/default_arg.hpp
pkg/BH/inst/include/boost/iostreams/detail/dispatch.hpp
pkg/BH/inst/include/boost/iostreams/detail/double_object.hpp
pkg/BH/inst/include/boost/iostreams/detail/enable_if_stream.hpp
pkg/BH/inst/include/boost/iostreams/detail/error.hpp
pkg/BH/inst/include/boost/iostreams/detail/execute.hpp
pkg/BH/inst/include/boost/iostreams/detail/file_handle.hpp
pkg/BH/inst/include/boost/iostreams/detail/forward.hpp
pkg/BH/inst/include/boost/iostreams/detail/fstream.hpp
pkg/BH/inst/include/boost/iostreams/detail/functional.hpp
pkg/BH/inst/include/boost/iostreams/detail/ios.hpp
pkg/BH/inst/include/boost/iostreams/detail/iostream.hpp
pkg/BH/inst/include/boost/iostreams/detail/is_dereferenceable.hpp
pkg/BH/inst/include/boost/iostreams/detail/is_iterator_range.hpp
pkg/BH/inst/include/boost/iostreams/detail/newline.hpp
pkg/BH/inst/include/boost/iostreams/detail/optional.hpp
pkg/BH/inst/include/boost/iostreams/detail/param_type.hpp
pkg/BH/inst/include/boost/iostreams/detail/path.hpp
pkg/BH/inst/include/boost/iostreams/detail/push.hpp
pkg/BH/inst/include/boost/iostreams/detail/push_params.hpp
pkg/BH/inst/include/boost/iostreams/detail/resolve.hpp
pkg/BH/inst/include/boost/iostreams/detail/restrict_impl.hpp
pkg/BH/inst/include/boost/iostreams/detail/select.hpp
pkg/BH/inst/include/boost/iostreams/detail/select_by_size.hpp
pkg/BH/inst/include/boost/iostreams/detail/streambuf.hpp
pkg/BH/inst/include/boost/iostreams/detail/streambuf/
pkg/BH/inst/include/boost/iostreams/detail/streambuf/chainbuf.hpp
pkg/BH/inst/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp
pkg/BH/inst/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
pkg/BH/inst/include/boost/iostreams/detail/streambuf/linked_streambuf.hpp
pkg/BH/inst/include/boost/iostreams/detail/system_failure.hpp
pkg/BH/inst/include/boost/iostreams/detail/template_params.hpp
pkg/BH/inst/include/boost/iostreams/detail/translate_int_type.hpp
pkg/BH/inst/include/boost/iostreams/detail/vc6/
pkg/BH/inst/include/boost/iostreams/detail/vc6/close.hpp
pkg/BH/inst/include/boost/iostreams/detail/vc6/read.hpp
pkg/BH/inst/include/boost/iostreams/detail/vc6/write.hpp
pkg/BH/inst/include/boost/iostreams/detail/wrap_unwrap.hpp
pkg/BH/inst/include/boost/iostreams/device/
pkg/BH/inst/include/boost/iostreams/device/array.hpp
pkg/BH/inst/include/boost/iostreams/device/back_inserter.hpp
pkg/BH/inst/include/boost/iostreams/device/file.hpp
pkg/BH/inst/include/boost/iostreams/device/file_descriptor.hpp
pkg/BH/inst/include/boost/iostreams/device/mapped_file.hpp
pkg/BH/inst/include/boost/iostreams/device/null.hpp
pkg/BH/inst/include/boost/iostreams/filter/
pkg/BH/inst/include/boost/iostreams/filter/aggregate.hpp
pkg/BH/inst/include/boost/iostreams/filter/bzip2.hpp
pkg/BH/inst/include/boost/iostreams/filter/counter.hpp
pkg/BH/inst/include/boost/iostreams/filter/grep.hpp
pkg/BH/inst/include/boost/iostreams/filter/gzip.hpp
pkg/BH/inst/include/boost/iostreams/filter/line.hpp
pkg/BH/inst/include/boost/iostreams/filter/newline.hpp
pkg/BH/inst/include/boost/iostreams/filter/regex.hpp
pkg/BH/inst/include/boost/iostreams/filter/stdio.hpp
pkg/BH/inst/include/boost/iostreams/filter/symmetric.hpp
pkg/BH/inst/include/boost/iostreams/filter/test.hpp
pkg/BH/inst/include/boost/iostreams/filter/zlib.hpp
pkg/BH/inst/include/boost/iostreams/filtering_stream.hpp
pkg/BH/inst/include/boost/iostreams/filtering_streambuf.hpp
pkg/BH/inst/include/boost/iostreams/flush.hpp
pkg/BH/inst/include/boost/iostreams/get.hpp
pkg/BH/inst/include/boost/iostreams/imbue.hpp
pkg/BH/inst/include/boost/iostreams/input_sequence.hpp
pkg/BH/inst/include/boost/iostreams/invert.hpp
pkg/BH/inst/include/boost/iostreams/operations.hpp
pkg/BH/inst/include/boost/iostreams/operations_fwd.hpp
pkg/BH/inst/include/boost/iostreams/optimal_buffer_size.hpp
pkg/BH/inst/include/boost/iostreams/output_sequence.hpp
pkg/BH/inst/include/boost/iostreams/pipeline.hpp
pkg/BH/inst/include/boost/iostreams/positioning.hpp
pkg/BH/inst/include/boost/iostreams/put.hpp
pkg/BH/inst/include/boost/iostreams/putback.hpp
pkg/BH/inst/include/boost/iostreams/read.hpp
pkg/BH/inst/include/boost/iostreams/restrict.hpp
pkg/BH/inst/include/boost/iostreams/seek.hpp
pkg/BH/inst/include/boost/iostreams/skip.hpp
pkg/BH/inst/include/boost/iostreams/slice.hpp
pkg/BH/inst/include/boost/iostreams/stream.hpp
pkg/BH/inst/include/boost/iostreams/stream_buffer.hpp
pkg/BH/inst/include/boost/iostreams/tee.hpp
pkg/BH/inst/include/boost/iostreams/traits.hpp
pkg/BH/inst/include/boost/iostreams/traits_fwd.hpp
pkg/BH/inst/include/boost/iostreams/write.hpp
pkg/BH/inst/include/boost/random/linear_congruential.hpp
pkg/BH/inst/include/boost/random/uniform_01.hpp
pkg/BH/inst/include/boost/random/uniform_smallint.hpp
pkg/BH/inst/include/boost/test/unit_test.hpp
Log:
adding 'iostreams' (#2768)
Added: pkg/BH/inst/include/boost/detail/is_incrementable.hpp
===================================================================
--- pkg/BH/inst/include/boost/detail/is_incrementable.hpp (rev 0)
+++ pkg/BH/inst/include/boost/detail/is_incrementable.hpp 2013-05-04 01:45:38 UTC (rev 41)
@@ -0,0 +1,134 @@
+// Copyright David Abrahams 2004. Use, modification and distribution is
+// subject to 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)
+#ifndef IS_INCREMENTABLE_DWA200415_HPP
+# define IS_INCREMENTABLE_DWA200415_HPP
+
+# include <boost/type_traits/detail/template_arity_spec.hpp>
+# include <boost/type_traits/remove_cv.hpp>
+# include <boost/mpl/aux_/lambda_support.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/detail/workaround.hpp>
+
+// Must be the last include
+# include <boost/type_traits/detail/bool_trait_def.hpp>
+
+namespace boost { namespace detail {
+
+// is_incrementable<T> metafunction
+//
+// Requires: Given x of type T&, if the expression ++x is well-formed
+// it must have complete type; otherwise, it must neither be ambiguous
+// nor violate access.
+
+// This namespace ensures that ADL doesn't mess things up.
+namespace is_incrementable_
+{
+ // a type returned from operator++ when no increment is found in the
+ // type's own namespace
+ struct tag {};
+
+ // any soaks up implicit conversions and makes the following
+ // operator++ less-preferred than any other such operator that
+ // might be found via ADL.
+ struct any { template <class T> any(T const&); };
+
+ // This is a last-resort operator++ for when none other is found
+# if BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 2
+
+}
+
+namespace is_incrementable_2
+{
+ is_incrementable_::tag operator++(is_incrementable_::any const&);
+ is_incrementable_::tag operator++(is_incrementable_::any const&,int);
+}
+using namespace is_incrementable_2;
+
+namespace is_incrementable_
+{
+
+# else
+
+ tag operator++(any const&);
+ tag operator++(any const&,int);
+
+# endif
+
+# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
+ || BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+# define BOOST_comma(a,b) (a)
+# else
+ // In case an operator++ is found that returns void, we'll use ++x,0
+ tag operator,(tag,int);
+# define BOOST_comma(a,b) (a,b)
+# endif
+
+# if defined(BOOST_MSVC)
+# pragma warning(push)
+# pragma warning(disable:4913) // Warning about operator,
+# endif
+
+ // two check overloads help us identify which operator++ was picked
+ char (& check_(tag) )[2];
+
+ template <class T>
+ char check_(T const&);
+
+
+ template <class T>
+ struct impl
+ {
+ static typename boost::remove_cv<T>::type& x;
+
+ BOOST_STATIC_CONSTANT(
+ bool
+ , value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
+ );
+ };
+
+ template <class T>
+ struct postfix_impl
+ {
+ static typename boost::remove_cv<T>::type& x;
+
+ BOOST_STATIC_CONSTANT(
+ bool
+ , value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1
+ );
+ };
+
+# if defined(BOOST_MSVC)
+# pragma warning(pop)
+# endif
+
+}
+
+# undef BOOST_comma
+
+template<typename T>
+struct is_incrementable
+BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
+{
+ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::impl<T>::value)
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_incrementable,(T))
+};
+
+template<typename T>
+struct is_postfix_incrementable
+BOOST_TT_AUX_BOOL_C_BASE(::boost::detail::is_incrementable_::impl<T>::value)
+{
+ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(::boost::detail::is_incrementable_::postfix_impl<T>::value)
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_postfix_incrementable,(T))
+};
+
+} // namespace detail
+
+BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_incrementable)
+BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable)
+
+} // namespace boost
+
+# include <boost/type_traits/detail/bool_trait_undef.hpp>
+
+#endif // IS_INCREMENTABLE_DWA200415_HPP
Added: pkg/BH/inst/include/boost/iostreams/categories.hpp
===================================================================
--- pkg/BH/inst/include/boost/iostreams/categories.hpp (rev 0)
+++ pkg/BH/inst/include/boost/iostreams/categories.hpp 2013-05-04 01:45:38 UTC (rev 41)
@@ -0,0 +1,175 @@
+// (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 category and mode tags for classifying filters, devices and
+// standard stream and stream buffers types.
+
+#ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
+#define BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+namespace boost { namespace iostreams {
+
+//------------------Tags for dispatch according to i/o mode-------------------//
+
+struct any_tag { };
+namespace detail { struct two_sequence : virtual any_tag { }; }
+namespace detail { struct random_access : virtual any_tag { }; }
+namespace detail { struct one_head : virtual any_tag { }; }
+namespace detail { struct two_head : virtual any_tag { }; }
+struct input : virtual any_tag { };
+struct output : virtual any_tag { };
+struct bidirectional : virtual input, virtual output, detail::two_sequence { };
+struct dual_use : virtual input, virtual output { }; // Pseudo-mode.
+struct input_seekable : virtual input, virtual detail::random_access { };
+struct output_seekable : virtual output, virtual detail::random_access { };
+struct seekable
+ : virtual input_seekable,
+ virtual output_seekable,
+ detail::one_head
+ { };
+struct dual_seekable
+ : virtual input_seekable,
+ virtual output_seekable,
+ detail::two_head
+ { };
+struct bidirectional_seekable
+ : input_seekable, output_seekable,
+ bidirectional, detail::two_head
+ { };
+
+//------------------Tags for use as i/o categories----------------------------//
+
+struct device_tag : virtual any_tag { };
+struct filter_tag : virtual any_tag { };
+
+ //
+ // Tags for optional behavior.
+ //
+
+struct peekable_tag : virtual any_tag { }; // Devices.
+struct closable_tag : virtual any_tag { };
+struct flushable_tag : virtual any_tag { };
+struct localizable_tag : virtual any_tag { };
+struct optimally_buffered_tag : virtual any_tag { };
+struct direct_tag : virtual any_tag { }; // Devices.
+struct multichar_tag : virtual any_tag { }; // Filters.
+
+struct source_tag : device_tag, input { };
+struct sink_tag : device_tag, output { };
+struct bidirectional_device_tag : device_tag, bidirectional { };
+struct seekable_device_tag : virtual device_tag, seekable { };
+
+struct input_filter_tag : filter_tag, input { };
+struct output_filter_tag : filter_tag, output { };
+struct bidirectional_filter_tag : filter_tag, bidirectional { };
+struct seekable_filter_tag : filter_tag, seekable { };
+struct dual_use_filter_tag : filter_tag, dual_use { };
+
+struct multichar_input_filter_tag
+ : multichar_tag,
+ input_filter_tag
+ { };
+struct multichar_output_filter_tag
+ : multichar_tag,
+ output_filter_tag
+ { };
+struct multichar_bidirectional_filter_tag
+ : multichar_tag,
+ bidirectional_filter_tag
+ { };
+struct multichar_seekable_filter_tag
+ : multichar_tag,
+ seekable_filter_tag
+ { };
+struct multichar_dual_use_filter_tag
+ : multichar_tag,
+ dual_use_filter_tag
+ { };
+
+ //
+ // Tags for standard streams and streambufs.
+ //
+
+struct std_io_tag : virtual localizable_tag { };
+struct istream_tag
+ : virtual device_tag,
+ virtual peekable_tag,
+ virtual std_io_tag
+ { };
+struct ostream_tag
+ : virtual device_tag,
+ virtual std_io_tag
+ { };
+struct iostream_tag
+ : istream_tag,
+ ostream_tag
+ { };
+struct streambuf_tag
+ : device_tag,
+ peekable_tag,
+ std_io_tag
+ { };
+struct ifstream_tag
+ : input_seekable,
+ closable_tag,
+ istream_tag
+ { };
+struct ofstream_tag
+ : output_seekable,
+ closable_tag,
+ ostream_tag
+ { };
+struct fstream_tag
+ : seekable,
+ closable_tag,
+ iostream_tag
+ { };
+struct filebuf_tag
+ : seekable,
+ closable_tag,
+ streambuf_tag
+ { };
+struct istringstream_tag
+ : input_seekable,
+ istream_tag
+ { };
+struct ostringstream_tag
+ : output_seekable,
+ ostream_tag
+ { };
+struct stringstream_tag
+ : dual_seekable,
+ iostream_tag
+ { };
+struct stringbuf_tag
+ : dual_seekable,
+ streambuf_tag
+ { };
+struct generic_istream_tag
+ : input_seekable,
+ istream_tag
+ { };
+struct generic_ostream_tag
+ : output_seekable,
+ ostream_tag
+ { };
+struct generic_iostream_tag
+ : seekable,
+ iostream_tag
+ { };
+struct generic_streambuf_tag
+ : seekable,
+ streambuf_tag
+ { };
+
+} } // End namespaces iostreams, boost.
+
+#endif // #ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
Added: pkg/BH/inst/include/boost/iostreams/chain.hpp
===================================================================
--- pkg/BH/inst/include/boost/iostreams/chain.hpp (rev 0)
+++ pkg/BH/inst/include/boost/iostreams/chain.hpp 2013-05-04 01:45:38 UTC (rev 41)
@@ -0,0 +1,598 @@
+// (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_CHAIN_HPP_INCLUDED
+#define BOOST_IOSTREAMS_DETAIL_CHAIN_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/assert.hpp>
+#include <exception>
+#include <functional> // unary_function.
+#include <iterator> // advance.
+#include <list>
+#include <memory> // allocator, auto_ptr.
+#include <typeinfo>
+#include <stdexcept> // logic_error, out_of_range.
+#include <boost/checked_delete.hpp>
+#include <boost/config.hpp> // BOOST_MSVC, template friends,
+#include <boost/detail/workaround.hpp> // BOOST_NESTED_TEMPLATE
+#include <boost/iostreams/constants.hpp>
+#include <boost/iostreams/detail/access_control.hpp>
+#include <boost/iostreams/detail/char_traits.hpp>
+#include <boost/iostreams/detail/push.hpp>
+#include <boost/iostreams/detail/streambuf.hpp> // pubsync.
+#include <boost/iostreams/detail/wrap_unwrap.hpp>
+#include <boost/iostreams/device/null.hpp>
+#include <boost/iostreams/positioning.hpp>
+#include <boost/iostreams/traits.hpp> // is_filter.
+#include <boost/iostreams/stream_buffer.hpp>
+#include <boost/next_prior.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.hpp>
+#include <boost/iostreams/detail/execute.hpp> // VC6.5 requires this
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1310) // #include order
+# include <boost/mpl/int.hpp>
+#endif
+
+// Sometimes type_info objects must be compared by name. Borrowed from
+// Boost.Python and Boost.Function.
+#if (defined(__GNUC__) && __GNUC__ >= 3) || \
+ defined(_AIX) || \
+ (defined(__sgi) && defined(__host_mips)) || \
+ (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC)) \
+ /**/
+# include <cstring>
+# define BOOST_IOSTREAMS_COMPARE_TYPE_ID(X,Y) \
+ (std::strcmp((X).name(),(Y).name()) == 0)
+#else
+# define BOOST_IOSTREAMS_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
+#endif
+
+// Deprecated
+#define BOOST_IOSTREAMS_COMPONENT_TYPE(chain, index) \
+ chain.component_type( index ) \
+ /**/
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+# define BOOST_IOSTREAMS_COMPONENT(chain, index, target) \
+ chain.component< target >( index ) \
+ /**/
+#else
+# define BOOST_IOSTREAMS_COMPONENT(chain, index, target) \
+ chain.component( index, ::boost::type< target >() ) \
+ /**/
+#endif
+
+namespace boost { namespace iostreams {
+
+//--------------Definition of chain and wchain--------------------------------//
+
+namespace detail {
+
+template<typename Chain> class chain_client;
+
+//
+// Concept name: Chain.
+// Description: Represents a chain of stream buffers which provides access
+// to the first buffer in the chain and sends notifications when the
+// streambufs are added to or removed from chain.
+// Refines: Closable device with mode equal to typename Chain::mode.
+// Models: chain, converting_chain.
+// Example:
+//
+// class chain {
+// public:
+// typedef xxx chain_type;
+// typedef xxx client_type;
+// typedef xxx mode;
+// bool is_complete() const; // Ready for i/o.
+// template<typename T>
+// void push( const T& t, // Adds a stream buffer to
+// streamsize, // chain, based on t, with
+// streamsize ); // given buffer and putback
+// // buffer sizes. Pass -1 to
+// // request default size.
+// protected:
+// void register_client(client_type* client); // Associate client.
+// void notify(); // Notify client.
+// };
+//
+
+//
+// Description: Represents a chain of filters with an optional device at the
+// end.
+// Template parameters:
+// Self - A class deriving from the current instantiation of this template.
+// This is an example of the Curiously Recurring Template Pattern.
+// Ch - The character type.
+// Tr - The character traits type.
+// Alloc - The allocator type.
+// Mode - A mode tag.
+//
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+class chain_base {
+public:
+ typedef Ch char_type;
+ BOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(Tr)
+ typedef Alloc allocator_type;
+ typedef Mode mode;
+ struct category
+ : Mode,
+ device_tag
+ { };
+ typedef chain_client<Self> client_type;
+ friend class chain_client<Self>;
+private:
+ typedef linked_streambuf<Ch> streambuf_type;
+ typedef std::list<streambuf_type*> list_type;
+ typedef chain_base<Self, Ch, Tr, Alloc, Mode> my_type;
+protected:
+ chain_base() : pimpl_(new chain_impl) { }
+ chain_base(const chain_base& rhs): pimpl_(rhs.pimpl_) { }
+public:
+
+ // dual_use is a pseudo-mode to facilitate filter writing,
+ // not a genuine mode.
+ BOOST_STATIC_ASSERT((!is_convertible<mode, dual_use>::value));
+
+ //----------Buffer sizing-------------------------------------------------//
+
+ // Sets the size of the buffer created for the devices to be added to this
+ // chain. Does not affect the size of the buffer for devices already
+ // added.
+ void set_device_buffer_size(std::streamsize n)
+ { pimpl_->device_buffer_size_ = n; }
+
+ // Sets the size of the buffer created for the filters to be added
+ // to this chain. Does not affect the size of the buffer for filters already
+ // added.
+ void set_filter_buffer_size(std::streamsize n)
+ { pimpl_->filter_buffer_size_ = n; }
+
+ // Sets the size of the putback buffer for filters and devices to be added
+ // to this chain. Does not affect the size of the buffer for filters or
+ // devices already added.
+ void set_pback_size(std::streamsize n)
+ { pimpl_->pback_size_ = n; }
+
+ //----------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 off, BOOST_IOS::seekdir way);
+
+ //----------Direct component access---------------------------------------//
+
+ const std::type_info& component_type(int n) const
+ {
+ if (static_cast<size_type>(n) >= size())
+ boost::throw_exception(std::out_of_range("bad chain offset"));
+ return (*boost::next(list().begin(), n))->component_type();
+ }
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+ // Deprecated.
+ template<int N>
+ const std::type_info& component_type() const { return component_type(N); }
+
+ template<typename T>
+ T* component(int n) const { return component(n, boost::type<T>()); }
+
+ // Deprecated.
+ template<int N, typename T>
+ T* component() const { return component<T>(N); }
+#endif
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+ private:
+#endif
+ template<typename T>
+ T* component(int n, boost::type<T>) const
+ {
+ if (static_cast<size_type>(n) >= size())
+ boost::throw_exception(std::out_of_range("bad chain offset"));
+ streambuf_type* link = *boost::next(list().begin(), n);
+ if (BOOST_IOSTREAMS_COMPARE_TYPE_ID(link->component_type(), typeid(T)))
+ return static_cast<T*>(link->component_impl());
+ else
+ return 0;
+ }
+public:
+
+ //----------Container-like interface--------------------------------------//
+
+ typedef typename list_type::size_type size_type;
+ streambuf_type& front() { return *list().front(); }
+ BOOST_IOSTREAMS_DEFINE_PUSH(push, mode, char_type, push_impl)
+ void pop();
+ bool empty() const { return list().empty(); }
+ size_type size() const { return list().size(); }
+ void reset();
+
+ //----------Additional i/o functions--------------------------------------//
+
+ // Returns true if this chain is non-empty and its final link
+ // is a source or sink, i.e., if it is ready to perform i/o.
+ bool is_complete() const;
+ bool auto_close() const;
+ void set_auto_close(bool close);
+ bool sync() { return front().BOOST_IOSTREAMS_PUBSYNC() != -1; }
+ bool strict_sync();
+private:
+ template<typename T>
+ void push_impl(const T& t, std::streamsize buffer_size = -1,
+ std::streamsize pback_size = -1)
+ {
+ typedef typename iostreams::category_of<T>::type category;
+ typedef typename unwrap_ios<T>::type component_type;
+ typedef stream_buffer<
+ component_type,
+ BOOST_IOSTREAMS_CHAR_TRAITS(char_type),
+ Alloc, Mode
+ > streambuf_t;
+ typedef typename list_type::iterator iterator;
+ BOOST_STATIC_ASSERT((is_convertible<category, Mode>::value));
+ if (is_complete())
+ boost::throw_exception(std::logic_error("chain complete"));
+ streambuf_type* prev = !empty() ? list().back() : 0;
+ buffer_size =
+ buffer_size != -1 ?
+ buffer_size :
+ iostreams::optimal_buffer_size(t);
+ pback_size =
+ pback_size != -1 ?
+ pback_size :
+ pimpl_->pback_size_;
+ std::auto_ptr<streambuf_t>
+ buf(new streambuf_t(t, buffer_size, pback_size));
+ list().push_back(buf.get());
+ buf.release();
+ if (is_device<component_type>::value) {
+ pimpl_->flags_ |= f_complete | f_open;
+ for ( iterator first = list().begin(),
+ last = list().end();
+ first != last;
+ ++first )
+ {
+ (*first)->set_needs_close();
+ }
+ }
+ if (prev) prev->set_next(list().back());
+ notify();
+ }
+
+ list_type& list() { return pimpl_->links_; }
+ const list_type& list() const { return pimpl_->links_; }
+ void register_client(client_type* client) { pimpl_->client_ = client; }
+ void notify() { if (pimpl_->client_) pimpl_->client_->notify(); }
+
+ //----------Nested classes------------------------------------------------//
+
+ static void close(streambuf_type* b, BOOST_IOS::openmode m)
+ {
+ if (m == BOOST_IOS::out && is_convertible<Mode, output>::value)
+ b->BOOST_IOSTREAMS_PUBSYNC();
+ b->close(m);
+ }
+
+ static void set_next(streambuf_type* b, streambuf_type* next)
+ { b->set_next(next); }
+
+ static void set_auto_close(streambuf_type* b, bool close)
+ { b->set_auto_close(close); }
+
+ struct closer : public std::unary_function<streambuf_type*, void> {
+ closer(BOOST_IOS::openmode m) : mode_(m) { }
+ void operator() (streambuf_type* b)
+ {
+ close(b, mode_);
+ }
+ BOOST_IOS::openmode mode_;
+ };
+ friend struct closer;
+
+ enum flags {
+ f_complete = 1,
+ f_open = 2,
+ f_auto_close = 4
+ };
+
+ struct chain_impl {
+ chain_impl()
+ : client_(0), device_buffer_size_(default_device_buffer_size),
+ filter_buffer_size_(default_filter_buffer_size),
+ pback_size_(default_pback_buffer_size),
+ flags_(f_auto_close)
+ { }
+ ~chain_impl()
+ {
+ try { close(); } catch (...) { }
+ try { reset(); } catch (...) { }
+ }
+ void close()
+ {
+ if ((flags_ & f_open) != 0) {
+ flags_ &= ~f_open;
+ stream_buffer< basic_null_device<Ch, Mode> > null;
+ if ((flags_ & f_complete) == 0) {
+ null.open(basic_null_device<Ch, Mode>());
+ set_next(links_.back(), &null);
+ }
+ links_.front()->BOOST_IOSTREAMS_PUBSYNC();
+ try {
+ boost::iostreams::detail::execute_foreach(
+ links_.rbegin(), links_.rend(),
+ closer(BOOST_IOS::in)
+ );
+ } catch (...) {
+ try {
+ boost::iostreams::detail::execute_foreach(
+ links_.begin(), links_.end(),
+ closer(BOOST_IOS::out)
+ );
+ } catch (...) { }
+ throw;
+ }
+ boost::iostreams::detail::execute_foreach(
+ links_.begin(), links_.end(),
+ closer(BOOST_IOS::out)
+ );
+ }
+ }
+ void reset()
+ {
+ typedef typename list_type::iterator iterator;
+ for ( iterator first = links_.begin(),
+ last = links_.end();
+ first != last;
+ ++first )
+ {
+ if ( (flags_ & f_complete) == 0 ||
+ (flags_ & f_auto_close) == 0 )
+ {
+ set_auto_close(*first, false);
+ }
+ streambuf_type* buf = 0;
+ std::swap(buf, *first);
+ delete buf;
+ }
+ links_.clear();
+ flags_ &= ~f_complete;
+ flags_ &= ~f_open;
+ }
+ list_type links_;
+ client_type* client_;
+ std::streamsize device_buffer_size_,
+ filter_buffer_size_,
+ pback_size_;
+ int flags_;
+ };
+ friend struct chain_impl;
+
+ //----------Member data---------------------------------------------------//
+
+private:
+ shared_ptr<chain_impl> pimpl_;
+};
+
+} // End namespace detail.
+
+//
+// Macro: BOOST_IOSTREAMS_DECL_CHAIN(name, category)
+// Description: Defines a template derived from chain_base appropriate for a
+// particular i/o category. The template has the following parameters:
+// Ch - The character type.
+// Tr - The character traits type.
+// Alloc - The allocator type.
+// Macro parameters:
+// name_ - The name of the template to be defined.
+// category_ - The i/o category of the template to be defined.
+//
+#define BOOST_IOSTREAMS_DECL_CHAIN(name_, default_char_) \
+ template< typename Mode, typename Ch = default_char_, \
+ typename Tr = BOOST_IOSTREAMS_CHAR_TRAITS(Ch), \
+ typename Alloc = std::allocator<Ch> > \
+ class name_ : public boost::iostreams::detail::chain_base< \
+ name_<Mode, Ch, Tr, Alloc>, \
+ Ch, Tr, Alloc, Mode \
+ > \
+ { \
+ public: \
+ struct category : device_tag, Mode { }; \
+ typedef Mode mode; \
+ private: \
+ typedef boost::iostreams::detail::chain_base< \
+ name_<Mode, Ch, Tr, Alloc>, \
+ Ch, Tr, Alloc, Mode \
+ > base_type; \
+ public: \
+ typedef Ch char_type; \
+ typedef Tr traits_type; \
+ typedef typename traits_type::int_type int_type; \
+ typedef typename traits_type::off_type off_type; \
+ name_() { } \
+ name_(const name_& rhs) : base_type(rhs) { } \
+ name_& operator=(const name_& rhs) \
+ { base_type::operator=(rhs); return *this; } \
+ }; \
+ /**/
+BOOST_IOSTREAMS_DECL_CHAIN(chain, char)
+BOOST_IOSTREAMS_DECL_CHAIN(wchain, wchar_t)
+#undef BOOST_IOSTREAMS_DECL_CHAIN
+
+//--------------Definition of chain_client------------------------------------//
+
+namespace detail {
+
+//
+// Template name: chain_client
+// Description: Class whose instances provide access to an underlying chain
+// using an interface similar to the chains.
+// Subclasses: the various stream and stream buffer templates.
+//
+template<typename Chain>
+class chain_client {
+public:
+ typedef Chain chain_type;
+ typedef typename chain_type::char_type char_type;
+ typedef typename chain_type::traits_type traits_type;
+ typedef typename chain_type::size_type size_type;
+ typedef typename chain_type::mode mode;
+
+ chain_client(chain_type* chn = 0) : chain_(chn ) { }
+ chain_client(chain_client* client) : chain_(client->chain_) { }
+ virtual ~chain_client() { }
+
+ const std::type_info& component_type(int n) const
+ { return chain_->component_type(n); }
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+ // Deprecated.
+ template<int N>
+ const std::type_info& component_type() const
+ { return chain_->BOOST_NESTED_TEMPLATE component_type<N>(); }
+
+ template<typename T>
+ T* component(int n) const
+ { return chain_->BOOST_NESTED_TEMPLATE component<T>(n); }
+
+ // Deprecated.
+ template<int N, typename T>
+ T* component() const
+ { return chain_->BOOST_NESTED_TEMPLATE component<N, T>(); }
+#else
+ template<typename T>
+ T* component(int n, boost::type<T> t) const
+ { return chain_->component(n, t); }
+#endif
+
+ bool is_complete() const { return chain_->is_complete(); }
+ bool auto_close() const { return chain_->auto_close(); }
+ void set_auto_close(bool close) { chain_->set_auto_close(close); }
+ bool strict_sync() { return chain_->strict_sync(); }
+ void set_device_buffer_size(std::streamsize n)
+ { chain_->set_device_buffer_size(n); }
+ void set_filter_buffer_size(std::streamsize n)
+ { chain_->set_filter_buffer_size(n); }
+ void set_pback_size(std::streamsize n) { chain_->set_pback_size(n); }
+ BOOST_IOSTREAMS_DEFINE_PUSH(push, mode, char_type, push_impl)
+ void pop() { chain_->pop(); }
+ bool empty() const { return chain_->empty(); }
+ size_type size() { return chain_->size(); }
+ void reset() { chain_->reset(); }
+
+ // Returns a copy of the underlying chain.
+ chain_type filters() { return *chain_; }
+ chain_type filters() const { return *chain_; }
+protected:
+ template<typename T>
+ void push_impl(const T& t BOOST_IOSTREAMS_PUSH_PARAMS())
+ { chain_->push(t BOOST_IOSTREAMS_PUSH_ARGS()); }
+ chain_type& ref() { return *chain_; }
+ void set_chain(chain_type* c)
+ { chain_ = c; chain_->register_client(this); }
+#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) && \
+ (!BOOST_WORKAROUND(__BORLANDC__, < 0x600))
+ template<typename S, typename C, typename T, typename A, typename M>
+ friend class chain_base;
+#else
+ public:
+#endif
+ virtual void notify() { }
+private:
+ chain_type* chain_;
+};
+
+//--------------Implementation of chain_base----------------------------------//
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+inline std::streamsize chain_base<Self, Ch, Tr, Alloc, Mode>::read
+ (char_type* s, std::streamsize n)
+{ return iostreams::read(*list().front(), s, n); }
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+inline std::streamsize chain_base<Self, Ch, Tr, Alloc, Mode>::write
+ (const char_type* s, std::streamsize n)
+{ return iostreams::write(*list().front(), s, n); }
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+inline std::streampos chain_base<Self, Ch, Tr, Alloc, Mode>::seek
+ (stream_offset off, BOOST_IOS::seekdir way)
+{ return iostreams::seek(*list().front(), off, way); }
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+void chain_base<Self, Ch, Tr, Alloc, Mode>::reset()
+{
+ using namespace std;
+ pimpl_->close();
+ pimpl_->reset();
+}
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+bool chain_base<Self, Ch, Tr, Alloc, Mode>::is_complete() const
+{
+ return (pimpl_->flags_ & f_complete) != 0;
+}
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+bool chain_base<Self, Ch, Tr, Alloc, Mode>::auto_close() const
+{
+ return (pimpl_->flags_ & f_auto_close) != 0;
+}
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+void chain_base<Self, Ch, Tr, Alloc, Mode>::set_auto_close(bool close)
+{
+ pimpl_->flags_ =
+ (pimpl_->flags_ & ~f_auto_close) |
+ (close ? f_auto_close : 0);
+}
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+bool chain_base<Self, Ch, Tr, Alloc, Mode>::strict_sync()
+{
+ typedef typename list_type::iterator iterator;
+ bool result = true;
+ for ( iterator first = list().begin(),
+ last = list().end();
+ first != last;
+ ++first )
+ {
+ bool s = (*first)->strict_sync();
+ result = result && s;
+ }
+ return result;
+}
+
+template<typename Self, typename Ch, typename Tr, typename Alloc, typename Mode>
+void chain_base<Self, Ch, Tr, Alloc, Mode>::pop()
+{
+ BOOST_ASSERT(!empty());
+ if (auto_close())
+ pimpl_->close();
+ streambuf_type* buf = 0;
+ std::swap(buf, list().back());
+ buf->set_auto_close(false);
+ buf->set_next(0);
+ delete buf;
+ list().pop_back();
+ pimpl_->flags_ &= ~f_complete;
+ if (auto_close() || list().empty())
+ pimpl_->flags_ &= ~f_open;
+}
+
+} // End namespace detail.
+
+} } // End namespaces iostreams, boost.
+
+#endif // #ifndef BOOST_IOSTREAMS_DETAIL_CHAIN_HPP_INCLUDED
Added: pkg/BH/inst/include/boost/iostreams/char_traits.hpp
===================================================================
--- pkg/BH/inst/include/boost/iostreams/char_traits.hpp (rev 0)
+++ pkg/BH/inst/include/boost/iostreams/char_traits.hpp 2013-05-04 01:45:38 UTC (rev 41)
@@ -0,0 +1,73 @@
+// (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_CHAR_TRAITS_HPP_INCLUDED
+#define BOOST_IOSTREAMS_CHAR_TRAITS_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+#include <cstddef>
+#include <cstdio> // EOF.
+#include <string> // std::char_traits.
+#include <boost/iostreams/detail/char_traits.hpp>
+#include <boost/iostreams/detail/config/wide_streams.hpp>
+#ifndef BOOST_IOSTREAMS_NO_WIDE_STREAMS
+# include <cwchar>
+#endif
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::wint_t; }
+#endif
+
+namespace boost { namespace iostreams {
+
+// Dinkumware that comes with QNX Momentics 6.3.0, 4.0.2, incorrectly defines
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/boostheaders -r 41
More information about the Boostheaders-commits
mailing list