Library adapted to use official version Boost.Range instead of the internal one.

Internal version removed


[SVN r26788]
This commit is contained in:
Pavol Droba
2005-01-21 16:49:06 +00:00
parent aea6f39c11
commit 2b5de80031
6 changed files with 28 additions and 169 deletions

View File

@ -17,27 +17,27 @@ doxygen autodoc
[ glob ../../../../boost/algorithm/string.hpp ] [ glob ../../../../boost/algorithm/string.hpp ]
[ glob ../../../../boost/algorithm/string_regex.hpp ] [ glob ../../../../boost/algorithm/string_regex.hpp ]
[ glob ../../../../boost/algorithm/string/classification.hpp ] # [ glob ../../../../boost/algorithm/string/classification.hpp ]
[ glob ../../../../boost/algorithm/string/iterator_range.hpp ] # [ glob ../../../../boost/algorithm/string/iterator_range.hpp ]
[ glob ../../../../boost/algorithm/string/sequence_traits.hpp ] # [ glob ../../../../boost/algorithm/string/sequence_traits.hpp ]
[ glob ../../../../boost/algorithm/string/std_containers_traits.hpp ] # [ glob ../../../../boost/algorithm/string/std_containers_traits.hpp ]
[ glob ../../../../boost/algorithm/string/collection_traits.hpp ] # [ glob ../../../../boost/algorithm/string/collection_traits.hpp ]
[ glob ../../../../boost/algorithm/string/concept.hpp ] # [ glob ../../../../boost/algorithm/string/concept.hpp ]
[ glob ../../../../boost/algorithm/string/compare.hpp ] # [ glob ../../../../boost/algorithm/string/compare.hpp ]
[ glob ../../../../boost/algorithm/string/constants.hpp ] # [ glob ../../../../boost/algorithm/string/constants.hpp ]
[ glob ../../../../boost/algorithm/string/case_conv.hpp ] # [ glob ../../../../boost/algorithm/string/case_conv.hpp ]
[ glob ../../../../boost/algorithm/string/find.hpp ] # [ glob ../../../../boost/algorithm/string/find.hpp ]
[ glob ../../../../boost/algorithm/string/finder.hpp ] # [ glob ../../../../boost/algorithm/string/finder.hpp ]
[ glob ../../../../boost/algorithm/string/find_iterator.hpp ] # [ glob ../../../../boost/algorithm/string/find_iterator.hpp ]
[ glob ../../../../boost/algorithm/string/trim.hpp ] # [ glob ../../../../boost/algorithm/string/trim.hpp ]
[ glob ../../../../boost/algorithm/string/predicate.hpp ] # [ glob ../../../../boost/algorithm/string/predicate.hpp ]
[ glob ../../../../boost/algorithm/string/split.hpp ] # [ glob ../../../../boost/algorithm/string/split.hpp ]
[ glob ../../../../boost/algorithm/string/erase.hpp ] # [ glob ../../../../boost/algorithm/string/erase.hpp ]
[ glob ../../../../boost/algorithm/string/replace.hpp ] # [ glob ../../../../boost/algorithm/string/replace.hpp ]
[ glob ../../../../boost/algorithm/string/find_format.hpp ] # [ glob ../../../../boost/algorithm/string/find_format.hpp ]
[ 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 ]
: :
<doxygen:param>HIDE_UNDOC_MEMBERS=YES <doxygen:param>HIDE_UNDOC_MEMBERS=YES
<doxygen:param>EXTRACT_PRIVATE=NO <doxygen:param>EXTRACT_PRIVATE=NO

View File

@ -10,9 +10,10 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
#include <boost/algorithm/string/replace.hpp> //#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/erase.hpp> //#include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/case_conv.hpp> //#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string.hpp>
//Following two includes contain second-layer function. //Following two includes contain second-layer function.
//They are already included by first-layer header //They are already included by first-layer header

View File

