123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #ifndef BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
- #define BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
- #include <boost/algorithm/string/config.hpp>
- #include <boost/range/iterator_range.hpp>
- #include <boost/iterator/iterator_facade.hpp>
- #include <boost/iterator/iterator_categories.hpp>
- #include <boost/function.hpp>
- namespace boost {
- namespace algorithm {
- namespace detail {
-
- template<typename IteratorT>
- class find_iterator_base
- {
- protected:
-
- typedef IteratorT input_iterator_type;
- typedef iterator_range<IteratorT> match_type;
- typedef function2<
- match_type,
- input_iterator_type,
- input_iterator_type> finder_type;
-
- protected:
-
-
- find_iterator_base() {};
-
- find_iterator_base( const find_iterator_base& Other ) :
- m_Finder(Other.m_Finder) {}
-
-
- template<typename FinderT>
- find_iterator_base( FinderT Finder, int ) :
- m_Finder(Finder) {}
-
- ~find_iterator_base() {}
-
- match_type do_find(
- input_iterator_type Begin,
- input_iterator_type End ) const
- {
- if (!m_Finder.empty())
- {
- return m_Finder(Begin,End);
- }
- else
- {
- return match_type(End,End);
- }
- }
-
- bool is_null() const
- {
- return m_Finder.empty();
- }
- private:
-
- finder_type m_Finder;
- };
- }
- }
- }
- #endif
|