File indexing completed on 2025-12-17 09:38:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP
0012 #define BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP
0013
0014 #include <boost/algorithm/string/config.hpp>
0015 #include <string>
0016 #include <boost/regex.hpp>
0017 #include <boost/algorithm/string/detail/finder_regex.hpp>
0018
0019 namespace boost {
0020 namespace algorithm {
0021 namespace detail {
0022
0023
0024
0025
0026 template<typename StringT>
0027 struct regex_formatF
0028 {
0029 private:
0030 typedef StringT result_type;
0031 typedef BOOST_STRING_TYPENAME StringT::value_type char_type;
0032
0033 public:
0034
0035 regex_formatF( const StringT& Fmt, match_flag_type Flags=format_default ) :
0036 m_Fmt(Fmt), m_Flags( Flags ) {}
0037
0038 template<typename InputIteratorT>
0039 result_type operator()(
0040 const regex_search_result<InputIteratorT>& Replace ) const
0041 {
0042 if ( Replace.empty() )
0043 {
0044 return result_type();
0045 }
0046 else
0047 {
0048 return Replace.match_results().format( m_Fmt, m_Flags );
0049 }
0050 }
0051 private:
0052 const StringT& m_Fmt;
0053 match_flag_type m_Flags;
0054 };
0055
0056
0057 }
0058 }
0059 }
0060
0061 #endif