Boost logo

Boost-Commit :

From: technews_at_[hidden]
Date: 2008-05-28 13:52:41


Author: turkanis
Date: 2008-05-28 13:52:41 EDT (Wed, 28 May 2008)
New Revision: 45873
URL: http://svn.boost.org/trac/boost/changeset/45873

Log:
added documentation for grep filter; fixed broken links
Added:
   trunk/libs/iostreams/doc/classes/grep_filter.html (contents, props changed)
Text files modified:
   trunk/libs/iostreams/doc/bibliography.html | 4 ++++
   trunk/libs/iostreams/doc/classes/regex_filter.html | 22 +++++++++++-----------
   2 files changed, 15 insertions(+), 11 deletions(-)

Modified: trunk/libs/iostreams/doc/bibliography.html
==============================================================================
--- trunk/libs/iostreams/doc/bibliography.html (original)
+++ trunk/libs/iostreams/doc/bibliography.html 2008-05-28 13:52:41 EDT (Wed, 28 May 2008)
@@ -69,6 +69,10 @@
     <TD>Henderson, C. <I>Boost Memory Mapped File</I>.<A CLASS="footnote_ref" NAME="note_1_ref" HREF="#note_1"><SUP>[1]</SUP></A> Available in the Boost Sandbox.</TD>
 </TR>
 <TR>
+ <TH ALIGN="left" VALIGN="top"><A NAME="iso">[I<SPAN STYLE="font-size:80%">EEE</SPAN>]</A></TD><TD WIDTH="1em"></TH>
+ <TD><I>I<SPAN STYLE="font-size:80%">EEE</SPAN> Std 1003.1, 2004 Edition</I>, Shells &amp; Utilities volume. <I>See</I> http://www.opengroup.org/onlinepubs/009695399/utilities/grep.html.</TD></TD>
+</TR>
+<TR>
     <TH ALIGN="left" VALIGN="top"><A NAME="iso">[I<SPAN STYLE="font-size:80%">SO</SPAN>]</A></TD><TD WIDTH="1em"></TH>
     <TD><I>I<SPAN STYLE="font-size:80%">SO</SPAN>/I<SPAN STYLE="font-size:80%">EC</SPAN> 14882:1998(E) Programming Language C++, 2nd ed.</I>. I<SPAN STYLE="font-size:80%">SO</SPAN>/I<SPAN STYLE="font-size:80%">EC</SPAN>, 2003.
 </TR>

