replace__idm46279112313504.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Function template replace_all_occurrences_with_wildcards</title>
  5. <link rel="stylesheet" href="../../../boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../../../index.html" title="Boost.Test">
  8. <link rel="up" href="../../../header/boost/test/utils/algorithm_hpp.html" title="Header &lt;boost/test/utils/algorithm.hpp&gt;">
  9. <link rel="prev" href="replace_all_occurrences_of.html" title="Function template replace_all_occurrences_of">
  10. <link rel="next" href="../../../BOOST_TEST_BIND1ST.html" title="Macro BOOST_TEST_BIND1ST">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="replace_all_occurrences_of.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/test/utils/algorithm_hpp.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../BOOST_TEST_BIND1ST.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="refentry">
  26. <a name="boost.unit_test.utils.replace__idm46279112313504"></a><div class="titlepage"></div>
  27. <div class="refnamediv">
  28. <h2><span class="refentrytitle">Function template replace_all_occurrences_with_wildcards</span></h2>
  29. <p>boost::unit_test::utils::replace_all_occurrences_with_wildcards &#8212; This algorithm replaces all occurrences of a string with basic wildcards with another (optionally containing wildcards as well). </p>
  30. </div>
  31. <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
  32. <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../header/boost/test/utils/algorithm_hpp.html" title="Header &lt;boost/test/utils/algorithm.hpp&gt;">boost/test/utils/algorithm.hpp</a>&gt;
  33. </span>
  34. <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> StringClass<span class="special">,</span> <span class="keyword">typename</span> ForwardIterator<span class="special">&gt;</span>
  35. <span class="identifier">StringClass</span> <span class="identifier">replace_all_occurrences_with_wildcards</span><span class="special">(</span><span class="identifier">StringClass</span> str<span class="special">,</span>
  36. <span class="identifier">ForwardIterator</span> it_string_to_find<span class="special">,</span>
  37. <span class="identifier">ForwardIterator</span> it_string_to_find_end<span class="special">,</span>
  38. <span class="identifier">ForwardIterator</span> it_string_to_replace<span class="special">,</span>
  39. <span class="identifier">ForwardIterator</span> it_string_to_replace_end<span class="special">)</span><span class="special">;</span></pre></div>
  40. <div class="refsect1">
  41. <a name="idm45313882530896"></a><h2>Description</h2>
  42. <p>
  43. The wildcard is the symbol '*'. Only a unique wildcard per string is supported. The replacement string may also contain a wildcard, in which case it is considered as a placeholder to the content of the wildcard in the source string. Example:</p>
  44. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  45. <li class="listitem"><p>In order to replace the occurrences of <code class="computeroutput">'time="some-variable-value"'</code> to a constant string, one may use <code class="computeroutput">'time="*"'</code> as the string to search for, and 'time="0.0"' as the replacement string.</p></li>
  46. <li class="listitem"><p>In order to replace the occurrences of 'file.cpp(XX)' per 'file.cpp:XX', where XX is a variable to keep, on may use <code class="computeroutput">'file.cpp(*)'</code> as the string to search for, and 'file.cpp:*' as the replacement string. </p></li>
  47. </ul></div>
  48. <p>
  49. </p>
  50. <div class="variablelist"><table border="0" class="variablelist compact">
  51. <colgroup>
  52. <col align="left" valign="top">
  53. <col>
  54. </colgroup>
  55. <tbody><tr>
  56. <td><p><span class="term">Parameters:</span></p></td>
  57. <td><div class="variablelist"><table border="0" class="variablelist compact">
  58. <colgroup>
  59. <col align="left" valign="top">
  60. <col>
  61. </colgroup>
  62. <tbody>
  63. <tr>
  64. <td><p><span class="term"><code class="computeroutput">it_string_to_find</code></span></p></td>
  65. <td><p>- iterator to the beginning of the substrings to replace </p></td>
  66. </tr>
  67. <tr>
  68. <td><p><span class="term"><code class="computeroutput">it_string_to_find_end</code></span></p></td>
  69. <td><p>- iterator to the end of the substrings to replace </p></td>
  70. </tr>
  71. <tr>
  72. <td><p><span class="term"><code class="computeroutput">it_string_to_replace</code></span></p></td>
  73. <td><p>- iterator to the beginning of the substrings to replace with </p></td>
  74. </tr>
  75. <tr>
  76. <td><p><span class="term"><code class="computeroutput">it_string_to_replace_end</code></span></p></td>
  77. <td><p>- iterator to the end of the substrings to replace with</p></td>
  78. </tr>
  79. <tr>
  80. <td><p><span class="term"><code class="computeroutput">str</code></span></p></td>
  81. <td><p>- string to transform </p></td>
  82. </tr>
  83. </tbody>
  84. </table></div></td>
  85. </tr></tbody>
  86. </table></div>
  87. </div>
  88. </div>
  89. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  90. <td align="left"></td>
  91. <td align="right"><div class="copyright-footer">Copyright &#169; 2001-2019 Boost.Test
  92. contributors<p>
  93. Distributed under the Boost Software License, Version 1.0. (See accompanying
  94. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  95. </p>
  96. </div></td>
  97. </tr></table>
  98. <hr>
  99. <div class="spirit-nav">
  100. <a accesskey="p" href="replace_all_occurrences_of.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/test/utils/algorithm_hpp.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../BOOST_TEST_BIND1ST.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
  101. </div>
  102. </body>
  103. </html>