Changed to use new iterator typedefs.

[SVN r21161]
This commit is contained in:
John Maddock
2003-12-06 12:11:49 +00:00
parent f6b9c3d809
commit 207b0c63cd
7 changed files with 28 additions and 36 deletions

View File

@ -396,9 +396,9 @@ map_type class_index;
load_file(text, fs);
<i><font color=
#000080>// construct our iterators:</font></i>
boost::regex_iterator&lt;std::string::const_iterator&gt; m1(text.begin(), text.end(), expression);
boost::regex_iterator&lt;std::string::const_iterator&gt; m2;
std::for_each(m1, m2, <EFBFBD>ex_callback);
boost::sregex_iterator m1(text.begin(), text.end(), expression);
boost::sregex_iterator m2;
std::for_each(m1, m2, &amp;regex_callback);
<i><font color="#000080">// copy results:</font></i>
cout &lt;&lt; class_index.size() &lt;&lt; <font color=
#0000ff>" matches found"</font> &lt;&lt; endl;
@ -424,8 +424,7 @@ color=
24 Oct 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright John Maddock&nbsp;1998-
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<P><I>Use, modification and distribution are subject to the Boost Software License,
Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A>
or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>

View File

@ -191,8 +191,8 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
s = <FONT color=#0000ff>"This is a string of tokens"</FONT>;
boost::regex re(<FONT color=#0000ff>"\\s+"</FONT>);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; i(s.begin(), s.end(), re, -<FONT color=#0000a0>1</FONT>);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; j;
boost::sregex_token_iterator i(s.begin(), s.end(), re, -<FONT color=#0000a0>1</FONT>);
boost::sregex_token_iterator j;
<B>unsigned</B> count = <FONT color=#0000a0>0</FONT>;
<B>while</B>(i != j)
@ -246,9 +246,8 @@ boost::regex e(<FONT color=#0000ff>"&lt;\\s*A\\s+[^&gt;]*href\\s*=\\s*\"([^\"]*)
s.erase();
std::ifstream is(argv[i]);
load_file(s, is);
boost::regex_token_iterator&lt;std::string::const_iterator&gt;
i(s.begin(), s.end(), e, <FONT color=#0000a0>1</FONT>);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; j;
boost::sregex_token_iterator i(s.begin(), s.end(), e, <FONT color=#0000a0>1</FONT>);
boost::sregex_token_iterator j;
<B>while</B>(i != j)
{
std::cout &lt;&lt; *i++ &lt;&lt; std::endl;
@ -266,9 +265,8 @@ boost::regex e(<FONT color=#0000ff>"&lt;\\s*A\\s+[^&gt;]*href\\s*=\\s*\"([^\"]*)
std::ifstream is(argv[i]);
load_file(s, is);
<B>const</B> <B>int</B> subs[] = {<FONT color=#0000a0>1</FONT>, <FONT color=#0000a0>0</FONT>,};
boost::regex_token_iterator&lt;std::string::const_iterator&gt;
i(s.begin(), s.end(), e, subs);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; j;
boost::sregex_token_iterator i(s.begin(), s.end(), e, subs);
boost::sregex_token_iterator j;
<B>while</B>(i != j)
{
std::cout &lt;&lt; *i++ &lt;&lt; std::endl;

View File

@ -396,9 +396,9 @@ map_type class_index;
load_file(text, fs);
<i><font color=
#000080>// construct our iterators:</font></i>
boost::regex_iterator&lt;std::string::const_iterator&gt; m1(text.begin(), text.end(), expression);
boost::regex_iterator&lt;std::string::const_iterator&gt; m2;
std::for_each(m1, m2, <EFBFBD>ex_callback);
boost::sregex_iterator m1(text.begin(), text.end(), expression);
boost::sregex_iterator m2;
std::for_each(m1, m2, &amp;regex_callback);
<i><font color="#000080">// copy results:</font></i>
cout &lt;&lt; class_index.size() &lt;&lt; <font color=
#0000ff>" matches found"</font> &lt;&lt; endl;
@ -424,8 +424,7 @@ color=
24 Oct 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright John Maddock&nbsp;1998-
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<P><I>Use, modification and distribution are subject to the Boost Software License,
Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A>
or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>

View File

@ -191,8 +191,8 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
s = <FONT color=#0000ff>"This is a string of tokens"</FONT>;
boost::regex re(<FONT color=#0000ff>"\\s+"</FONT>);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; i(s.begin(), s.end(), re, -<FONT color=#0000a0>1</FONT>);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; j;
boost::sregex_token_iterator i(s.begin(), s.end(), re, -<FONT color=#0000a0>1</FONT>);
boost::sregex_token_iterator j;
<B>unsigned</B> count = <FONT color=#0000a0>0</FONT>;
<B>while</B>(i != j)
@ -246,9 +246,8 @@ boost::regex e(<FONT color=#0000ff>"&lt;\\s*A\\s+[^&gt;]*href\\s*=\\s*\"([^\"]*)
s.erase();
std::ifstream is(argv[i]);
load_file(s, is);
boost::regex_token_iterator&lt;std::string::const_iterator&gt;
i(s.begin(), s.end(), e, <FONT color=#0000a0>1</FONT>);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; j;
boost::sregex_token_iterator i(s.begin(), s.end(), e, <FONT color=#0000a0>1</FONT>);
boost::sregex_token_iterator j;
<B>while</B>(i != j)
{
std::cout &lt;&lt; *i++ &lt;&lt; std::endl;
@ -266,9 +265,8 @@ boost::regex e(<FONT color=#0000ff>"&lt;\\s*A\\s+[^&gt;]*href\\s*=\\s*\"([^\"]*)
std::ifstream is(argv[i]);
load_file(s, is);
<B>const</B> <B>int</B> subs[] = {<FONT color=#0000a0>1</FONT>, <FONT color=#0000a0>0</FONT>,};
boost::regex_token_iterator&lt;std::string::const_iterator&gt;
i(s.begin(), s.end(), e, subs);
boost::regex_token_iterator&lt;std::string::const_iterator&gt; j;
boost::sregex_token_iterator i(s.begin(), s.end(), e, subs);
boost::sregex_token_iterator j;
<B>while</B>(i != j)
{
std::cout &lt;&lt; *i++ &lt;&lt; std::endl;