Added: trunk/libs/iostreams/doc/classes/grep_filter.html
==============================================================================
--- (empty file)
+++ trunk/libs/iostreams/doc/classes/grep_filter.html 2008-05-28 13:52:41 EDT (Wed, 28 May 2008)
@@ -0,0 +1,155 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+ <TITLE>Class Template basic_grep_filter</TITLE>
+ <LINK REL="stylesheet" HREF="../../../../boost.css">
+ <LINK REL="stylesheet" HREF="../theme/iostreams.css">
+</HEAD>
+<BODY>
+
+<!-- Begin Banner -->
+
+ <H1 CLASS="title">Class Template <CODE>basic_grep_filter</CODE></H1>
+ <HR CLASS="banner">
+
+<!-- End Banner -->
+
+<DL class="page-index">
+ <DT>Description</DT>
+ <DT>Headers</DT>
+ <DT>Installation</DT>
+ <DT>Reference</DT>
+</DL>
+
+<HR>
+
+<A NAME="description"></A>
+<H2>Description</H2>
+
+<P>
+ The class template <CODE>basic_grep_filter</CODE> filters a character sequence line by line using a regular expression provided at construction, in a manner similar to the command-line utility <i>grep</i> (<A CLASS="bib_ref" HREF="../bibliography.html#grep">[IEEE]</A>). The filter uses regular expressions from the Boost Regular Expression Library (<A CLASS="bib_ref" HREF="../bibliography.html#maddock">[Maddock]</A>).
+</P>
+<P>
+ By default, the filtered character sequence consists of those lines of the unfilitered sequence that contain a subsequence matching the regular expression. By specifying appropriate options at construction, <CODE>basic_grep_filter</CODE> can be made to pass through only those lines which exactly match the regular expression (as if the option <i>-x</i> had been passed to the command-line utility) or only those lines that <i>do not</i> contain a match (as if the option <i>-v</i> had been passed to the command-line utility).
+</P>
+<P>
+ A running count of the lines in the filtered character sequence is available via the member function <code>count</code>.
+</P>
+
+<A NAME="headers"></A>
+<H2>Headers</H2>
+
+<DL class="page-index">
+ <DT><A CLASS="header" HREF="../../../../boost/iostreams/filter/grep.hpp"><CODE>&lt;boost/iostreams/filter/grep.hpp&gt;</CODE></A></DT>
+</DL>
+
+<A NAME="installation"></A>
+<H2>Installation</H2>
+
+<P>
+ The template <CODE>basic_grep_filter</CODE> uses the Boost Regular Expression Library, which must be built separately. See here for details.
+</P>
+
+<A NAME="reference"></A>
+<H2>Reference</H2>
+
+<H4>Synopsis</H4>
+
+<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
+
+<SPAN CLASS="preprocessor">#include</SPAN> <A CLASS="header" HREF="../../../../boost/function.hpp" TARGET="_top"><SPAN CLASS="literal">&lt;boost/function.hpp&gt;</SPAN></A>
+<SPAN CLASS="preprocessor">#include</SPAN> <A CLASS="header" HREF="../../../../boost/regex.hpp" TARGET="_top"><SPAN CLASS="literal">&lt;boost/regex.hpp&gt;</SPAN></A>
+
+<SPAN CLASS="keyword">namespace</SPAN> grep {
+
+<SPAN CLASS="keyword">const</SPAN> <SPAN CLASS="keyword">int</SPAN> invert;
+<SPAN CLASS="keyword">const</SPAN> <SPAN CLASS="keyword">int</SPAN> whole_line;
+
+}
+
+<SPAN CLASS="keyword">template</SPAN>&lt; <SPAN CLASS="keyword">typename</SPAN> Ch,
+ <SPAN CLASS="keyword">typename</SPAN> Tr = regex_traits&lt;Ch&gt;,
+ <SPAN CLASS="keyword">typename</SPAN> Alloc = std::allocator&lt;Ch&gt; &gt;
+<SPAN CLASS="keyword">class</SPAN> basic_grep_filter {
+<SPAN CLASS="keyword">public:</SPAN>
+ <A CLASS="documented" HREF="#constructor">basic_grep_filter</A>( <SPAN CLASS="keyword">const</SPAN> basic_regex&lt;Ch, Tr, Alloc&gt;& pattern,
+ regex_constants::match_flag_type flags =
+ regex_constants::match_default,
+ <SPAN CLASS="keyword">int</SPAN> options = <SPAN CLASS="numeric_literal">0</SPAN> );
+ <SPAN CLASS="keyword">int</SPAN> <A CLASS="documented" HREF="#count">count</A>() <SPAN CLASS="keyword">const</SPAN>;
+};
+
+<SPAN CLASS="keyword">typedef</SPAN> basic_grep_filter&lt;<SPAN CLASS="keyword">char</SPAN>&gt; <SPAN CLASS="defined">grep_filter</SPAN>;
+<SPAN CLASS="keyword">typedef</SPAN> basic_grep_filter&lt;<SPAN CLASS="keyword">wchar_t</SPAN>&gt; <SPAN CLASS="defined">wgrep_filter</SPAN>;
+
+} } // End namespace boost::io</PRE>
+
+<A NAME="template_params"></A>
+<H4>Template parameters</H4>
+
+<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2>
+<TR>
+ <TR>
+ <TD VALIGN="top"><I>Ch</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
+ <TD>The character type</TD>
+ </TR>
+ <TR>
+ <TD VALIGN="top"><I>Tr</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
+ <TD>The regular expression traits type</TD>
+ </TR>
+ <TR>
+ <TD VALIGN="top"><I>Alloc</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
+ <TD>A standard library allocator type (<A CLASS="bib_ref" HREF="../bibliography.html#iso">[ISO]</A>, 20.1.5), used to allocate character buffers</TD>
+ </TR>
+</TABLE>
+
+<A NAME="constructor"></A>
+<H4><CODE>basic_grep_filter::basic_grep_filter</CODE></H4>
+
+<PRE CLASS="broken_ie"> <B>basic_grep_filter</B>( <SPAN CLASS="keyword">const</SPAN> basic_regex&lt;Ch, Tr, Alloc&gt;& pattern,
+ regex_constants::match_flag_type flags =
+ regex_constants::match_default,
+ <SPAN CLASS="keyword">int</SPAN> options = <SPAN CLASS="numeric_literal">0</SPAN> );</PRE>
+
+<P>Constructs a <CODE>basic_grep_filter</CODE> from the given regular expression, match flags, and grep options. The parameters have the following interpretations:</P>
+
+<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2>
+<TR>
+ <TR>
+ <TD VALIGN="top"><I>pattern</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
+ <TD>The regular expression to be matched against the stream of unfiltered data</TD>
+ </TR>
+ <TR>
+ <TD VALIGN="top"><I>flags</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
+ <TD>The flags passed to regex_search or regex_match to specify regular expression matching behavior</TD>
+ </TR>
+ <TR>
+ <TD VALIGN="top"><I>options</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
+ <TD>A bitwise OR of zero or more constants from the namespace <CODE>boost::iostreams::grep</CODE>. Currently two constants are recongnized: <CODE>grep::whole_line</CODE> causes the filter to pass through only those lines which exactly match the regular expression, and <CODE>grep::invert</CODE> causes the filter to pass through only those lines that <i>do not</i> contain a match.</TD>
+ </TR>
+</TABLE>
+
+</P>
+
+<A NAME="count"></A>
+<H4><CODE>basic_grep_filter::count</CODE></H4>
+
+<A NAME="second_constructor"></A>
+
+<PRE CLASS="broken_ie"> <SPAN CLASS="keyword">int</SPAN> count() <SPAN CLASS="keyword">const</SPAN>;</PRE>
+
+<P>Returns a running count of the lines passed through from the unfiltered character sequence to the filtered character sequence. The count is reset to zero automatically when the filter begins processing a new character sequence.</P>
+
+<!-- Begin Footer -->
+
+<HR>
+<P CLASS="copyright">Revised 28 May 2008</P>
+
+<P CLASS="copyright">&copy; Copyright 2008 CodeRage, LLC</P>
+<P CLASS="copyright">
+ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+</P>
+
+<!-- End Footer -->
+
+</BODY>

