File indexing completed on 2025-01-18 09:28:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_STRING_FORMATTER_DETAIL_HPP
0012 #define BOOST_STRING_FORMATTER_DETAIL_HPP
0013
0014
0015 #include <boost/range/iterator_range_core.hpp>
0016 #include <boost/range/begin.hpp>
0017 #include <boost/range/end.hpp>
0018 #include <boost/range/const_iterator.hpp>
0019
0020 #include <boost/algorithm/string/detail/util.hpp>
0021
0022
0023
0024 namespace boost {
0025 namespace algorithm {
0026 namespace detail {
0027
0028
0029
0030
0031 template<typename RangeT>
0032 struct const_formatF
0033 {
0034 private:
0035 typedef BOOST_STRING_TYPENAME
0036 range_const_iterator<RangeT>::type format_iterator;
0037 typedef iterator_range<format_iterator> result_type;
0038
0039 public:
0040
0041 const_formatF(const RangeT& Format) :
0042 m_Format(::boost::begin(Format), ::boost::end(Format)) {}
0043
0044
0045 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0046 template<typename Range2T>
0047 result_type& operator()(const Range2T&)
0048 {
0049 return m_Format;
0050 }
0051 #endif
0052
0053 template<typename Range2T>
0054 const result_type& operator()(const Range2T&) const
0055 {
0056 return m_Format;
0057 }
0058
0059 private:
0060 result_type m_Format;
0061 };
0062
0063
0064
0065
0066 template<typename RangeT>
0067 struct identity_formatF
0068 {
0069
0070 template< typename Range2T >
0071 const RangeT& operator()(const Range2T& Replace) const
0072 {
0073 return RangeT(::boost::begin(Replace), ::boost::end(Replace));
0074 }
0075 };
0076
0077
0078
0079
0080 template< typename CharT >
0081 struct empty_formatF
0082 {
0083 template< typename ReplaceT >
0084 empty_container<CharT> operator()(const ReplaceT&) const
0085 {
0086 return empty_container<CharT>();
0087 }
0088 };
0089
0090
0091
0092
0093 template<typename FinderT>
0094 struct dissect_formatF
0095 {
0096 public:
0097
0098 dissect_formatF(FinderT Finder) :
0099 m_Finder(Finder) {}
0100
0101
0102 template<typename RangeT>
0103 inline iterator_range<
0104 BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
0105 operator()(const RangeT& Replace) const
0106 {
0107 return m_Finder(::boost::begin(Replace), ::boost::end(Replace));
0108 }
0109
0110 private:
0111 FinderT m_Finder;
0112 };
0113
0114
0115 }
0116 }
0117 }
0118
0119 #endif