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 <boost/test/utils/algorithm.hpp>">
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">
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>
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>
25 <div class="refentry">
26 <a name="boost.unit_test.utils.replace__idm45665012161664"></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 — This algorithm replaces all occurrences of a string with basic wildcards with another (optionally containing wildcards as well). </p>
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: <<a class="link" href="../../../header/boost/test/utils/algorithm_hpp.html" title="Header <boost/test/utils/algorithm.hpp>">boost/test/utils/algorithm.hpp</a>>
35 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> StringClass<span class="special">,</span> <span class="keyword">typename</span> ForwardIterator<span class="special">></span>
36 <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>
37 <span class="identifier">ForwardIterator</span> it_string_to_find<span class="special">,</span>
38 <span class="identifier">ForwardIterator</span> it_string_to_find_end<span class="special">,</span>
39 <span class="identifier">ForwardIterator</span> it_string_to_replace<span class="special">,</span>
40 <span class="identifier">ForwardIterator</span> it_string_to_replace_end<span class="special">)</span><span class="special">;</span></pre></div>
41 <div class="refsect1">
42 <a name="idm45734492742608"></a><h2>Description</h2>
44 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>
45 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
46 <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>
47 <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>
51 <div class="variablelist"><table border="0" class="variablelist compact">
53 <col align="left" valign="top">
57 <td><p><span class="term">Parameters:</span></p></td>
58 <td><div class="variablelist"><table border="0" class="variablelist compact">
60 <col align="left" valign="top">
65 <td><p><span class="term"><code class="computeroutput">it_string_to_find</code></span></p></td>
66 <td><p>- iterator to the beginning of the substrings to replace </p></td>
69 <td><p><span class="term"><code class="computeroutput">it_string_to_find_end</code></span></p></td>
70 <td><p>- iterator to the end of the substrings to replace </p></td>
73 <td><p><span class="term"><code class="computeroutput">it_string_to_replace</code></span></p></td>
74 <td><p>- iterator to the beginning of the substrings to replace with </p></td>
77 <td><p><span class="term"><code class="computeroutput">it_string_to_replace_end</code></span></p></td>
78 <td><p>- iterator to the end of the substrings to replace with</p></td>
81 <td><p><span class="term"><code class="computeroutput">str</code></span></p></td>
82 <td><p>- string to transform </p></td>
90 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
91 <td align="left"></td>
92 <td align="right"><div class="copyright-footer">Copyright © 2001-2018 Boost.Test 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>)
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>