diff options
author | Tobias Markmann <tm@ayena.de> | 2014-10-19 20:22:58 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2014-10-20 13:49:33 (GMT) |
commit | 6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch) | |
tree | 2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/format | |
parent | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff) | |
download | swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2 |
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0.
Updated our update.sh script to stop on error.
Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to
missing include of <iostream> with newer Boost.
Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/format')
9 files changed, 65 insertions, 42 deletions
diff --git a/3rdParty/Boost/src/boost/format/detail/config_macros.hpp b/3rdParty/Boost/src/boost/format/detail/config_macros.hpp index 1f01b17..44d1e86 100644 --- a/3rdParty/Boost/src/boost/format/detail/config_macros.hpp +++ b/3rdParty/Boost/src/boost/format/detail/config_macros.hpp @@ -17,81 +17,79 @@ #ifndef BOOST_FORMAT_CONFIG_MACROS_HPP #define BOOST_FORMAT_CONFIG_MACROS_HPP #include <boost/config.hpp> #include <boost/detail/workaround.hpp> // make sure our local macros wont override something : #if defined(BOOST_NO_LOCALE_ISDIGIT) || defined(BOOST_OVERLOAD_FOR_NON_CONST) \ || defined(BOOST_IO_STD) || defined( BOOST_IO_NEEDS_USING_DECLARATION ) \ || defined(BOOST_NO_TEMPLATE_STD_STREAM) \ || defined(BOOST_FORMAT_STREAMBUF_DEFINED) || defined(BOOST_FORMAT_OSTREAM_DEFINED) #error "boost::format uses a local macro that is already defined." #endif // specific workarounds. each header can define BOOS_IO_STD if it // needs. (e.g. because of IO_NEEDS_USING_DECLARATION) #include <boost/format/detail/workarounds_gcc-2_95.hpp> #include <boost/format/detail/workarounds_stlport.hpp> #ifndef BOOST_IO_STD # define BOOST_IO_STD ::std:: #endif #if defined(BOOST_NO_STD_LOCALE) || \ ( BOOST_WORKAROUND(__BORLANDC__, <= 0x564) \ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) ) // some future __BORLANDC__ >0x564 versions might not need this // 0x570 is Borland's kylix branch #define BOOST_NO_LOCALE_ISDIGIT #endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570) ) || BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1300)) #define BOOST_NO_OVERLOAD_FOR_NON_CONST #endif -// gcc-2.95's native stringstream is not usable -#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) -#define BOOST_FORMAT_IGNORE_STRINGSTREAM -#endif - - // **** Workaround for io streams, stlport and msvc. #ifdef BOOST_IO_NEEDS_USING_DECLARATION namespace boost { using std::char_traits; using std::basic_ostream; namespace io { using std::basic_ostream; namespace detail { using std::basic_ios; using std::basic_ostream; } } #if ! defined(BOOST_NO_STD_LOCALE) using std::locale; namespace io { using std::locale; namespace detail { using std::locale; } } #endif // locale } // -end N.S. boost #endif // needs_using_declaration +#if ! defined(BOOST_NO_STD_LOCALE) +#include <locale> +#endif + // *** hide std::locale if it doesnt exist. // this typedef is either std::locale or int, avoids placing ifdefs everywhere namespace boost { namespace io { namespace detail { #if ! defined(BOOST_NO_STD_LOCALE) typedef BOOST_IO_STD locale locale_t; #else typedef int locale_t; #endif } } } // ---------------------------------------------------------------------------- #endif // BOOST_FORMAT_MACROS_DEFAULT_HPP diff --git a/3rdParty/Boost/src/boost/format/detail/msvc_disambiguater.hpp b/3rdParty/Boost/src/boost/format/detail/msvc_disambiguater.hpp index f12e5e9..c2692c4 100644 --- a/3rdParty/Boost/src/boost/format/detail/msvc_disambiguater.hpp +++ b/3rdParty/Boost/src/boost/format/detail/msvc_disambiguater.hpp @@ -1,56 +1,54 @@ // ---------------------------------------------------------------------------- // msvc_disambiguater.hpp : msvc workarounds. (for put_{head|last} overloads) // the trick was described in boost's list by Aleksey Gurtovoy // ---------------------------------------------------------------------------- // 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_MSVC_DISAMBIGUATER_HPP #define BOOST_MSVC_DISAMBIGUATER_HPP -#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) || \ - BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) - // this whole header is specifically for msvc up to 7.0 +#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) #include <boost/format/group.hpp> #include <ostream> namespace boost { namespace io { namespace detail { template< class Ch, class Tr, class T > struct disambiguater { template< typename U > static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long) { os << group_head(x.a1_); } static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int) { } template< typename U > static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long) { os << group_last(x.a1_); } static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int) { os << x; } }; } // namespace detail } // namespace io } // namespace boost -#endif // -BOOST_MSVC +#endif // -__DECCXX_VER #endif // -BOOST_MSVC_DISAMBIGUATER_HPP diff --git a/3rdParty/Boost/src/boost/format/detail/workarounds_stlport.hpp b/3rdParty/Boost/src/boost/format/detail/workarounds_stlport.hpp index eb35dc1..5d435b9 100644 --- a/3rdParty/Boost/src/boost/format/detail/workarounds_stlport.hpp +++ b/3rdParty/Boost/src/boost/format/detail/workarounds_stlport.hpp @@ -1,42 +1,36 @@ // ---------------------------------------------------------------------------- // workarounds_stlport.hpp : workaround STLport issues // ---------------------------------------------------------------------------- // 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_MACROS_STLPORT_HPP #define BOOST_MACROS_STLPORT_HPP -#if defined(_STLPORT_VERSION) && BOOST_WORKAROUND( BOOST_MSVC, <= 1300) -// msvc-6-stlport fails to find basic_string::append( iterator, iterator) when linking -// might affect other MSwindows compilers -#define BOOST_NO_STRING_APPEND -#endif - // *** This should go to "boost/config/stdlib/stlport.hpp". // If the streams are not native and there are problems with using templates // accross namespaces, we define some macros to enable a workaround for this. // STLport 4.5 #if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) # define BOOST_IO_STD # define BOOST_IO_NEEDS_USING_DECLARATION #endif // STLport 4.0 #if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_OWN_NAMESPACE) && defined(BOOST_NO_USING_TEMPLATE) # define BOOST_IO_STD # define BOOST_IO_NEEDS_USING_DECLARATION #endif // ---------------------------------------------------------------------------- #endif // BOOST_MACROS_STLPORT_HPP diff --git a/3rdParty/Boost/src/boost/format/feed_args.hpp b/3rdParty/Boost/src/boost/format/feed_args.hpp index 53243dc..dcfd955 100644 --- a/3rdParty/Boost/src/boost/format/feed_args.hpp +++ b/3rdParty/Boost/src/boost/format/feed_args.hpp @@ -38,116 +38,148 @@ namespace detail { // 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.. +#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) +// __DECCXX 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 +#endif // -__DECCXX workaround + + template< class Ch, class Tr, class T> + void call_put_head(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x) { + put_head(os, *(typename ::boost::remove_reference<T>::type*)x); + } + + template< class Ch, class Tr, class T> + void call_put_last(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x) { + put_last(os, *(T*)x); + } + + template< class Ch, class Tr> + struct put_holder { + template<class T> + put_holder(T& t) + : arg(&t), + put_head(&call_put_head<Ch, Tr, T>), + put_last(&call_put_last<Ch, Tr, T>) + {} + const void* arg; + void (*put_head)(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x); + void (*put_last)(BOOST_IO_STD basic_ostream<Ch, Tr> & os, const void* x); + }; + + template< class Ch, class Tr> inline + void put_head( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const put_holder<Ch, Tr>& t) { + t.put_head(os, t.arg); + } + + template< class Ch, class Tr> inline + void put_last( BOOST_IO_STD basic_ostream<Ch, Tr> & os, const put_holder<Ch, Tr>& t) { + t.put_last(os, t.arg); + } 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); @@ -226,52 +258,58 @@ namespace detail { std::streamsize d = w - static_cast<std::streamsize>(tmp_size); BOOST_ASSERT(d>0); res.append(static_cast<size_type>( d ), oss2.fill()); res.append(tmp_beg+i, tmp_size-i); BOOST_ASSERT(i+(tmp_size-i)+(std::max)(d,(std::streamsize)0) == static_cast<size_type>(w)); BOOST_ASSERT(res.size() == static_cast<size_type>(w)); } } } buf.clear_buffer(); #ifdef BOOST_MSVC #pragma warning(pop) #endif } // end- put(..) template< class Ch, class Tr, class Alloc, class T> void distribute (basic_format<Ch,Tr, Alloc>& self, T x) { // call put(x, ..) on every occurence of the current argument : if(self.cur_arg_ >= self.num_args_) { if( self.exceptions() & too_many_args_bit ) boost::throw_exception(too_many_args(self.cur_arg_, self.num_args_)); else return; } for(unsigned long i=0; i < self.items_.size(); ++i) { if(self.items_[i].argN_ == self.cur_arg_) { put<Ch, Tr, Alloc, T> (x, self.items_[i], self.items_[i].res_, self.buf_, boost::get_pointer(self.loc_) ); } } } template<class Ch, class Tr, class Alloc, class T> basic_format<Ch, Tr, Alloc>& - feed (basic_format<Ch,Tr, Alloc>& self, T x) { + feed_impl (basic_format<Ch,Tr, Alloc>& self, T x) { if(self.dumped_) self.clear(); distribute<Ch, Tr, Alloc, T> (self, x); ++self.cur_arg_; if(self.bound_.size() != 0) { while( self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_] ) ++self.cur_arg_; } return self; } + + template<class Ch, class Tr, class Alloc, class T> inline + basic_format<Ch, Tr, Alloc>& + feed (basic_format<Ch,Tr, Alloc>& self, T x) { + return feed_impl<Ch, Tr, Alloc, const put_holder<Ch, Tr>&>(self, put_holder<Ch, Tr>(x)); + } } // namespace detail } // namespace io } // namespace boost #endif // BOOST_FORMAT_FEED_ARGS_HPP diff --git a/3rdParty/Boost/src/boost/format/format_class.hpp b/3rdParty/Boost/src/boost/format/format_class.hpp index 4555e56..2ac59ef 100644 --- a/3rdParty/Boost/src/boost/format/format_class.hpp +++ b/3rdParty/Boost/src/boost/format/format_class.hpp @@ -94,71 +94,71 @@ namespace boost { // ** object modifying **// template<class T> basic_format& bind_arg(int argN, const T& val) { return io::detail::bind_arg_body(*this, argN, val); } basic_format& clear_bind(int argN); template<class T> basic_format& modify_item(int itemN, T manipulator) { return io::detail::modify_item_body<Ch,Tr, Alloc, T> (*this, itemN, manipulator);} // Choosing which errors will throw exceptions : unsigned char exceptions() const; unsigned char exceptions(unsigned char newexcept); #if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS ) \ && !BOOST_WORKAROUND(__BORLANDC__, <= 0x570) \ && !BOOST_WORKAROUND( _CRAYC, != 0) \ && !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) // use friend templates and private members only if supported #ifndef BOOST_NO_TEMPLATE_STD_STREAM template<class Ch2, class Tr2, class Alloc2> friend std::basic_ostream<Ch2, Tr2> & operator<<( std::basic_ostream<Ch2, Tr2> & , const basic_format<Ch2, Tr2, Alloc2>& ); #else template<class Ch2, class Tr2, class Alloc2> friend std::ostream & operator<<( std::ostream & , const basic_format<Ch2, Tr2, Alloc2>& ); #endif template<class Ch2, class Tr2, class Alloc2, class T> friend basic_format<Ch2, Tr2, Alloc2>& - io::detail::feed (basic_format<Ch2, Tr2, Alloc2>&, T); + io::detail::feed_impl (basic_format<Ch2, Tr2, Alloc2>&, T); template<class Ch2, class Tr2, class Alloc2, class T> friend void io::detail::distribute (basic_format<Ch2, Tr2, Alloc2>&, T); template<class Ch2, class Tr2, class Alloc2, class T> friend basic_format<Ch2, Tr2, Alloc2>& io::detail::modify_item_body (basic_format<Ch2, Tr2, Alloc2>&, int, T); template<class Ch2, class Tr2, class Alloc2, class T> friend basic_format<Ch2, Tr2, Alloc2>& io::detail::bind_arg_body (basic_format<Ch2, Tr2, Alloc2>&, int, const T&); private: #endif typedef io::detail::stream_format_state<Ch, Tr> stream_format_state; // flag bits, used for style_ enum style_values { ordered = 1, // set only if all directives are positional special_needs = 4 }; void make_or_reuse_data(std::size_t nbitems);// used for (re-)initialisation // member data --------------------------------------------// std::vector<format_item_t> items_; // each '%..' directive leads to a format_item std::vector<bool> bound_; // stores which arguments were bound. size() == 0 || num_args int style_; // style of format-string : positional or not, etc int cur_arg_; // keep track of wich argument is current int num_args_; // number of expected arguments mutable bool dumped_; // true only after call to str() or << string_type prefix_; // piece of string to insert before first item unsigned char exceptions_; internal_streambuf_t buf_; // the internal stream buffer. boost::optional<io::detail::locale_t> loc_; }; // class basic_format diff --git a/3rdParty/Boost/src/boost/format/format_fwd.hpp b/3rdParty/Boost/src/boost/format/format_fwd.hpp index be3228a..16b8565 100644 --- a/3rdParty/Boost/src/boost/format/format_fwd.hpp +++ b/3rdParty/Boost/src/boost/format/format_fwd.hpp @@ -1,49 +1,43 @@ // ---------------------------------------------------------------------------- // format_fwd.hpp : forward declarations // ---------------------------------------------------------------------------- // 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_FWD_HPP #define BOOST_FORMAT_FWD_HPP #include <string> #include <iosfwd> #include <boost/format/detail/compat_workarounds.hpp> namespace boost { template <class Ch, -#if !( BOOST_WORKAROUND(__GNUC__, <3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) ) - // gcc-2.95's native stdlid needs special treatment - class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> > -#else - class Tr = std::string_char_traits<Ch>, class Alloc = std::alloc > -#endif + class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> > class basic_format; typedef basic_format<char > format; -#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF) \ - && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM) +#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF) typedef basic_format<wchar_t > wformat; #endif namespace io { enum format_error_bits { bad_format_string_bit = 1, too_few_args_bit = 2, too_many_args_bit = 4, out_of_range_bit = 8, all_error_bits = 255, no_error_bits=0 }; } // namespace io } // namespace boost #endif // BOOST_FORMAT_FWD_HPP diff --git a/3rdParty/Boost/src/boost/format/internals.hpp b/3rdParty/Boost/src/boost/format/internals.hpp index b0d874a..1c67006 100644 --- a/3rdParty/Boost/src/boost/format/internals.hpp +++ b/3rdParty/Boost/src/boost/format/internals.hpp @@ -72,88 +72,89 @@ namespace detail { argN_ignored = -3 // ignored directive. (no argument read) }; typedef BOOST_IO_STD basic_ios<Ch, Tr> basic_ios; typedef detail::stream_format_state<Ch, Tr> stream_format_state; typedef ::std::basic_string<Ch, Tr, Alloc> string_type; format_item(Ch fill) :argN_(argN_no_posit), fmtstate_(fill), truncate_(max_streamsize()), pad_scheme_(0) {} void reset(Ch fill); void compute_states(); // sets states according to truncate and pad_scheme. static std::streamsize max_streamsize() { return (std::numeric_limits<std::streamsize>::max)(); } // --- data --- int argN_; //- argument number (starts at 0, eg : %1 => argN=0) // negative values for items that don't process an argument string_type res_; //- result of the formatting of this item string_type appendix_; //- piece of string between this item and the next stream_format_state fmtstate_;// set by parsing, is only affected by modify_item std::streamsize truncate_;//- is set for directives like %.5s that ask truncation unsigned int pad_scheme_;//- several possible padding schemes can mix. see pad_values }; //--- Definitions ------------------------------------------------------------ // - stream_format_state:: ------------------------------------------------- template<class Ch, class Tr> void stream_format_state<Ch,Tr>:: apply_on (basic_ios & os, boost::io::detail::locale_t * loc_default) const { + // If a locale is available, set it first. "os.fill(fill_);" may chrash otherwise. +#if !defined(BOOST_NO_STD_LOCALE) + if(loc_) + os.imbue(loc_.get()); + else if(loc_default) + os.imbue(*loc_default); +#else + (void) loc_default; // keep compiler quiet if we don't support locales +#endif // set the state of this stream according to our params if(width_ != -1) os.width(width_); if(precision_ != -1) os.precision(precision_); if(fill_ != 0) os.fill(fill_); os.flags(flags_); os.clear(rdstate_); os.exceptions(exceptions_); -#if !defined(BOOST_NO_STD_LOCALE) - if(loc_) - os.imbue(loc_.get()); - else if(loc_default) - os.imbue(*loc_default); -#else - (void) loc_default; // keep compiler quiet if we don't support locales -#endif } template<class Ch, class Tr> void stream_format_state<Ch,Tr>:: set_by_stream(const basic_ios& os) { // set our params according to the state of this stream flags_ = os.flags(); width_ = os.width(); precision_ = os.precision(); fill_ = os.fill(); rdstate_ = os.rdstate(); exceptions_ = os.exceptions(); } template<class Ch, class Tr, class T> void apply_manip_body( stream_format_state<Ch, Tr>& self, T manipulator) { // modify our params according to the manipulator basic_oaltstringstream<Ch, Tr> ss; self.apply_on( ss ); ss << manipulator; self.set_by_stream( ss ); } template<class Ch, class Tr> inline void stream_format_state<Ch,Tr>:: reset(Ch fill) { // set our params to standard's default state. cf 27.4.4.1 of the C++ norm width_=0; precision_=6; fill_=fill; // default is widen(' '), but we cant compute it without the locale flags_ = std::ios_base::dec | std::ios_base::skipws; // the adjust_field part is left equal to 0, which means right. exceptions_ = std::ios_base::goodbit; rdstate_ = std::ios_base::goodbit; } diff --git a/3rdParty/Boost/src/boost/format/internals_fwd.hpp b/3rdParty/Boost/src/boost/format/internals_fwd.hpp index e44eb3c..18cf122 100644 --- a/3rdParty/Boost/src/boost/format/internals_fwd.hpp +++ b/3rdParty/Boost/src/boost/format/internals_fwd.hpp @@ -18,43 +18,47 @@ namespace boost { namespace io { namespace detail { template<class Ch, class Tr> struct stream_format_state; template<class Ch, class Tr, class Alloc> struct format_item; // these functions were intended as methods, // but MSVC have problems with template member functions : // defined in format_implementation.hpp : template<class Ch, class Tr, class Alloc, class T> basic_format<Ch, Tr, Alloc>& modify_item_body (basic_format<Ch, Tr, Alloc>& self, int itemN, T manipulator); template<class Ch, class Tr, class Alloc, class T> basic_format<Ch, Tr, Alloc>& bind_arg_body (basic_format<Ch, Tr, Alloc>& self, int argN, const T& val); // in internals.hpp : template<class Ch, class Tr, class T> void apply_manip_body (stream_format_state<Ch, Tr>& self, T manipulator); // argument feeding (defined in feed_args.hpp ) : template<class Ch, class Tr, class Alloc, class T> void distribute (basic_format<Ch,Tr, Alloc>& self, T x); template<class Ch, class Tr, class Alloc, class T> basic_format<Ch, Tr, Alloc>& feed (basic_format<Ch,Tr, Alloc>& self, T x); + + template<class Ch, class Tr, class Alloc, class T> + basic_format<Ch, Tr, Alloc>& + feed_impl (basic_format<Ch,Tr, Alloc>& self, T x); } // namespace detail } // namespace io } // namespace boost #endif // BOOST_FORMAT_INTERNAL_FWD_HPP diff --git a/3rdParty/Boost/src/boost/format/parsing.hpp b/3rdParty/Boost/src/boost/format/parsing.hpp index b14ca82..3ff1828 100644 --- a/3rdParty/Boost/src/boost/format/parsing.hpp +++ b/3rdParty/Boost/src/boost/format/parsing.hpp @@ -358,75 +358,71 @@ namespace detail { const typename String::value_type arg_mark, const Facet& fac, unsigned char exceptions) { // quick-parsing of the format-string to count arguments mark (arg_mark, '%') // returns : upper bound on the number of format items in the format strings using namespace boost::io; typename String::size_type i1=0; int num_items=0; while( (i1=buf.find(arg_mark,i1)) != String::npos ) { if( i1+1 >= buf.size() ) { if(exceptions & bad_format_string_bit) boost::throw_exception(bad_format_string(i1, buf.size() )); // must not end in ".. %" else { ++num_items; break; } } if(buf[i1+1] == buf[i1] ) {// escaped "%%" i1+=2; continue; } ++i1; // in case of %N% directives, dont count it double (wastes allocations..) : i1 = detail::wrap_scan_notdigit(fac, buf.begin()+i1, buf.end()) - buf.begin(); if( i1 < buf.size() && buf[i1] == arg_mark ) ++i1; ++num_items; } return num_items; } template<class String> inline void append_string(String& dst, const String& src, const typename String::size_type beg, const typename String::size_type end) { -#if !defined(BOOST_NO_STRING_APPEND) dst.append(src.begin()+beg, src.begin()+end); -#else - dst += src.substr(beg, end-beg); -#endif } } // detail namespace } // io namespace // ----------------------------------------------- // format :: parse(..) template<class Ch, class Tr, class Alloc> basic_format<Ch, Tr, Alloc>& basic_format<Ch, Tr, Alloc>:: parse (const string_type& buf) { // parse the format-string using namespace std; #if !defined(BOOST_NO_STD_LOCALE) const std::ctype<Ch> & fac = BOOST_USE_FACET( std::ctype<Ch>, getloc()); #else io::basic_oaltstringstream<Ch, Tr, Alloc> fac; //has widen and narrow even on compilers without locale #endif const Ch arg_mark = io::detail::const_or_not(fac).widen( '%'); bool ordered_args=true; int max_argN=-1; // A: find upper_bound on num_items and allocates arrays int num_items = io::detail::upper_bound_from_fstring(buf, arg_mark, fac, exceptions()); make_or_reuse_data(num_items); // B: Now the real parsing of the format string : num_items=0; typename string_type::size_type i0=0, i1=0; typename string_type::const_iterator it; bool special_things=false; |