Compare commits

..

38 Commits

Author SHA1 Message Date
c7ac93e745 Release 1.45.0
[SVN r66646]
2010-11-19 15:17:53 +00:00
50703b8c97 Merge documentation fixes to release.
[SVN r66285]
2010-10-30 17:34:45 +00:00
0f8d556130 Merge r65004 from trunk
Fix #4551,#4553,#4575 by removing unused parameter.



[SVN r65168]
2010-09-01 16:18:07 +00:00
bbd3220a1e Merging changes from trunk
[SVN r63824]
2010-07-10 20:29:03 +00:00
9068069106 Spirit: merging from trunk upto rev. 61489
[SVN r63640]
2010-07-04 22:38:38 +00:00
a37af3c81e Merge documentation fixes.
* Use `doc/src/*.css` instead of `doc/html/*.css`.
* Remove wiki and people directories.
* Some documentation fixes.
* Left out `minimal.css` changes and boostbook changes because of clashes.


[SVN r63347]
2010-06-26 12:30:09 +00:00
f5885c6fb0 Merge minmax from the trunk
[SVN r62088]
2010-05-18 17:53:36 +00:00
d45bb3545e Merge some link fixes and release notes.
[SVN r61474]
2010-04-21 23:00:35 +00:00
d735b9fa1e rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
62ec675581 Merged changes from trunk
[SVN r56176]
2009-09-13 19:10:55 +00:00
e7cd4da67b Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
6076f5a18e Merge [53520] from the trunk
[SVN r53909]
2009-06-14 22:56:08 +00:00
60cd5a0500 Merge [53062] from the trunk
[SVN r53270]
2009-05-26 01:17:07 +00:00
c33dad924d Fixed almost all tab and min/max issues found by inspect tool
[SVN r53142]
2009-05-20 19:41:20 +00:00
2f2935f07e Merged revisions 45283,48266 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r45283 | danieljames | 2008-05-11 14:49:20 +0100 (Sun, 11 May 2008) | 1 line
  
  Quote href values - our tools don't support unquoted values.
........
  r48266 | danieljames | 2008-08-20 20:32:23 +0100 (Wed, 20 Aug 2008) | 1 line
  
  Fix the link to the limits documentation.
........


[SVN r51902]
2009-03-22 17:30:02 +00:00
3cbaafc27f Merge PDF build changes from Trunk.
[SVN r51417]
2009-02-23 18:39:32 +00:00
c067b348bf Merge [51045] from the trunk
[SVN r51226]
2009-02-12 18:47:06 +00:00
c33935fa1f merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
98a8b08afb Memory management fixes for is_any_of predicate merged from the trunk
[SVN r49172]
2008-10-07 21:59:57 +00:00
fc0f3dcffc Cummulative merge of updates from the main trunk
[SVN r46505]
2008-06-19 12:07:24 +00:00
822636418b Merged revisions 43211,43214-43219,43222-43225,43227-43238,43242,43244-43245,43249-43250,43257-43259,43261,43263,43265,43267-43268,43270-43271,43273,43275-43279,43284-43289,43291,43295,43297-43298,43304-43305,43307,43313,43315,43324,43326-43327,43331,43333,43339-43343,43345,43348,43350,43352-43353,43355-43356,43358,43360,43366-43367,43369-43370,43372-43376,43378-43389,43394,43396-43398,43400-43401,43403-43404,43406-43408,43413-43415,43417-43418,43420,43422-43423 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r43417 | danieljames | 2008-02-26 22:04:55 +0000 (Tue, 26 Feb 2008) | 2 lines
  
  Fix a link to Boost.Bimap.
........
  r43418 | danieljames | 2008-02-26 22:07:25 +0000 (Tue, 26 Feb 2008) | 2 lines
  
  Change another link that's no longer in the repository to link to the website.
........
  r43422 | danieljames | 2008-02-27 18:51:14 +0000 (Wed, 27 Feb 2008) | 1 line
  
  Fix broken copyright urls. Fixes #1573.
