1 // Boost string_algo library find_iterator.hpp header file ---------------------------//
3 // Copyright Pavol Droba 2002-2003.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/ for updates, documentation, and revision history.
11 #ifndef BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
12 #define BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
14 #include <boost/algorithm/string/config.hpp>
15 #include <boost/range/iterator_range.hpp>
16 #include <boost/iterator/iterator_facade.hpp>
17 #include <boost/iterator/iterator_categories.hpp>
18 #include <boost/function.hpp>
24 // find_iterator base -----------------------------------------------//
27 template<typename IteratorT>
28 class find_iterator_base
32 typedef IteratorT input_iterator_type;
33 typedef iterator_range<IteratorT> match_type;
37 input_iterator_type> finder_type;
40 // Protected construction/destruction
42 // Default constructor
43 find_iterator_base() {};
45 find_iterator_base( const find_iterator_base& Other ) :
46 m_Finder(Other.m_Finder) {}
49 template<typename FinderT>
50 find_iterator_base( FinderT Finder, int ) :
54 ~find_iterator_base() {}
58 input_iterator_type Begin,
59 input_iterator_type End ) const
61 if (!m_Finder.empty())
63 return m_Finder(Begin,End);
67 return match_type(End,End);
74 return m_Finder.empty();
83 } // namespace algorithm
87 #endif // BOOST_STRING_FIND_ITERATOR_DETAIL_HPP