| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | //  Boost string_algo library erase.hpp header file  ---------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-11-25 18:07:19 +00:00
										 |  |  | //  Copyright Pavol Droba 2002-2006.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // 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)
 | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-11-25 18:07:19 +00:00
										 |  |  | //  See http://www.boost.org/ for updates, documentation, and revision history.
 | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifndef BOOST_STRING_ERASE_HPP
 | 
					
						
							|  |  |  | #define BOOST_STRING_ERASE_HPP
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <boost/algorithm/string/config.hpp>
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <boost/range/iterator_range.hpp>
 | 
					
						
							|  |  |  | #include <boost/range/begin.hpp>
 | 
					
						
							|  |  |  | #include <boost/range/end.hpp>
 | 
					
						
							|  |  |  | #include <boost/range/iterator.hpp>
 | 
					
						
							|  |  |  | #include <boost/range/const_iterator.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | #include <boost/algorithm/string/find_format.hpp>
 | 
					
						
							|  |  |  | #include <boost/algorithm/string/finder.hpp>
 | 
					
						
							|  |  |  | #include <boost/algorithm/string/formatter.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*! \file
 | 
					
						
							|  |  |  |     Defines various erase algorithms. Each algorithm removes | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |     part(s) of the input according to a searching criteria. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace boost { | 
					
						
							|  |  |  |     namespace algorithm { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_range -------------------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase range algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Remove the given range from the input. The result is a modified copy of  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             the input. It is returned as a sequence or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |      | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             \param Input An input sequence | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param SearchRange A range in the input to be removed | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |             \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							|  |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename OutputIteratorT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT erase_range_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Input, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const iterator_range< | 
					
						
							|  |  |  |                 BOOST_STRING_TYPENAME  | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |                     range_const_iterator<RangeT>::type>& SearchRange ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::range_finder(SearchRange), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase range algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template<typename SequenceT> | 
					
						
							|  |  |  |         inline SequenceT erase_range_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							|  |  |  |             const iterator_range< | 
					
						
							|  |  |  |                 BOOST_STRING_TYPENAME  | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |                     range_const_iterator<SequenceT>::type>& SearchRange ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::range_finder(SearchRange), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase range algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Remove the given range from the input. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             \param Input An input sequence | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param SearchRange A range in the input to be removed | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template<typename SequenceT> | 
					
						
							|  |  |  |         inline void erase_range(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							|  |  |  |             const iterator_range< | 
					
						
							|  |  |  |                 BOOST_STRING_TYPENAME  | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |                     range_iterator<SequenceT>::type>& SearchRange ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::range_finder(SearchRange), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_first  --------------------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase first algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the first occurrence of the substring from the input. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for  | 
					
						
							|  |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |              | 
					
						
							|  |  |  |             \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT erase_first_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase first algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT erase_first_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase first algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the first occurrence of the substring from the input.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void erase_first(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_first ( case insensitive ) ------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase first algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the first occurrence of the substring from the input.  | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Searching is case insensitive. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for  | 
					
						
							|  |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							|  |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |             \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							|  |  |  |         */ | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT ierase_first_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase first algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT ierase_first_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase first algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the first occurrence of the substring from the input.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. Searching is case insensitive. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for | 
					
						
							|  |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void ierase_first(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_last  --------------------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase last algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the last occurrence of the substring from the input.  | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for. | 
					
						
							|  |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |              \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT erase_last_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::last_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase last algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT erase_last_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::last_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase last algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the last occurrence of the substring from the input.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void erase_last(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::last_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_last ( case insensitive ) ------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase last algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the last occurrence of the substring from the input.  | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Searching is case insensitive. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for | 
					
						
							|  |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							|  |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |              \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT ierase_last_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::last_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase last algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT ierase_last_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::last_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase last algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the last occurrence of the substring from the input.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. Searching is case insensitive. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for | 
					
						
							|  |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void ierase_last(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::last_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_nth --------------------------------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase nth algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the Nth occurrence of the substring in the input. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |              | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             \param Nth An index of the match to be replaced. The index is 0-based. | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |                 For negative N, matches are counted from the end of string. | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |              \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT erase_nth_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int Nth ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::nth_finder(Search, Nth), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase nth algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT erase_nth_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int Nth ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::nth_finder(Search, Nth), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase nth algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the Nth occurrence of the substring in the input. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             \param Nth An index of the match to be replaced. The index is 0-based. | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |                 For negative N, matches are counted from the end of string. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void erase_nth(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int Nth ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::nth_finder(Search, Nth), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_nth ( case insensitive ) ---------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase nth algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the Nth occurrence of the substring in the input. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator.  | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Searching is case insensitive. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             \param Nth An index of the match to be replaced. The index is 0-based. | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |                 For negative N, matches are counted from the end of string. | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							|  |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |             \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT ierase_nth_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int Nth, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase nth algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT ierase_nth_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int Nth, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 empty_formatter(Input) ); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase nth algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the Nth occurrence of the substring in the input. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. Searching is case insensitive. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             \param Nth An index of the match to be replaced. The index is 0-based. | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |                 For negative N, matches are counted from the end of string. | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void ierase_nth(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int Nth, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_all  --------------------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase all algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Remove all the occurrences of the string from the input.  | 
					
						
							|  |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                          | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             \param Input An input sequence | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for.  | 
					
						
							|  |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                     a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |             \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT erase_all_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_all_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase all algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */   | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT erase_all_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_all_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase all algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Remove all the occurrences of the string from the input.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void erase_all(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format_all(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_all ( case insensitive ) ------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase all algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Remove all the occurrences of the string from the input.  | 
					
						
							|  |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator.  | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Searching is case insensitive. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for | 
					
						
							|  |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							|  |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                     a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |               \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename Range1T,  | 
					
						
							|  |  |  |             typename Range2T> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT ierase_all_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const Range1T& Input, | 
					
						
							|  |  |  |             const Range2T& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_all_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase all algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline SequenceT ierase_all_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_all_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase all algorithm ( case insensitive )
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             Remove all the occurrences of the string from the input.  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             The input sequence is modified in-place. Searching is case insensitive. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Search A substring to be searched for.  | 
					
						
							|  |  |  |             \param Loc A locale used for case insensitive comparison | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |         template<typename SequenceT, typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline void ierase_all(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Search, | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             const std::locale& Loc=std::locale() ) | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format_all(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::first_finder(Search, is_iequal(Loc)), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter(Input) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_head --------------------------------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase head algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the head from the input. The head is a prefix of a sequence of given size.  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             If the sequence is shorter then required, the whole string is  | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             considered to be the head. The result is a modified copy of the input.  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             It is returned as a sequence or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |              | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |             \param N Length of the head. | 
					
						
							|  |  |  |                 For N>=0, at most N characters are extracted. | 
					
						
							|  |  |  |                 For N<0, size(Input)-|N| characters are extracted. | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							| 
									
										
										
										
											2004-07-14 21:28:31 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |              \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT erase_head_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Input, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int N ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::head_finder(N), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter( Input ) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase head algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template<typename SequenceT> | 
					
						
							|  |  |  |         inline SequenceT erase_head_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int N ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::head_finder(N), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter( Input ) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase head algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the head from the input. The head is a prefix of a sequence of given size.  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             If the sequence is shorter then required, the whole string is  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             considered to be the head. The input sequence is modified in-place. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param N Length of the head | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |                 For N>=0, at most N characters are extracted. | 
					
						
							|  |  |  |                 For N<0, size(Input)-|N| characters are extracted. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template<typename SequenceT> | 
					
						
							|  |  |  |         inline void erase_head(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int N ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::head_finder(N), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter( Input ) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //  erase_tail --------------------------------------------------------------------//
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase tail algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the tail from the input. The tail is a suffix of a sequence of given size.  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             If the sequence is shorter then required, the whole string is  | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             considered to be the tail.  | 
					
						
							|  |  |  |             The result is a modified copy of the input. It is returned as a sequence  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             or copied to the output iterator. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \param Output An output iterator to which the result will be copied | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2010-07-10 20:29:03 +00:00
										 |  |  |             \param N Length of the tail.                  | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |                 For N>=0, at most N characters are extracted. | 
					
						
							|  |  |  |                 For N<0, size(Input)-|N| characters are extracted. | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             \return An output iterator pointing just after the last inserted character or | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |                 a modified copy of the input | 
					
						
							|  |  |  |              | 
					
						
							| 
									
										
										
										
											2004-07-16 09:06:39 +00:00
										 |  |  |              \note The second variant of this function provides the strong exception-safety guarantee | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template< | 
					
						
							|  |  |  |             typename OutputIteratorT, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             typename RangeT> | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         inline OutputIteratorT erase_tail_copy( | 
					
						
							|  |  |  |             OutputIteratorT Output, | 
					
						
							| 
									
										
										
										
											2005-04-12 16:50:42 +00:00
										 |  |  |             const RangeT& Input, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int N ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy( | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Output, | 
					
						
							|  |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::tail_finder(N), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter( Input ) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase tail algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \overload | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template<typename SequenceT> | 
					
						
							|  |  |  |         inline SequenceT erase_tail_copy(  | 
					
						
							|  |  |  |             const SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int N ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             return ::boost::algorithm::find_format_copy(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input, | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::tail_finder(N), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter( Input ) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         //! Erase tail algorithm
 | 
					
						
							|  |  |  |         /*!
 | 
					
						
							| 
									
										
										
										
											2005-01-21 16:45:29 +00:00
										 |  |  |             Remove the tail from the input. The tail is a suffix of a sequence of given size.  | 
					
						
							| 
									
										
										
										
											2004-07-15 21:48:25 +00:00
										 |  |  |             If the sequence is shorter then required, the whole string is | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |             considered to be the tail. The input sequence is modified in-place. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-07-11 22:07:00 +00:00
										 |  |  |             \param Input An input string | 
					
						
							| 
									
										
										
										
											2010-07-10 20:29:03 +00:00
										 |  |  |             \param N Length of the tail | 
					
						
							| 
									
										
										
										
											2006-03-07 13:09:36 +00:00
										 |  |  |                 For N>=0, at most N characters are extracted. | 
					
						
							|  |  |  |                 For N<0, size(Input)-|N| characters are extracted. | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         */ | 
					
						
							|  |  |  |         template<typename SequenceT> | 
					
						
							|  |  |  |         inline void erase_tail(  | 
					
						
							|  |  |  |             SequenceT& Input, | 
					
						
							| 
									
										
										
										
											2006-01-31 12:36:32 +00:00
										 |  |  |             int N ) | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |             ::boost::algorithm::find_format(  | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |                 Input,  | 
					
						
							| 
									
										
										
										
											2009-09-13 19:10:55 +00:00
										 |  |  |                 ::boost::algorithm::tail_finder(N), | 
					
						
							|  |  |  |                 ::boost::algorithm::empty_formatter( Input ) ); | 
					
						
							| 
									
										
										
										
											2004-03-04 22:12:19 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } // namespace algorithm
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // pull names into the boost namespace
 | 
					
						
							|  |  |  |     using algorithm::erase_range_copy; | 
					
						
							|  |  |  |     using algorithm::erase_range; | 
					
						
							|  |  |  |     using algorithm::erase_first_copy; | 
					
						
							|  |  |  |     using algorithm::erase_first; | 
					
						
							|  |  |  |     using algorithm::ierase_first_copy; | 
					
						
							|  |  |  |     using algorithm::ierase_first; | 
					
						
							|  |  |  |     using algorithm::erase_last_copy; | 
					
						
							|  |  |  |     using algorithm::erase_last; | 
					
						
							|  |  |  |     using algorithm::ierase_last_copy; | 
					
						
							|  |  |  |     using algorithm::ierase_last; | 
					
						
							|  |  |  |     using algorithm::erase_nth_copy; | 
					
						
							|  |  |  |     using algorithm::erase_nth; | 
					
						
							|  |  |  |     using algorithm::ierase_nth_copy; | 
					
						
							|  |  |  |     using algorithm::ierase_nth; | 
					
						
							|  |  |  |     using algorithm::erase_all_copy; | 
					
						
							|  |  |  |     using algorithm::erase_all; | 
					
						
							|  |  |  |     using algorithm::ierase_all_copy; | 
					
						
							|  |  |  |     using algorithm::ierase_all; | 
					
						
							|  |  |  |     using algorithm::erase_head_copy; | 
					
						
							|  |  |  |     using algorithm::erase_head; | 
					
						
							|  |  |  |     using algorithm::erase_tail_copy; | 
					
						
							|  |  |  |     using algorithm::erase_tail; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace boost
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif  // BOOST_ERASE_HPP
 |