| 1 | /* |
|---|
| 2 | * |
|---|
| 3 | * Copyright (c) 1998-2002 |
|---|
| 4 | * John Maddock |
|---|
| 5 | * |
|---|
| 6 | * Use, modification and distribution are subject to the |
|---|
| 7 | * Boost Software License, Version 1.0. (See accompanying file |
|---|
| 8 | * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 9 | * |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | /* |
|---|
| 13 | * LOCATION: see http://www.boost.org for most recent version. |
|---|
| 14 | * FILE regex_format.hpp |
|---|
| 15 | * VERSION see <boost/version.hpp> |
|---|
| 16 | * DESCRIPTION: Provides formatting output routines for search and replace |
|---|
| 17 | * operations. Note this is an internal header file included |
|---|
| 18 | * by regex.hpp, do not include on its own. |
|---|
| 19 | */ |
|---|
| 20 | |
|---|
| 21 | #ifndef BOOST_REGEX_V4_REGEX_MERGE_HPP |
|---|
| 22 | #define BOOST_REGEX_V4_REGEX_MERGE_HPP |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | namespace boost{ |
|---|
| 26 | |
|---|
| 27 | #ifdef BOOST_HAS_ABI_HEADERS |
|---|
| 28 | # include BOOST_ABI_PREFIX |
|---|
| 29 | #endif |
|---|
| 30 | |
|---|
| 31 | template <class OutputIterator, class Iterator, class traits, class charT> |
|---|
| 32 | inline OutputIterator regex_merge(OutputIterator out, |
|---|
| 33 | Iterator first, |
|---|
| 34 | Iterator last, |
|---|
| 35 | const basic_regex<charT, traits>& e, |
|---|
| 36 | const charT* fmt, |
|---|
| 37 | match_flag_type flags = match_default) |
|---|
| 38 | { |
|---|
| 39 | return regex_replace(out, first, last, e, fmt, flags); |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | template <class OutputIterator, class Iterator, class traits, class charT> |
|---|
| 43 | inline OutputIterator regex_merge(OutputIterator out, |
|---|
| 44 | Iterator first, |
|---|
| 45 | Iterator last, |
|---|
| 46 | const basic_regex<charT, traits>& e, |
|---|
| 47 | const std::basic_string<charT>& fmt, |
|---|
| 48 | match_flag_type flags = match_default) |
|---|
| 49 | { |
|---|
| 50 | return regex_merge(out, first, last, e, fmt.c_str(), flags); |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | template <class traits, class charT> |
|---|
| 54 | inline std::basic_string<charT> regex_merge(const std::basic_string<charT>& s, |
|---|
| 55 | const basic_regex<charT, traits>& e, |
|---|
| 56 | const charT* fmt, |
|---|
| 57 | match_flag_type flags = match_default) |
|---|
| 58 | { |
|---|
| 59 | return regex_replace(s, e, fmt, flags); |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | template <class traits, class charT> |
|---|
| 63 | inline std::basic_string<charT> regex_merge(const std::basic_string<charT>& s, |
|---|
| 64 | const basic_regex<charT, traits>& e, |
|---|
| 65 | const std::basic_string<charT>& fmt, |
|---|
| 66 | match_flag_type flags = match_default) |
|---|
| 67 | { |
|---|
| 68 | return regex_replace(s, e, fmt, flags); |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | #ifdef BOOST_HAS_ABI_HEADERS |
|---|
| 72 | # include BOOST_ABI_SUFFIX |
|---|
| 73 | #endif |
|---|
| 74 | |
|---|
| 75 | } // namespace boost |
|---|
| 76 | |
|---|
| 77 | #endif // BOOST_REGEX_V4_REGEX_MERGE_HPP |
|---|
| 78 | |
|---|
| 79 | |
|---|