regex_merge.hpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. * LOCATION: see http://www.boost.org for most recent version.
  13. * FILE regex_format.hpp
  14. * VERSION see <boost/version.hpp>
  15. * DESCRIPTION: Provides formatting output routines for search and replace
  16. * operations. Note this is an internal header file included
  17. * by regex.hpp, do not include on its own.
  18. */
  19. #ifndef BOOST_REGEX_V5_REGEX_MERGE_HPP
  20. #define BOOST_REGEX_V5_REGEX_MERGE_HPP
  21. namespace boost{
  22. template <class OutputIterator, class Iterator, class traits, class charT>
  23. inline OutputIterator regex_merge(OutputIterator out,
  24. Iterator first,
  25. Iterator last,
  26. const basic_regex<charT, traits>& e,
  27. const charT* fmt,
  28. match_flag_type flags = match_default)
  29. {
  30. return regex_replace(out, first, last, e, fmt, flags);
  31. }
  32. template <class OutputIterator, class Iterator, class traits, class charT>
  33. inline OutputIterator regex_merge(OutputIterator out,
  34. Iterator first,
  35. Iterator last,
  36. const basic_regex<charT, traits>& e,
  37. const std::basic_string<charT>& fmt,
  38. match_flag_type flags = match_default)
  39. {
  40. return regex_merge(out, first, last, e, fmt.c_str(), flags);
  41. }
  42. template <class traits, class charT>
  43. inline std::basic_string<charT> regex_merge(const std::basic_string<charT>& s,
  44. const basic_regex<charT, traits>& e,
  45. const charT* fmt,
  46. match_flag_type flags = match_default)
  47. {
  48. return regex_replace(s, e, fmt, flags);
  49. }
  50. template <class traits, class charT>
  51. inline std::basic_string<charT> regex_merge(const std::basic_string<charT>& s,
  52. const basic_regex<charT, traits>& e,
  53. const std::basic_string<charT>& fmt,
  54. match_flag_type flags = match_default)
  55. {
  56. return regex_replace(s, e, fmt, flags);
  57. }
  58. } // namespace boost
  59. #endif // BOOST_REGEX_V5_REGEX_MERGE_HPP