1 // Boost string_algo library formatter_regex.hpp header file ---------------------------//
3 // Copyright Pavol Droba 2002-2003.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/ for updates, documentation, and revision history.
11 #ifndef BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP
12 #define BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP
14 #include <boost/algorithm/string/config.hpp>
16 #include <boost/regex.hpp>
17 #include <boost/algorithm/string/detail/finder_regex.hpp>
23 // regex format functor -----------------------------------------//
25 // regex format functor
26 template<typename StringT>
30 typedef StringT result_type;
31 typedef BOOST_STRING_TYPENAME StringT::value_type char_type;
35 regex_formatF( const StringT& Fmt, match_flag_type Flags=format_default ) :
36 m_Fmt(Fmt), m_Flags( Flags ) {}
38 template<typename InputIteratorT>
39 result_type operator()(
40 const regex_search_result<InputIteratorT>& Replace ) const
42 if ( Replace.empty() )
48 return Replace.match_results().format( m_Fmt, m_Flags );
53 match_flag_type m_Flags;
58 } // namespace algorithm
61 #endif // BOOST_STRING_FORMATTER_DETAIL_HPP