........
  r43423 | danieljames | 2008-02-27 19:22:01 +0000 (Wed, 27 Feb 2008) | 1 line
  
  Fix incorrect links to copyright of the form 'http:#www.boost.org
........


[SVN r43425]
2008-02-27 20:00:24 +00:00
352e16aade Merged revisions 43206,43208-43213 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r43206 | danieljames | 2008-02-10 09:55:03 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Fix some broken links.
........
  r43209 | danieljames | 2008-02-10 14:56:22 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Link to people pages on the website, as they've been removed from the download.
........
  r43210 | danieljames | 2008-02-10 15:02:17 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Point links to the pages that used to be in 'more' to the site.
........
  r43212 | danieljames | 2008-02-10 16:10:16 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Fix links on the home page as well.
........
  r43213 | danieljames | 2008-02-10 16:21:22 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Generated documentation which is no longer generated.
........


[SVN r43214]
2008-02-10 16:39:38 +00:00
89c76ea1bb Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
50b5726a6f Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
d4b95734dd Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
05af96f84c This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
5bdbb2b308 Documentation for iter_find/iter_split added
[SVN r37842]
2007-06-01 13:50:51 +00:00
1a02969303 release notes - fix the incorrect functionname spelling
[SVN r37533]
2007-04-29 07:04:58 +00:00
6309379618 release notes for 1.34 added
[SVN r37532]
2007-04-29 07:02:21 +00:00
37581bac55 documentation typo fixed
[SVN r36843]
2007-01-30 07:59:28 +00:00
a71a4ed5b1 Merged copyright and license addition
[SVN r35907]
2006-11-07 19:27:00 +00:00
c509c3fbad Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
d8683f2498 unused parameters removed
[SVN r35753]
2006-10-27 17:37:37 +00:00
7c0101aa51 Copyright added to index.html
unneeded file removed


[SVN r34908]
2006-08-20 20:14:48 +00:00
6f3e85528f License added to the xml documentation files
[SVN r34894]
2006-08-16 07:10:48 +00:00
8af639b7cf missing 'using' directives for join_if and join_if_regex added
missing #include <boost/algorithm/string/join.hpp> added to string_algo.hpp


[SVN r34122]
2006-05-30 19:13:08 +00:00
d9bc7e800b Merged patch from main trunk for borland by Nicola Musatti
[SVN r33723]
2006-04-17 17:16:11 +00:00
b4ed9beb90 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
12 changed files with 50 additions and 312 deletions

View File

@ -74,17 +74,17 @@ namespace boost {
const InputT& Input, const InputT& Input,
FormatterT Formatter, FormatterT Formatter,
const FindResultT& FindResult ) const FindResultT& FindResult )
{ {
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) { if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_copy_impl2( return ::boost::algorithm::detail::find_format_copy_impl2(
Output, Output,
Input, Input,
Formatter, Formatter,
FindResult, FindResult,
Formatter(FindResult) ); Formatter(FindResult) );
} else { } else {
return std::copy( ::boost::begin(Input), ::boost::end(Input), Output ); return std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
} }
} }
@ -137,14 +137,14 @@ namespace boost {
const FindResultT& FindResult) const FindResultT& FindResult)
{ {
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) { if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_copy_impl2( return ::boost::algorithm::detail::find_format_copy_impl2(
Input, Input,
Formatter, Formatter,
FindResult, FindResult,
Formatter(FindResult) ); Formatter(FindResult) );
} else { } else {
return Input; return Input;
} }
} }
// replace implementation ----------------------------------------------------// // replace implementation ----------------------------------------------------//
@ -189,12 +189,12 @@ namespace boost {
const FindResultT& FindResult) const FindResultT& FindResult)
{ {
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) { if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
::boost::algorithm::detail::find_format_impl2( ::boost::algorithm::detail::find_format_impl2(
Input, Input,
Formatter, Formatter,
FindResult, FindResult,
Formatter(FindResult) ); Formatter(FindResult) );
} }
} }
} // namespace detail } // namespace detail