@ -12,7 +12,6 @@
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
#include <functional> #include <functional>
#include <boost/algorithm/string/iterator_range.hpp>
#include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/find_iterator.hpp> #include <boost/algorithm/string/find_iterator.hpp>
@ -36,7 +35,7 @@ int main()
It!=string_find_iterator(); It!=string_find_iterator();
++It) ++It)
{ {
cout << copy_iterator_range<std::string>(*It) << endl; cout << copy_range<std::string>(*It) << endl;
// shift all chars in the match by one // shift all chars in the match by one
transform( transform(
It->begin(), It->end(), It->begin(), It->end(),

View File

@ -17,15 +17,7 @@ DEPENDS all : test ;
{ {
test-suite algorithm/string test-suite algorithm/string
: [ run : [ run
container_test.cpp
: :
:
std::locale-support
std::facet-support
: container
]
[ run
trim_test.cpp trim_test.cpp
: : : :
: :

View File

@ -10,13 +10,7 @@
import testing ; import testing ;
test-suite algorithm/string test-suite algorithm/string
: [ run : [ run
container_test.cpp
: :
:
: container
]
[ run
trim_test.cpp trim_test.cpp
: : : :
: :

View File

@ -1,127 +0,0 @@
// Boost string_algo library substr_test.cpp file ------------------//
// Copyright Pavol Droba 2002-2003. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/algorithm/string/collection_traits.hpp>
// equals predicate is used for result comparison
#include <boost/algorithm/string/predicate.hpp>
// Include unit test framework
#include <boost/test/included/test_exec_monitor.hpp>
#include <string>
#include <utility>
#include <vector>
#include <boost/type_traits.hpp>
// test tools
#include <boost/test/test_tools.hpp>
using namespace std;
using namespace boost;
namespace algo = ::boost::algorithm;
template< typename T >
void argument_cv_test( const T& C, const string& strResult )
{
BOOST_CHECK( equals( make_iterator_range(algo::begin(C),algo::end(C)), strResult ) );
BOOST_CHECK( algo::size(C)==strResult.size() );
BOOST_CHECK( algo::empty(C)==strResult.empty() );
}
template< typename T >
void argument_test( T& C, const string& strResult )
{
BOOST_CHECK( equals( make_iterator_range(algo::begin(C),algo::end(C)), strResult ) );
BOOST_CHECK( algo::size(C)==strResult.size() );
BOOST_CHECK( algo::empty(C)==strResult.empty() );
}
void container_test()
{
BOOST_CHECKPOINT( "type test" );
// types test
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<string>::type,
string::iterator>::value) );
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<const string>::type,
string::const_iterator>::value) );
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<char[4]>::type, char*>::value) );
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<const char[4]>::type,
const char*>::value) );
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<char*>::type, char*>::value) );
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<const char*>::type,
const char*>::value) );
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<
pair<string::iterator, string::iterator> >::type, string::iterator>::value) );
BOOST_REQUIRE( (is_same<
algo::result_iterator_of<
const pair<string::iterator, string::iterator> >::type,
string::iterator>::value) );
BOOST_CHECKPOINT( "non-empty sequence test" );
string str1("abc");
vector<char> vec1( str1.begin(), str1.end() );
pair<string::iterator, string::iterator> pair1=
make_pair( str1.begin(), str1.end() );
char ach1[]="abc";
char *pch1="abc";
// begin/end tests
argument_cv_test( str1, "abc" );
argument_test( str1, "abc" );
argument_cv_test( vec1, "abc" );
argument_test( vec1, "abc" );
argument_cv_test( pair1, "abc" );
argument_test( pair1, "abc" );
argument_cv_test( ach1, "abc" );
argument_test( ach1, "abc" );
argument_cv_test( pch1, "abc" );
argument_test( pch1, "abc" );
BOOST_CHECKPOINT( "empty sequence test" );
string str2;
vector<char> vec2( str2.begin(), str2.end() );
pair<string::iterator, string::iterator> pair2=
make_pair( str2.begin(), str2.end() );
char ach2[]="";
char *pch2=0;
// begin/end tests
argument_cv_test( str2, "" );
argument_test( str2, "" );
argument_cv_test( vec2, "" );
argument_test( vec2, "" );
argument_cv_test( pair2, "" );
argument_test( pair2, "" );
argument_cv_test( ach2, "" );
argument_test( ach2, "" );
argument_cv_test( pch2, "" );
argument_test( pch2, "" );
};
// test main
int test_main( int, char*[] )
{
container_test();
return 0;
}