12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP
- #define BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP
- #include <boost/algorithm/string/config.hpp>
- #include <string>
- #include <boost/regex.hpp>
- #include <boost/algorithm/string/detail/finder_regex.hpp>
- namespace boost {
- namespace algorithm {
- namespace detail {
-
- template<typename StringT>
- struct regex_formatF
- {
- private:
- typedef StringT result_type;
- typedef BOOST_STRING_TYPENAME StringT::value_type char_type;
- public:
-
- regex_formatF( const StringT& Fmt, match_flag_type Flags=format_default ) :
- m_Fmt(Fmt), m_Flags( Flags ) {}
- template<typename InputIteratorT>
- result_type operator()(
- const regex_search_result<InputIteratorT>& Replace ) const
- {
- if ( Replace.empty() )
- {
- return result_type();
- }
- else
- {
- return Replace.match_results().format( m_Fmt, m_Flags );
- }
- }
- private:
- const StringT& m_Fmt;
- match_flag_type m_Flags;
- };
-
- }
- }
- }
- #endif
|