View File

@ -84,18 +84,18 @@ namespace boost {
FinderT Finder, FinderT Finder,
FormatterT Formatter, FormatterT Formatter,
const FindResultT& FindResult ) const FindResultT& FindResult )
{ {
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) { if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_all_copy_impl2( return ::boost::algorithm::detail::find_format_all_copy_impl2(
Output, Output,
Input, Input,
Finder, Finder,
Formatter, Formatter,
FindResult, FindResult,
Formatter(FindResult) ); Formatter(FindResult) );
} else { } else {
return std::copy( ::boost::begin(Input), ::boost::end(Input), Output ); return std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
} }
} }
// find_format_all_copy implementation ----------------------------------------------// // find_format_all_copy implementation ----------------------------------------------//
@ -161,15 +161,15 @@ namespace boost {
const FindResultT& FindResult) const FindResultT& FindResult)
{ {
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) { if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_all_copy_impl2( return ::boost::algorithm::detail::find_format_all_copy_impl2(
Input, Input,
Finder, Finder,
Formatter, Formatter,
FindResult, FindResult,
Formatter(FindResult) ); Formatter(FindResult) );
} else { } else {
return Input; return Input;
} }
} }
// find_format_all implementation ------------------------------------------------// // find_format_all implementation ------------------------------------------------//
@ -257,13 +257,13 @@ namespace boost {
FindResultT FindResult) FindResultT FindResult)
{ {
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) { if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
::boost::algorithm::detail::find_format_all_impl2( ::boost::algorithm::detail::find_format_all_impl2(
Input, Input,
Finder, Finder,
Formatter, Formatter,
FindResult, FindResult,
Formatter(FindResult) ); Formatter(FindResult) );
} }
} }
} // namespace detail } // namespace detail

View File

@ -53,7 +53,7 @@ namespace boost {
{ {
iterator_range<ForwardIteratorT>::operator=(FindResult); iterator_range<ForwardIteratorT>::operator=(FindResult);
if( !this->empty() ) { if( !this->empty() ) {
m_FormatResult=m_Formatter(FindResult); m_FormatResult=m_Formatter(FindResult);
} }
return *this; return *this;

View File

@ -87,31 +87,6 @@ namespace boost {
} }
}; };
// dissect format functor ----------------------------------------------------//
// dissect format functor
template<typename FinderT>
struct dissect_formatF
{
public:
// Construction
dissect_formatF(FinderT Finder) :
m_Finder(Finder) {}
// Operation
template<typename RangeT>
inline iterator_range<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
operator()(const RangeT& Replace) const
{
return m_Finder(::boost::begin(Replace), ::boost::end(Replace));
}
private:
FinderT m_Finder;
};
} // namespace detail } // namespace detail
} // namespace algorithm } // namespace algorithm
} // namespace boost } // namespace boost

View File

