123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #ifndef BOOST_STRING_FORMATTER_DETAIL_HPP
- #define BOOST_STRING_FORMATTER_DETAIL_HPP
- #include <boost/range/iterator_range_core.hpp>
- #include <boost/range/begin.hpp>
- #include <boost/range/end.hpp>
- #include <boost/range/const_iterator.hpp>
- #include <boost/algorithm/string/detail/util.hpp>
- namespace boost {
- namespace algorithm {
- namespace detail {
-
- template<typename RangeT>
- struct const_formatF
- {
- private:
- typedef BOOST_STRING_TYPENAME
- range_const_iterator<RangeT>::type format_iterator;
- typedef iterator_range<format_iterator> result_type;
-
- public:
-
- const_formatF(const RangeT& Format) :
- m_Format(::boost::begin(Format), ::boost::end(Format)) {}
-
- #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
- template<typename Range2T>
- result_type& operator()(const Range2T&)
- {
- return m_Format;
- }
- #endif
- template<typename Range2T>
- const result_type& operator()(const Range2T&) const
- {
- return m_Format;
- }
- private:
- result_type m_Format;
- };
-
- template<typename RangeT>
- struct identity_formatF
- {
-
- template< typename Range2T >
- const RangeT& operator()(const Range2T& Replace) const
- {
- return RangeT(::boost::begin(Replace), ::boost::end(Replace));
- }
- };
-
-
- template< typename CharT >
- struct empty_formatF
- {
- template< typename ReplaceT >
- empty_container<CharT> operator()(const ReplaceT&) const
- {
- return empty_container<CharT>();
- }
- };
-
- template<typename FinderT>
- struct dissect_formatF
- {
- public:
-
- dissect_formatF(FinderT Finder) :
- m_Finder(Finder) {}
-
- template<typename RangeT>
- inline iterator_range<
- BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
- operator()(const RangeT& Replace) const
- {
- return m_Finder(::boost::begin(Replace), ::boost::end(Replace));
- }
- private:
- FinderT m_Finder;
- };
- }
- }
- }
- #endif
|