forked from boostorg/algorithm
Compare commits
1 Commits
boost-1.46
...
boost-1.45
Author | SHA1 | Date | |
---|---|---|---|
c7ac93e745 |
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Reference in New Issue
Block a user