@ -259,11 +259,7 @@ namespace boost {
m_End(End), m_End(End),
m_bEof(false) m_bEof(false)
{ {
// force the correct behavior for empty sequences and yield at least one token increment();
if(Begin!=End)
{
increment();
}
} }
//! Constructor //! Constructor
/*! /*!
@ -282,11 +278,7 @@ namespace boost {
m_Next=::boost::begin(lit_col); m_Next=::boost::begin(lit_col);
m_End=::boost::end(lit_col); m_End=::boost::end(lit_col);
// force the correct behavior for empty sequences and yield at least one token increment();
if(m_Next!=m_End)
{
increment();
}
} }

View File

@ -36,7 +36,7 @@ namespace boost {
//! Constant formatter //! Constant formatter
/*! /*!
Constructs a \c const_formatter. Const formatter always returns Construct the \c const_formatter. Const formatter always returns
the same value, regardless of the parameter. the same value, regardless of the parameter.
\param Format A predefined value used as a result for formating \param Format A predefined value used as a result for formating
@ -55,7 +55,7 @@ namespace boost {
//! Identity formatter //! Identity formatter
/*! /*!
Constructs an \c identity_formatter. Identity formatter always returns Construct the \c identity_formatter. Identity formatter always returns
the parameter. the parameter.
\return An instance of the \c identity_formatter object. \return An instance of the \c identity_formatter object.
@ -73,7 +73,7 @@ namespace boost {
//! Empty formatter //! Empty formatter
/*! /*!
Constructs an \c empty_formatter. Empty formatter always returns an empty Construct the \c empty_formatter. Empty formatter always returns an empty
sequence. sequence.
\param Input container used to select a correct value_type for the \param Input container used to select a correct value_type for the
@ -89,22 +89,6 @@ namespace boost {
BOOST_STRING_TYPENAME range_value<RangeT>::type>(); BOOST_STRING_TYPENAME range_value<RangeT>::type>();
} }
//! Empty formatter
/*!
Constructs a \c dissect_formatter. Dissect formatter uses a specified finder
to extract a portion of the formatted sequence. The first finder's match is returned
as a result
\param Finder a finder used to select a portion of the formated sequence
\return An instance of the \c dissect_formatter object.
*/
template<typename FinderT>
inline detail::dissect_formatF< FinderT >
dissect_formatter(const FinderT& Finder)
{
return detail::dissect_formatF<FinderT>(Finder);
}
} // namespace algorithm } // namespace algorithm
@ -112,7 +96,6 @@ namespace boost {
using algorithm::const_formatter; using algorithm::const_formatter;
using algorithm::identity_formatter; using algorithm::identity_formatter;
using algorithm::empty_formatter; using algorithm::empty_formatter;
using algorithm::dissect_formatter;
} // namespace boost } // namespace boost

View File