Modified: trunk/libs/iostreams/doc/classes/regex_filter.html
==============================================================================
--- trunk/libs/iostreams/doc/classes/regex_filter.html (original)
+++ trunk/libs/iostreams/doc/classes/regex_filter.html 2008-05-28 13:52:41 EDT (Wed, 28 May 2008)
@@ -30,10 +30,10 @@
     The class template <CODE>basic_regex_filter</CODE> performs text substitutions using regular expressions from the Boost Regular Expression Library (<A CLASS="bib_ref" HREF="../bibliography.html#maddock">[Maddock]</A>).
 </P>
 <P>
- Each <CODE>basic_regex_filter</CODE> stores a regular expression and a formatting function. As unfiltered data is scanned for matches, portions of data which fall between regular expression matches are forwarded unchanged. Each time a match is found, the corresponding match_results object is passed to the formatting function and the return value is forwarded in place of the matched text.
+ Each <CODE>basic_regex_filter</CODE> stores a regular expression and a formatting function. As unfiltered data is scanned for matches, portions of data which fall between regular expression matches are forwarded unchanged. Each time a match is found, the corresponding match_results object is passed to the formatting function and the return value is forwarded in place of the matched text.
 </P>
 <P>
- Users may construct instances of <CODE>basic_regex_filter</CODE> either from formatting functions or from format strings.
+ Users may construct instances of <CODE>basic_regex_filter</CODE> either from formatting functions or from format strings.
 </P>
 <P>
     Since a regular expression may need to look arbitrarily far ahead in a character sequence, <CODE>basic_regex_filter</CODE> derives from aggregate_filter and processes an entire sequence of data at once.
@@ -50,7 +50,7 @@
 <H2>Installation</H2>
 
 <P>
- The template <CODE>basic_regex_filter</CODE> uses the Boost Regular Expression Library, which must be built separately. See here for details.
+ The template <CODE>basic_regex_filter</CODE> uses the Boost Regular Expression Library, which must be built separately. See here for details.
 </P>
 
 <A NAME="reference"></A>
@@ -109,7 +109,7 @@
     </TR>
     <TR>
         <TD VALIGN="top"><I>Tr</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>The regular expression traits type</TD>
+ <TD>The regular expression traits type</TD>
     </TR>
     <TR>
         <TD VALIGN="top"><I>Alloc</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
@@ -164,7 +164,7 @@
     </TR>
     <TR>
         <TD VALIGN="top"><I>flags</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>Used to construct a regex_iterator</TD>
+ <TD>Used to construct a regex_iterator</TD>
     </TR>
 </TABLE>
 
@@ -189,15 +189,15 @@
     </TR>
     <TR>
         <TD VALIGN="top"><I>fmt</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>A format string which specifies the replacement text for each regular expression match, using match_results::format</TD>
+ <TD>A format string which specifies the replacement text for each regular expression match, using match_results::format</TD>
     </TR>
     <TR>
         <TD VALIGN="top"><I>flags</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>Used to construct a regex_iterator</TD>
+ <TD>Used to construct a regex_iterator</TD>
     </TR>
     <TR>
         <TD VALIGN="top"><I>fmt_flags</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>The flags argument to match_results::format</TD>
+ <TD>The flags argument to match_results::format</TD>
     </TR>
 </TABLE>
 
@@ -220,15 +220,15 @@
     </TR>
     <TR>
         <TD VALIGN="top"><I>fmt</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>A format string which specifies the replacement text for each regular expression match, using match_results::format</TD>
+ <TD>A format string which specifies the replacement text for each regular expression match, using match_results::format</TD>
     </TR>
     <TR>
         <TD VALIGN="top"><I>flags</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>Used to construct a regex_iterator</TD>
+ <TD>Used to construct a regex_iterator</TD>
     </TR>
     <TR>
         <TD VALIGN="top"><I>fmt_flags</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
- <TD>The flags argument to match_results::format</TD>
+ <TD>The flags argument to match_results::format</TD>
     </TR>
 </TABLE>
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk