1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #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_core.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:
-
-
- BOOST_DEFAULTED_FUNCTION(find_iterator_base(), {})
-
- BOOST_DEFAULTED_FUNCTION(find_iterator_base( const find_iterator_base& Other ), :
- m_Finder(Other.m_Finder) {}
- )
-
- BOOST_DEFAULTED_FUNCTION(find_iterator_base& operator=( const find_iterator_base& Other ), {
- m_Finder = Other.m_Finder;
- return *this;
- })
-
-
- template<typename FinderT>
- find_iterator_base( FinderT Finder, int ) :
- m_Finder(Finder) {}
-
- BOOST_DEFAULTED_FUNCTION(~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
|