@ -1,127 +0,0 @@
// Boost string_algo library trim.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_TRIM_ALL_HPP
#define BOOST_STRING_TRIM_ALL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/find_format.hpp>
#include <boost/algorithm/string/formatter.hpp>
#include <boost/algorithm/string/finder.hpp>
#include <locale>
/*! \file
Defines trim_all algorithms.
Just like \c trim, \c trim_all removes all trailing and leading spaces from a
sequence (string). In addition, spaces in the middle of the sequence are truncated
to just one character. Space is recognized using given locales.
Parametric (\c _if) variants use a predicate (functor) to select which characters
are to be trimmed..
Functions take a selection predicate as a parameter, which is used to determine
whether a character is a space. Common predicates are provided in classification.hpp header.
*/
namespace boost {
namespace algorithm {
// multi line trim ----------------------------------------------- //
//! Trim All - parametric
/*!
Remove all leading and trailing spaces from the input and
compress all other spaces to a single space.
The result is a trimmed copy of the input
\param Input An input sequence
\param IsSpace An unary predicate identifying spaces
\return A trimmed copy of the input
*/
template<typename SequenceT, typename PredicateT>
inline SequenceT trim_all_copy_if(const SequenceT& Input, PredicateT IsSpace)
{
return
::boost::find_format_all_copy(
::boost::trim_copy_if(Input, IsSpace),
::boost::token_finder(IsSpace, ::boost::token_compress_on),
::boost::dissect_formatter(::boost::head_finder(1)));
}
//! Trim All
/*!
Remove all leading and trailing spaces from the input and
compress all other spaces to a single space.
The input sequence is modified in-place.
\param Input An input sequence
\param IsSpace An unary predicate identifying spaces
*/
template<typename SequenceT, typename PredicateT>
inline void trim_all_if(SequenceT& Input, PredicateT IsSpace)
{
::boost::trim_if(Input, IsSpace);
::boost::find_format_all(
Input,
::boost::token_finder(IsSpace, ::boost::token_compress_on),
::boost::dissect_formatter(::boost::head_finder(1)));
}
//! Trim All
/*!
Remove all leading and trailing spaces from the input and
compress all other spaces to a single space.
The result is a trimmed copy of the input
\param Input An input sequence
\param Loc A locale used for 'space' classification
\return A trimmed copy of the input
*/
template<typename SequenceT>
inline SequenceT trim_all_copy(const SequenceT& Input, const std::locale& Loc =std::locale())
{
return trim_all_copy_if(Input, ::boost::is_space(Loc));
}
//! Trim All
/*!
Remove all leading and trailing spaces from the input and
compress all other spaces to a single space.
The input sequence is modified in-place.
\param Input An input sequence
\param Loc A locale used for 'space' classification
\return A trimmed copy of the input
*/
template<typename SequenceT>
inline void trim_all(SequenceT& Input, const std::locale& Loc =std::locale())
{
trim_all_if(Input, ::boost::is_space(Loc));
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::trim_all;
using algorithm::trim_all_if;
using algorithm::trim_all_copy;
using algorithm::trim_all_copy_if;
} // namespace boost
#endif // BOOST_STRING_TRIM_ALL_HPP

View File

@ -338,7 +338,7 @@ most</i> instead of <i>exactly</i> in the odd case.
<b>Rationale:</b></h3> <b>Rationale:</b></h3>
<a name="two_headers"> <a name="two_headers">
<h4><b>Why not a single header <tt>&lt;boost/algorithm/minmax.hpp></tt>?</b></h4> <h4><b>Why not a single header <tt>&amp;boost/algorithm/minmax.hpp></tt>?</b></h4>
<p>This was the design originally proposed and approved in the formal <p>This was the design originally proposed and approved in the formal
review. As the need for Boost.tuple became clear (due to the limitations review. As the need for Boost.tuple became clear (due to the limitations
of <tt>std::pair</tt>), it became also annoying to require another of <tt>std::pair</tt>), it became also annoying to require another

View File

@ -43,7 +43,6 @@ doxygen autodoc
[ glob ../../../../boost/algorithm/string/formatter.hpp ] [ glob ../../../../boost/algorithm/string/formatter.hpp ]
[ glob ../../../../boost/algorithm/string/regex.hpp ] [ glob ../../../../boost/algorithm/string/regex.hpp ]
[ glob ../../../../boost/algorithm/string/regex_find_format.hpp ] [ glob ../../../../boost/algorithm/string/regex_find_format.hpp ]
[ glob ../../../../boost/algorithm/string/trim_all.hpp ]
: :
<doxygen:param>HIDE_UNDOC_MEMBERS=YES <doxygen:param>HIDE_UNDOC_MEMBERS=YES
<doxygen:param>EXTRACT_PRIVATE=NO <doxygen:param>EXTRACT_PRIVATE=NO

View File

@ -11,9 +11,6 @@
#include <boost/algorithm/string/erase.hpp> #include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/std/list_traits.hpp> #include <boost/algorithm/string/std/list_traits.hpp>
#include <boost/algorithm/string/std/string_traits.hpp> #include <boost/algorithm/string/std/string_traits.hpp>
#include <boost/algorithm/string/finder.hpp>
#include <boost/algorithm/string/formatter.hpp>
#include <boost/algorithm/string/classification.hpp>
// Include unit test framework // Include unit test framework
#include <boost/test/included/test_exec_monitor.hpp> #include <boost/test/included/test_exec_monitor.hpp>
@ -288,23 +285,6 @@ void collection_comp_test()
} }
} }
void dissect_format_test()
{
BOOST_CHECK(
find_format_all_copy(
string("aBc123Abc"),
first_finder("abc", is_iequal()),
dissect_formatter(token_finder(is_upper())))=="B123A");
BOOST_CHECK(
find_format_all_copy(
string("abc 123 abc"),
token_finder(is_space(), token_compress_on),
dissect_formatter(head_finder(1)))=="abc 123 abc");
}
// test main // test main
int test_main( int, char*[] ) int test_main( int, char*[] )
{ {
@ -317,7 +297,6 @@ int test_main( int, char*[] )
replace_tail_test(); replace_tail_test();
replace_range_test(); replace_range_test();
collection_comp_test(); collection_comp_test();
dissect_format_test();
return 0; return 0;
} }

