[Boostheaders-commits] r33 - in pkg/BH/inst/include/boost: format fusion math/constants math/distributions math/tools/detail tr1
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat May 4 02:56:40 CEST 2013
Author: edd
Date: 2013-05-04 02:56:39 +0200 (Sat, 04 May 2013)
New Revision: 33
Added:
pkg/BH/inst/include/boost/format/alt_sstream.hpp
pkg/BH/inst/include/boost/format/alt_sstream_impl.hpp
pkg/BH/inst/include/boost/format/detail/
pkg/BH/inst/include/boost/format/exceptions.hpp
pkg/BH/inst/include/boost/format/feed_args.hpp
pkg/BH/inst/include/boost/format/format_class.hpp
pkg/BH/inst/include/boost/format/format_fwd.hpp
pkg/BH/inst/include/boost/format/format_implementation.hpp
pkg/BH/inst/include/boost/format/free_funcs.hpp
pkg/BH/inst/include/boost/format/group.hpp
pkg/BH/inst/include/boost/format/internals.hpp
pkg/BH/inst/include/boost/format/internals_fwd.hpp
pkg/BH/inst/include/boost/format/parsing.hpp
pkg/BH/inst/include/boost/fusion/adapted/
pkg/BH/inst/include/boost/fusion/algorithm/
pkg/BH/inst/include/boost/fusion/container/
pkg/BH/inst/include/boost/fusion/include/
pkg/BH/inst/include/boost/fusion/iterator/
pkg/BH/inst/include/boost/fusion/mpl/
pkg/BH/inst/include/boost/fusion/sequence/
pkg/BH/inst/include/boost/fusion/support/
pkg/BH/inst/include/boost/fusion/tuple.hpp
pkg/BH/inst/include/boost/fusion/tuple/
pkg/BH/inst/include/boost/fusion/view/
pkg/BH/inst/include/boost/math/constants/calculate_constants.hpp
pkg/BH/inst/include/boost/math/constants/constants.hpp
pkg/BH/inst/include/boost/math/distributions/bernoulli.hpp
pkg/BH/inst/include/boost/math/distributions/beta.hpp
pkg/BH/inst/include/boost/math/distributions/binomial.hpp
pkg/BH/inst/include/boost/math/distributions/cauchy.hpp
pkg/BH/inst/include/boost/math/distributions/chi_squared.hpp
pkg/BH/inst/include/boost/math/distributions/complement.hpp
pkg/BH/inst/include/boost/math/distributions/detail/
pkg/BH/inst/include/boost/math/distributions/exponential.hpp
pkg/BH/inst/include/boost/math/distributions/extreme_value.hpp
pkg/BH/inst/include/boost/math/distributions/find_location.hpp
pkg/BH/inst/include/boost/math/distributions/find_scale.hpp
pkg/BH/inst/include/boost/math/distributions/fisher_f.hpp
pkg/BH/inst/include/boost/math/distributions/fwd.hpp
pkg/BH/inst/include/boost/math/distributions/gamma.hpp
pkg/BH/inst/include/boost/math/distributions/geometric.hpp
pkg/BH/inst/include/boost/math/distributions/hypergeometric.hpp
pkg/BH/inst/include/boost/math/distributions/inverse_chi_squared.hpp
pkg/BH/inst/include/boost/math/distributions/inverse_gamma.hpp
pkg/BH/inst/include/boost/math/distributions/inverse_gaussian.hpp
pkg/BH/inst/include/boost/math/distributions/laplace.hpp
pkg/BH/inst/include/boost/math/distributions/logistic.hpp
pkg/BH/inst/include/boost/math/distributions/lognormal.hpp
pkg/BH/inst/include/boost/math/distributions/negative_binomial.hpp
pkg/BH/inst/include/boost/math/distributions/non_central_beta.hpp
pkg/BH/inst/include/boost/math/distributions/non_central_chi_squared.hpp
pkg/BH/inst/include/boost/math/distributions/non_central_f.hpp
pkg/BH/inst/include/boost/math/distributions/non_central_t.hpp
pkg/BH/inst/include/boost/math/distributions/normal.hpp
pkg/BH/inst/include/boost/math/distributions/pareto.hpp
pkg/BH/inst/include/boost/math/distributions/poisson.hpp
pkg/BH/inst/include/boost/math/distributions/rayleigh.hpp
pkg/BH/inst/include/boost/math/distributions/skew_normal.hpp
pkg/BH/inst/include/boost/math/distributions/students_t.hpp
pkg/BH/inst/include/boost/math/distributions/triangular.hpp
pkg/BH/inst/include/boost/math/distributions/uniform.hpp
pkg/BH/inst/include/boost/math/distributions/weibull.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_10.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_11.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_12.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_13.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_14.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_15.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_16.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_17.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_18.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_19.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_2.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_20.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_3.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_4.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_5.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_6.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_7.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_8.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner1_9.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_10.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_11.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_12.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_13.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_14.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_15.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_16.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_17.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_18.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_19.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_2.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_20.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_3.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_4.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_5.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_6.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_7.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_8.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner2_9.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_10.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_11.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_12.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_13.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_14.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_15.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_16.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_17.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_18.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_19.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_2.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_20.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_3.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_4.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_5.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_6.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_7.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_8.hpp
pkg/BH/inst/include/boost/math/tools/detail/polynomial_horner3_9.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_10.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_11.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_12.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_13.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_14.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_15.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_16.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_17.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_18.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_19.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_2.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_20.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_3.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_4.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_5.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_6.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_7.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_8.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner1_9.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_10.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_11.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_12.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_13.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_14.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_15.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_16.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_17.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_18.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_19.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_2.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_20.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_3.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_4.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_5.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_6.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_7.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_8.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner2_9.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_10.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_11.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_12.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_13.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_14.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_15.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_16.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_17.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_18.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_19.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_2.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_20.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_3.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_4.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_5.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_6.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_7.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_8.hpp
pkg/BH/inst/include/boost/math/tools/detail/rational_horner3_9.hpp
pkg/BH/inst/include/boost/tr1/detail/
pkg/BH/inst/include/boost/tr1/tuple.hpp
Log:
steps towards BH 1.51.0-1 with foreach and math distributions
Added: pkg/BH/inst/include/boost/format/alt_sstream.hpp
===================================================================
--- pkg/BH/inst/include/boost/format/alt_sstream.hpp (rev 0)
+++ pkg/BH/inst/include/boost/format/alt_sstream.hpp 2013-05-04 00:56:39 UTC (rev 33)
@@ -0,0 +1,176 @@
+// ----------------------------------------------------------------------------
+// alt_sstream.hpp : alternative stringstream
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 2003. Use, modification, and distribution are
+// 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)
+
+// See http://www.boost.org/libs/format for library home page
+
+// ----------------------------------------------------------------------------
+
+
+
+#ifndef BOOST_SK_ALT_SSTREAM_HPP
+#define BOOST_SK_ALT_SSTREAM_HPP
+
+#include <string>
+#include <boost/format/detail/compat_workarounds.hpp>
+#include <boost/utility/base_from_member.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/assert.hpp>
+
+namespace boost {
+ namespace io {
+
+ template<class Ch, class Tr=::std::char_traits<Ch>,
+ class Alloc=::std::allocator<Ch> >
+ class basic_altstringbuf;
+
+ template<class Ch, class Tr =::std::char_traits<Ch>,
+ class Alloc=::std::allocator<Ch> >
+ class basic_oaltstringstream;
+
+
+ template<class Ch, class Tr, class Alloc>
+ class basic_altstringbuf
+ : public ::std::basic_streambuf<Ch, Tr>
+ {
+ typedef ::std::basic_streambuf<Ch, Tr> streambuf_t;
+ typedef typename CompatAlloc<Alloc>::compatible_type compat_allocator_type;
+ typedef typename CompatTraits<Tr>::compatible_type compat_traits_type;
+ public:
+ typedef Ch char_type;
+ typedef Tr traits_type;
+ typedef typename compat_traits_type::int_type int_type;
+ typedef typename compat_traits_type::pos_type pos_type;
+ typedef typename compat_traits_type::off_type off_type;
+ typedef Alloc allocator_type;
+ typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
+ typedef typename string_type::size_type size_type;
+
+ typedef ::std::streamsize streamsize;
+
+
+ explicit basic_altstringbuf(std::ios_base::openmode mode
+ = std::ios_base::in | std::ios_base::out)
+ : putend_(NULL), is_allocated_(false), mode_(mode)
+ {}
+ explicit basic_altstringbuf(const string_type& s,
+ ::std::ios_base::openmode mode
+ = ::std::ios_base::in | ::std::ios_base::out)
+ : putend_(NULL), is_allocated_(false), mode_(mode)
+ { dealloc(); str(s); }
+ virtual ~basic_altstringbuf()
+ { dealloc(); }
+ using streambuf_t::pbase;
+ using streambuf_t::pptr;
+ using streambuf_t::epptr;
+ using streambuf_t::eback;
+ using streambuf_t::gptr;
+ using streambuf_t::egptr;
+
+ void clear_buffer();
+ void str(const string_type& s);
+
+ // 0-copy access :
+ Ch * begin() const;
+ size_type size() const;
+ size_type cur_size() const; // stop at current pointer
+ Ch * pend() const // the highest position reached by pptr() since creation
+ { return ((putend_ < pptr()) ? pptr() : putend_); }
+ size_type pcount() const
+ { return static_cast<size_type>( pptr() - pbase()) ;}
+
+ // copy buffer to string :
+ string_type str() const
+ { return string_type(begin(), size()); }
+ string_type cur_str() const
+ { return string_type(begin(), cur_size()); }
+ protected:
+ explicit basic_altstringbuf (basic_altstringbuf * s,
+ ::std::ios_base::openmode mode
+ = ::std::ios_base::in | ::std::ios_base::out)
+ : putend_(NULL), is_allocated_(false), mode_(mode)
+ { dealloc(); str(s); }
+
+ virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way,
+ ::std::ios_base::openmode which
+ = ::std::ios_base::in | ::std::ios_base::out);
+ virtual pos_type seekpos (pos_type pos,
+ ::std::ios_base::openmode which
+ = ::std::ios_base::in | ::std::ios_base::out);
+ virtual int_type underflow();
+ virtual int_type pbackfail(int_type meta = compat_traits_type::eof());
+ virtual int_type overflow(int_type meta = compat_traits_type::eof());
+ void dealloc();
+ private:
+ enum { alloc_min = 256}; // minimum size of allocations
+
+ Ch *putend_; // remembers (over seeks) the highest value of pptr()
+ bool is_allocated_;
+ ::std::ios_base::openmode mode_;
+ compat_allocator_type alloc_; // the allocator object
+ };
+
+
+// --- class basic_oaltstringstream ----------------------------------------
+ template <class Ch, class Tr, class Alloc>
+ class basic_oaltstringstream
+ : private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >,
+ public ::std::basic_ostream<Ch, Tr>
+ {
+ class No_Op {
+ // used as no-op deleter for (not-owner) shared_pointers
+ public:
+ template<class T>
+ const T & operator()(const T & arg) { return arg; }
+ };
+ typedef ::std::basic_ostream<Ch, Tr> stream_t;
+ typedef boost::base_from_member<boost::shared_ptr<
+ basic_altstringbuf<Ch,Tr, Alloc> > >
+ pbase_type;
+ typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
+ typedef typename string_type::size_type size_type;
+ typedef basic_altstringbuf<Ch, Tr, Alloc> stringbuf_t;
+ public:
+ typedef Alloc allocator_type;
+ basic_oaltstringstream()
+ : pbase_type(new stringbuf_t), stream_t(rdbuf())
+ { }
+ basic_oaltstringstream(::boost::shared_ptr<stringbuf_t> buf)
+ : pbase_type(buf), stream_t(rdbuf())
+ { }
+ basic_oaltstringstream(stringbuf_t * buf)
+ : pbase_type(buf, No_Op() ), stream_t(rdbuf())
+ { }
+ stringbuf_t * rdbuf() const
+ { return pbase_type::member.get(); }
+ void clear_buffer()
+ { rdbuf()->clear_buffer(); }
+
+ // 0-copy access :
+ Ch * begin() const
+ { return rdbuf()->begin(); }
+ size_type size() const
+ { return rdbuf()->size(); }
+ size_type cur_size() const // stops at current position
+ { return rdbuf()->cur_size(); }
+
+ // copy buffer to string :
+ string_type str() const // [pbase, epptr[
+ { return rdbuf()->str(); }
+ string_type cur_str() const // [pbase, pptr[
+ { return rdbuf()->cur_str(); }
+ void str(const string_type& s)
+ { rdbuf()->str(s); }
+ };
+
+ } // N.S. io
+} // N.S. boost
+
+#include <boost/format/alt_sstream_impl.hpp>
+
+#endif // include guard
+
Added: pkg/BH/inst/include/boost/format/alt_sstream_impl.hpp
===================================================================
--- pkg/BH/inst/include/boost/format/alt_sstream_impl.hpp (rev 0)
+++ pkg/BH/inst/include/boost/format/alt_sstream_impl.hpp 2013-05-04 00:56:39 UTC (rev 33)
@@ -0,0 +1,313 @@
+// ----------------------------------------------------------------------------
+// alt_sstream_impl.hpp : alternative stringstream, templates implementation
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 2003. Use, modification, and distribution are
+// 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)
+
+// See http://www.boost.org/libs/format for library home page
+
+// ----------------------------------------------------------------------------
+
+#ifndef BOOST_SK_ALT_SSTREAM_IMPL_HPP
+#define BOOST_SK_ALT_SSTREAM_IMPL_HPP
+
+namespace boost {
+ namespace io {
+// --- Implementation ------------------------------------------------------//
+
+ template<class Ch, class Tr, class Alloc>
+ void basic_altstringbuf<Ch, Tr, Alloc>::
+ clear_buffer () {
+ const Ch * p = pptr();
+ const Ch * b = pbase();
+ if(p != NULL && p != b) {
+ seekpos(0, ::std::ios_base::out);
+ }
+ p = gptr();
+ b = eback();
+ if(p != NULL && p != b) {
+ seekpos(0, ::std::ios_base::in);
+ }
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ void basic_altstringbuf<Ch, Tr, Alloc>::
+ str (const string_type& s) {
+ size_type sz=s.size();
+ if(sz != 0 && mode_ & (::std::ios_base::in | ::std::ios_base::out) ) {
+#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
+ void *vd_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
+ Ch *new_ptr = static_cast<Ch *>(vd_ptr);
+#else
+ Ch *new_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
+#endif
+ // if this didnt throw, we're safe, update the buffer
+ dealloc();
+ sz = s.copy(new_ptr, sz);
+ putend_ = new_ptr + sz;
+ if(mode_ & ::std::ios_base::in)
+ streambuf_t::setg(new_ptr, new_ptr, new_ptr + sz);
+ if(mode_ & ::std::ios_base::out) {
+ streambuf_t::setp(new_ptr, new_ptr + sz);
+ if(mode_ & (::std::ios_base::app | ::std::ios_base::ate))
+ streambuf_t::pbump(static_cast<int>(sz));
+ if(gptr() == NULL)
+ streambuf_t::setg(new_ptr, NULL, new_ptr);
+ }
+ is_allocated_ = true;
+ }
+ else
+ dealloc();
+ }
+ template<class Ch, class Tr, class Alloc>
+ Ch* basic_altstringbuf<Ch, Tr, Alloc>::
+ begin () const {
+ if(mode_ & ::std::ios_base::out && pptr() != NULL)
+ return pbase();
+ else if(mode_ & ::std::ios_base::in && gptr() != NULL)
+ return eback();
+ return NULL;
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ typename std::basic_string<Ch,Tr,Alloc>::size_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ size () const {
+ if(mode_ & ::std::ios_base::out && pptr())
+ return static_cast<size_type>(pend() - pbase());
+ else if(mode_ & ::std::ios_base::in && gptr())
+ return static_cast<size_type>(egptr() - eback());
+ else
+ return 0;
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ typename std::basic_string<Ch,Tr,Alloc>::size_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ cur_size () const {
+ if(mode_ & ::std::ios_base::out && pptr())
+ return static_cast<streamsize>( pptr() - pbase());
+ else if(mode_ & ::std::ios_base::in && gptr())
+ return static_cast<streamsize>( gptr() - eback());
+ else
+ return 0;
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ seekoff (off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) {
+ if(pptr() != NULL && putend_ < pptr())
+ putend_ = pptr();
+ if(which & ::std::ios_base::in && gptr() != NULL) {
+ // get area
+ if(way == ::std::ios_base::end)
+ off += static_cast<off_type>(putend_ - gptr());
+ else if(way == ::std::ios_base::beg)
+ off += static_cast<off_type>(eback() - gptr());
+ else if(way != ::std::ios_base::cur || (which & ::std::ios_base::out) )
+ // (altering in&out is only supported if way is beg or end, not cur)
+ return pos_type(off_type(-1));
+ if(eback() <= off+gptr() && off+gptr() <= putend_ ) {
+ // set gptr
+ streambuf_t::gbump(static_cast<int>(off));
+ if(which & ::std::ios_base::out && pptr() != NULL)
+ // update pptr to match gptr
+ streambuf_t::pbump(static_cast<int>(gptr()-pptr()));
+ }
+ else
+ off = off_type(-1);
+ }
+ else if(which & ::std::ios_base::out && pptr() != NULL) {
+ // put area
+ if(way == ::std::ios_base::end)
+ off += static_cast<off_type>(putend_ - pptr());
+ else if(way == ::std::ios_base::beg)
+ off += static_cast<off_type>(pbase() - pptr());
+ else if(way != ::std::ios_base::beg)
+ return pos_type(off_type(-1));
+ if(pbase() <= off+pptr() && off+pptr() <= putend_)
+ // set pptr
+ streambuf_t::pbump(static_cast<int>(off));
+ else
+ off = off_type(-1);
+ }
+ else // neither in nor out
+ off = off_type(-1);
+ return (pos_type(off));
+ }
+ //- end seekoff(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ seekpos (pos_type pos, ::std::ios_base::openmode which) {
+ off_type off = off_type(pos); // operation guaranteed by 27.4.3.2 table 88
+ if(pptr() != NULL && putend_ < pptr())
+ putend_ = pptr();
+ if(off != off_type(-1)) {
+ if(which & ::std::ios_base::in && gptr() != NULL) {
+ // get area
+ if(0 <= off && off <= putend_ - eback()) {
+ streambuf_t::gbump(static_cast<int>(eback() - gptr() + off));
+ if(which & ::std::ios_base::out && pptr() != NULL) {
+ // update pptr to match gptr
+ streambuf_t::pbump(static_cast<int>(gptr()-pptr()));
+ }
+ }
+ else
+ off = off_type(-1);
+ }
+ else if(which & ::std::ios_base::out && pptr() != NULL) {
+ // put area
+ if(0 <= off && off <= putend_ - eback())
+ streambuf_t::pbump(static_cast<int>(eback() - pptr() + off));
+ else
+ off = off_type(-1);
+ }
+ else // neither in nor out
+ off = off_type(-1);
+ return (pos_type(off));
+ }
+ else {
+ BOOST_ASSERT(0); // §27.4.3.2 allows undefined-behaviour here
+ return pos_type(off_type(-1));
+ }
+ }
+ // -end seekpos(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ underflow () {
+ if(gptr() == NULL) // no get area -> nothing to get.
+ return (compat_traits_type::eof());
+ else if(gptr() < egptr()) // ok, in buffer
+ return (compat_traits_type::to_int_type(*gptr()));
+ else if(mode_ & ::std::ios_base::in && pptr() != NULL
+ && (gptr() < pptr() || gptr() < putend_) )
+ { // expand get area
+ if(putend_ < pptr())
+ putend_ = pptr(); // remember pptr reached this far
+ streambuf_t::setg(eback(), gptr(), putend_);
+ return (compat_traits_type::to_int_type(*gptr()));
+ }
+ else // couldnt get anything. EOF.
+ return (compat_traits_type::eof());
+ }
+ // -end underflow(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ pbackfail (int_type meta) {
+ if(gptr() != NULL && (eback() < gptr())
+ && (mode_ & (::std::ios_base::out)
+ || compat_traits_type::eq_int_type(compat_traits_type::eof(), meta)
+ || compat_traits_type::eq(compat_traits_type::to_char_type(meta), gptr()[-1]) ) ) {
+ streambuf_t::gbump(-1); // back one character
+ if(!compat_traits_type::eq_int_type(compat_traits_type::eof(), meta))
+ // put-back meta into get area
+ *gptr() = compat_traits_type::to_char_type(meta);
+ return (compat_traits_type::not_eof(meta));
+ }
+ else
+ return (compat_traits_type::eof()); // failed putback
+ }
+ // -end pbackfail(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ overflow (int_type meta) {
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
+ if(compat_traits_type::eq_int_type(compat_traits_type::eof(), meta))
+ return compat_traits_type::not_eof(meta); // nothing to do
+ else if(pptr() != NULL && pptr() < epptr()) {
+ streambuf_t::sputc(compat_traits_type::to_char_type(meta));
+ return meta;
+ }
+ else if(! (mode_ & ::std::ios_base::out))
+ // no write position, and cant make one
+ return compat_traits_type::eof();
+ else { // make a write position available
+ std::size_t prev_size = pptr() == NULL ? 0 : epptr() - eback();
+ std::size_t new_size = prev_size;
+ // exponential growth : size *= 1.5
+ std::size_t add_size = new_size / 2;
+ if(add_size < alloc_min)
+ add_size = alloc_min;
+ Ch * newptr = NULL, *oldptr = eback();
+
+ // make sure adding add_size wont overflow size_t
+ while (0 < add_size && ((std::numeric_limits<std::size_t>::max)()
+ - add_size < new_size) )
+ add_size /= 2;
+ if(0 < add_size) {
+ new_size += add_size;
+#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
+ void *vdptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
+ newptr = static_cast<Ch *>(vdptr);
+#else
+ newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
+#endif
+ }
+
+ if(0 < prev_size)
+ compat_traits_type::copy(newptr, oldptr, prev_size);
+ if(is_allocated_)
+ alloc_.deallocate(oldptr, prev_size);
+ is_allocated_=true;
+
+ if(prev_size == 0) { // first allocation
+ putend_ = newptr;
+ streambuf_t::setp(newptr, newptr + new_size);
+ if(mode_ & ::std::ios_base::in)
+ streambuf_t::setg(newptr, newptr, newptr + 1);
+ else
+ streambuf_t::setg(newptr, 0, newptr);
+ }
+ else { // update pointers
+ putend_ = putend_ - oldptr + newptr;
+ int pptr_count = static_cast<int>(pptr()-pbase());
+ int gptr_count = static_cast<int>(gptr()-eback());
+ streambuf_t::setp(pbase() - oldptr + newptr, newptr + new_size);
+ streambuf_t::pbump(pptr_count);
+ if(mode_ & ::std::ios_base::in)
+ streambuf_t::setg(newptr, newptr + gptr_count, pptr() + 1);
+ else
+ streambuf_t::setg(newptr, 0, newptr);
+ }
+ streambuf_t::sputc(compat_traits_type::to_char_type(meta));
+ return meta;
+ }
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+ }
+ // -end overflow(..)
+
+ template<class Ch, class Tr, class Alloc>
+ void basic_altstringbuf<Ch, Tr, Alloc>:: dealloc() {
+ if(is_allocated_)
+ alloc_.deallocate(eback(), (pptr() != NULL ? epptr() : egptr()) - eback());
+ is_allocated_ = false;
+ streambuf_t::setg(0, 0, 0);
+ streambuf_t::setp(0, 0);
+ putend_ = NULL;
+ }
+
+ }// N.S. io
+} // N.S. boost
+
+#endif // include guard
+
Added: pkg/BH/inst/include/boost/format/exceptions.hpp
===================================================================
--- pkg/BH/inst/include/boost/format/exceptions.hpp (rev 0)
+++ pkg/BH/inst/include/boost/format/exceptions.hpp 2013-05-04 00:56:39 UTC (rev 33)
@@ -0,0 +1,103 @@
+// ----------------------------------------------------------------------------
+// boost/format/exceptions.hpp
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 2003.
+//
+// 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/format/ for library home page
+
+// ----------------------------------------------------------------------------
+
+#ifndef BOOST_FORMAT_EXCEPTIONS_HPP
+#define BOOST_FORMAT_EXCEPTIONS_HPP
+
+
+#include <stdexcept>
+
+
+namespace boost {
+
+ namespace io {
+
+// **** exceptions -----------------------------------------------
+
+ class format_error : public std::exception
+ {
+ public:
+ format_error() {}
+ virtual const char *what() const throw() {
+ return "boost::format_error: "
+ "format generic failure";
+ }
+ };
+
+ class bad_format_string : public format_error
+ {
+ std::size_t pos_, next_;
+ public:
+ bad_format_string(std::size_t pos, std::size_t size)
+ : pos_(pos), next_(size) {}
+ std::size_t get_pos() const { return pos_; }
+ std::size_t get_next() const { return next_; }
+ virtual const char *what() const throw() {
+ return "boost::bad_format_string: format-string is ill-formed";
+ }
+ };
+
+ class too_few_args : public format_error
+ {
+ std::size_t cur_, expected_;
+ public:
+ too_few_args(std::size_t cur, std::size_t expected)
+ : cur_(cur), expected_(expected) {}
+ std::size_t get_cur() const { return cur_; }
+ std::size_t get_expected() const { return expected_; }
+ virtual const char *what() const throw() {
+ return "boost::too_few_args: "
+ "format-string referred to more arguments than were passed";
+ }
+ };
+
+ class too_many_args : public format_error
+ {
+ std::size_t cur_, expected_;
+ public:
+ too_many_args(std::size_t cur, std::size_t expected)
+ : cur_(cur), expected_(expected) {}
+ std::size_t get_cur() const { return cur_; }
+ std::size_t get_expected() const { return expected_; }
+ virtual const char *what() const throw() {
+ return "boost::too_many_args: "
+ "format-string referred to less arguments than were passed";
+ }
+ };
+
+
+ class out_of_range : public format_error
+ {
+ int index_, beg_, end_; // range is [ beg, end [
+ public:
+ out_of_range(int index, int beg, int end)
+ : index_(index), beg_(beg), end_(end) {}
+ int get_index() const { return index_; }
+ int get_beg() const { return beg_; }
+ int get_end() const { return end_; }
+ virtual const char *what() const throw() {
+ return "boost::out_of_range: "
+ "tried to refer to an argument (or item) number which"
+ " is out of range, according to the format string";
+ }
+ };
+
+
+ } // namespace io
+
+} // namespace boost
+
+
+#endif // BOOST_FORMAT_EXCEPTIONS_HPP
Added: pkg/BH/inst/include/boost/format/feed_args.hpp
===================================================================
--- pkg/BH/inst/include/boost/format/feed_args.hpp (rev 0)
+++ pkg/BH/inst/include/boost/format/feed_args.hpp 2013-05-04 00:56:39 UTC (rev 33)
@@ -0,0 +1,277 @@
+// ----------------------------------------------------------------------------
+// feed_args.hpp : functions for processing each argument
+// (feed, feed_manip, and distribute)
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 2003. Use, modification, and distribution are
+// 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)
+
+// See http://www.boost.org/libs/format for library home page
+
+// ----------------------------------------------------------------------------
+
+#ifndef BOOST_FORMAT_FEED_ARGS_HPP
+#define BOOST_FORMAT_FEED_ARGS_HPP
+
+#include <boost/config.hpp>
+#include <boost/assert.hpp>
+#include <boost/throw_exception.hpp>
+
+#include <boost/format/format_class.hpp>
+#include <boost/format/group.hpp>
+#include <boost/format/detail/msvc_disambiguater.hpp>
+
+namespace boost {
+namespace io {
+namespace detail {
+
+ template<class Ch, class Tr, class Alloc>
+ void mk_str( std::basic_string<Ch,Tr, Alloc> & res,
+ const Ch * beg,
+ typename std::basic_string<Ch,Tr,Alloc>::size_type size,
+ std::streamsize w,
+ const Ch fill_char,
+ std::ios_base::fmtflags f,
+ const Ch prefix_space, // 0 if no space-padding
+ bool center)
+ // applies centered/left/right padding to the string [beg, beg+size[
+ // Effects : the result is placed in res.
+ {
+ typedef typename std::basic_string<Ch,Tr,Alloc>::size_type size_type;
+ res.resize(0);
+ if(w<=0 || static_cast<size_type>(w) <=size) {
+ // no need to pad.
+ res.reserve(size + !!prefix_space);
+ if(prefix_space)
+ res.append(1, prefix_space);
+ if (size)
+ res.append(beg, size);
+ }
+ else {
+ std::streamsize n=static_cast<std::streamsize>(w-size-!!prefix_space);
+ std::streamsize n_after = 0, n_before = 0;
+ res.reserve(static_cast<size_type>(w)); // allocate once for the 2 inserts
+ if(center)
+ n_after = n/2, n_before = n - n_after;
+ else
+ if(f & std::ios_base::left)
+ n_after = n;
+ else
+ n_before = n;
+ // now make the res string :
+ if(n_before) res.append(static_cast<size_type>(n_before), fill_char);
+ if(prefix_space)
+ res.append(1, prefix_space);
+ if (size)
+ res.append(beg, size);
+ if(n_after) res.append(static_cast<size_type>(n_after), fill_char);
+ }
+ } // -mk_str(..)
+
+
+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) || \
+ BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
+// MSVC needs to be tricked to disambiguate this simple overload..
+// the trick is in "boost/format/msvc_disambiguater.hpp"
+
+ template< class Ch, class Tr, class T> inline
+ void put_head (BOOST_IO_STD basic_ostream<Ch, Tr> & os, const T& x ) {
+ disambiguater<Ch, Tr, T>::put_head(os, x, 1L);
+ }
+ template< class Ch, class Tr, class T> inline
+ void put_last (BOOST_IO_STD basic_ostream<Ch, Tr> & os, const T& x ) {
+ disambiguater<Ch, Tr, T>::put_last(os, x, 1L);
+ }
+
+#else
+
+ template< class Ch, class Tr, class T> inline
+ void put_head (BOOST_IO_STD basic_ostream<Ch, Tr> &, const T& ) {
+ }
+
+ template< class Ch, class Tr, class T> inline
+ void put_head( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const group1<T>& x ) {
+ os << group_head(x.a1_); // send the first N-1 items, not the last
+ }
+
+ template< class Ch, class Tr, class T> inline
+ void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const T& x ) {
+ os << x ;
+ }
+
+ template< class Ch, class Tr, class T> inline
+ void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const group1<T>& x ) {
+ os << group_last(x.a1_); // this selects the last element
+ }
+
+#ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
+ template< class Ch, class Tr, class T> inline
+ void put_head( BOOST_IO_STD basic_ostream<Ch, Tr> &, T& ) {
+ }
+
+ template< class Ch, class Tr, class T> inline
+ void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, T& x) {
+ os << x ;
+ }
+#endif
+#endif // -msvc workaround
+
+
+ template< class Ch, class Tr, class Alloc, class T>
+ void put( T x,
+ const format_item<Ch, Tr, Alloc>& specs,
+ typename basic_format<Ch, Tr, Alloc>::string_type& res,
+ typename basic_format<Ch, Tr, Alloc>::internal_streambuf_t & buf,
+ io::detail::locale_t *loc_p = NULL)
+ {
+#ifdef BOOST_MSVC
+ // If std::min<unsigned> or std::max<unsigned> are already instantiated
+ // at this point then we get a blizzard of warning messages when we call
+ // those templates with std::size_t as arguments. Weird and very annoyning...
+#pragma warning(push)
+#pragma warning(disable:4267)
+#endif
+ // does the actual conversion of x, with given params, into a string
+ // using the supplied stringbuf.
+
+ typedef typename basic_format<Ch, Tr, Alloc>::string_type string_type;
+ typedef typename basic_format<Ch, Tr, Alloc>::format_item_t format_item_t;
+ typedef typename string_type::size_type size_type;
+
+ basic_oaltstringstream<Ch, Tr, Alloc> oss( &buf);
+ specs.fmtstate_.apply_on(oss, loc_p);
+
+ // the stream format state can be modified by manipulators in the argument :
+ put_head( oss, x );
+ // in case x is a group, apply the manip part of it,
+ // in order to find width
+
+ const std::ios_base::fmtflags fl=oss.flags();
+ const bool internal = (fl & std::ios_base::internal) != 0;
+ const std::streamsize w = oss.width();
+ const bool two_stepped_padding= internal && (w!=0);
+
+ res.resize(0);
+ if(! two_stepped_padding) {
+ if(w>0) // handle padding via mk_str, not natively in stream
+ oss.width(0);
+ put_last( oss, x);
+ const Ch * res_beg = buf.pbase();
+ Ch prefix_space = 0;
+ if(specs.pad_scheme_ & format_item_t::spacepad)
+ if(buf.pcount()== 0 ||
+ (res_beg[0] !=oss.widen('+') && res_beg[0] !=oss.widen('-') ))
+ prefix_space = oss.widen(' ');
+ size_type res_size = (std::min)(
+ static_cast<size_type>(specs.truncate_ - !!prefix_space),
+ buf.pcount() );
+ mk_str(res, res_beg, res_size, w, oss.fill(), fl,
+ prefix_space, (specs.pad_scheme_ & format_item_t::centered) !=0 );
+ }
+ else { // 2-stepped padding
+ // internal can be implied by zeropad, or user-set.
+ // left, right, and centered alignment overrule internal,
+ // but spacepad or truncate might be mixed with internal (using manipulator)
+ put_last( oss, x); // may pad
+ const Ch * res_beg = buf.pbase();
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/boostheaders -r 33
More information about the Boostheaders-commits
mailing list