1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <TITLE>SymmetricFilter
</TITLE>
5 <LINK REL=
"stylesheet" HREF=
"../../../../boost.css">
6 <LINK REL=
"stylesheet" HREF=
"../theme/iostreams.css">
12 <H1 CLASS=
"title">SymmetricFilter
</H1>
20 A SymmetricFilter processes a character sequence fed to it incrementally in a user-supplied buffer and outputs a filtered sequence incrementally to a second user-supplied buffer. It is useful for defining filters based on C language APIs.
24 SymmetricFilter does not refine
<A HREF=
"filter.html">Filter
</A>. Instead, the template
<A HREF=
"../classes/symmetric_filter.html"><CODE>symmetric_filter
</CODE></A> can used to generate a Filter from a SymmetricFilter. The Filters generated in this manner are
<A HREF=
"dual_use_filter.html">DualUseFilters
</A> and are
<A HREF=
"../../../../doc/html/CopyConstructible.html" TARGET=
"_top">CopyConstructible
</A> regardless of whether the SymmetricFilters on which they are based are
<A HREF=
"../../../../doc/html/CopyConstructible.html">CopyConstructible
</A>.
28 The concept SymmetricFilter is notable in that its definition does not involve the concept of a
<A HREF=
"source.html">Source
</A> or
<A HREF=
"sink.html">Sink
</A>.
31 <H2>Associated Types
</H2>
33 <TABLE CELLPADDING=
"5" BORDER=
"1">
34 <TR><TD>Character type
</TD><TD>The type of the characters in the filtered sequences
</TD></TR>
39 <TABLE CELLPADDING=
"2">
40 <TR><TD><CODE>F
</CODE></TD><TD>- A type which is a model of SymmetricFilter
</TD></TR>
41 <TR><TD><CODE>Ch
</CODE></TD><TD>- The character type of
<CODE>F
</CODE></TD></TR>
42 <TR><TD><CODE>f
</CODE></TD><TD>- Object of type
<CODE>F
</CODE></TD></TR>
43 <TR><TD><CODE>i1, i2
</CODE></TD><TD>- Objects of type
<CODE>const Ch*
</CODE></TD></TR>
44 <TR><TD><CODE>o1, o2
</CODE></TD><TD>- Objects of type
<CODE>Ch*
</CODE></TD></TR>
45 <TR><TD><CODE>flush
</CODE></TD><TD>- Object of type
<CODE>bool
</CODE></TD></TR>
48 <H2>Valid Expressions / Semantics
— Typenames
</H2>
50 <TABLE CELLPADDING=
"5" BORDER=
"1">
51 <TR><TH>Expression
</TH><TH>Expression Type
</TH></TR>
54 <PRE CLASS=
"plain_code"><CODE>typename
<A HREF=
"../guide/traits.html#char_type_of_ref">char_type_of
</A><F
>::type
</CODE></PRE>
56 <TD><CODE>typename
</CODE> of the character type
</TD>
60 <H2>Valid Expressions / Semantics
— Member Functions
</H2>
62 <TABLE CELLPADDING=
"5" BORDER=
"1">
63 <TR><TH>Expression
</TH><TH>Expression Type
</TH><TH>Semantics
</TH><TH>Postcondition
</TH></TR>
65 <TD><PRE CLASS=
"plain_code"><CODE>f.filter(i1, i2, o1, o2, flush)
</CODE></PRE></TD>
66 <TD><CODE>bool
</CODE></TD>
68 Attempts to filter the sequence
<CODE>[i1, i2)
</CODE>, storing the result in the sequence
<CODE>[o1, o2)
</CODE>. If
<CODE>flush
</CODE> is true, writes as much output to
<CODE>[o1, o2)
</CODE> as possible. If
<CODE>flush
</CODE> is
<CODE>false
</CODE>, returns
<CODE>false
</CODE> to indicate that a
“natural
” end of stream has been detected. Otherwise, returns
<CODE>true
</CODE> to indicate that additional characters, not yet stored in
<CODE>[o1, o2)
</CODE>, are available for output.
71 <P><CODE>i1
</CODE> points to the first unconsumed character in the orginal sequence
<CODE>[i1, i2)
</CODE>.
72 <P><CODE>o1
</CODE> points to the first unconsumed character in the orginal sequence
<CODE>[o1, o2)
</CODE>.
73 <P>Either
<CODE>i1 == i2
</CODE> or
<CODE>o1 == o2
</CODE>.
77 <TD><PRE CLASS=
"plain_code"><CODE>f.close()
</CODE></PRE></TD>
78 <TD><CODE>void
</CODE></TD>
79 <TD ALIGN=
"center">-
</TD>
81 <CODE></CODE><CODE>f
</CODE> is ready to begin filtering a new sequence
89 Errors which occur during the execution of
<CODE>filter
</CODE> or
<CODE>close
</CODE> are indicated by throwing exceptions.
98 <P CLASS=
"copyright">© Copyright
2008 <a href=
"http://www.coderage.com/" target=
"_top">CodeRage, LLC
</a><br/>© Copyright
2004-
2007 <a href=
"http://www.coderage.com/turkanis/" target=
"_top">Jonathan Turkanis
</a></P>
100 Distributed under the Boost Software License, Version
1.0. (See accompanying file LICENSE_1_0.txt or copy at
<A HREF=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt
</A>)