View File

@ -40,7 +40,6 @@ void iterator_test()
string str1("xx-abc--xx-abb"); string str1("xx-abc--xx-abb");
string str2("Xx-abc--xX-abb-xx"); string str2("Xx-abc--xX-abb-xx");
string str3("xx"); string str3("xx");
string strempty("");
const char* pch1="xx-abc--xx-abb"; const char* pch1="xx-abc--xx-abb";
vector<string> tokens; vector<string> tokens;
vector< vector<int> > vtokens; vector< vector<int> > vtokens;
@ -124,25 +123,6 @@ void iterator_test()
BOOST_CHECK( tokens[3]==string("xx") ); BOOST_CHECK( tokens[3]==string("xx") );
BOOST_CHECK( tokens[4]==string("abb") ); BOOST_CHECK( tokens[4]==string("abb") );
split(
tokens,
str3,
is_any_of(","),
token_compress_off);
BOOST_REQUIRE( tokens.size()==1 );
BOOST_CHECK( tokens[0]==string("xx") );
split(
tokens,
strempty,
is_punct(),
token_compress_off);
BOOST_REQUIRE( tokens.size()==1 );
BOOST_CHECK( tokens[0]==string("") );
find_iterator<string::iterator> fiter=make_find_iterator(str1, first_finder("xx")); find_iterator<string::iterator> fiter=make_find_iterator(str1, first_finder("xx"));
BOOST_CHECK(equals(*fiter, "xx")); BOOST_CHECK(equals(*fiter, "xx"));
++fiter; ++fiter;

View File

@ -8,7 +8,6 @@
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <boost/algorithm/string/trim.hpp> #include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/trim_all.hpp>
// Include unit test framework // Include unit test framework
#include <boost/test/included/test_exec_monitor.hpp> #include <boost/test/included/test_exec_monitor.hpp>
@ -110,52 +109,10 @@ void trim_test()
BOOST_CHECK( trim_copy_if( string("<>abc<>"), is_any_of( "<<>>" ) )=="abc" ); BOOST_CHECK( trim_copy_if( string("<>abc<>"), is_any_of( "<<>>" ) )=="abc" );
} }
void trim_all_test()
{
string str1(" 1x x x x1 ");
string str2("+---...2x+--x--+x-+-x2...---+");
string str3(" ");
// *** value passing tests *** //
// general string test
BOOST_CHECK( trim_all_copy( str1 )=="1x x x x1" ) ;
BOOST_CHECK( trim_all_copy_if( str2, is_punct() )=="2x+x-x-x2" ) ;
// spaces-only string test
BOOST_CHECK( trim_all_copy( str3 )=="" );
// empty string check
BOOST_CHECK( trim_all_copy( string("") )=="" );
// general string test
trim_all( str1 );
BOOST_CHECK( str1=="1x x x x1" ) ;
trim_all_if( str2, is_punct() );
BOOST_CHECK( str2=="2x+x-x-x2" ) ;
// spaces-only string test
str3 = " "; trim_all( str3 );
BOOST_CHECK( str3=="" );
// empty string check
str3 = ""; trim_all( str3 );
BOOST_CHECK( str3=="" );
BOOST_CHECK( str3=="" );
// *** non-standard predicate tests *** //
BOOST_CHECK(
trim_all_copy_if(
string("123abc127deb456"),
is_classified(std::ctype_base::digit) )=="abc1deb" );
BOOST_CHECK( trim_all_copy_if( string("<>abc<>def<>"), is_any_of( "<<>>" ) )=="abc<def" );
}
// test main // test main
int test_main( int, char*[] ) int test_main( int, char*[] )
{ {
trim_test(); trim_test();
trim_all_test();
return 0; return 0;
} }