1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <TITLE>Class Template filter
</TITLE>
5 <LINK REL=
"stylesheet" HREF=
"../../../../boost.css">
6 <LINK REL=
"stylesheet" HREF=
"../theme/iostreams.css">
12 <H1 CLASS=
"title">Class Template
<CODE>filter
</CODE></H1>
17 <DL class=
"page-index">
18 <DT><A href=
"#description">Description
</A></DT>
19 <DT><A href=
"#headers">Headers
</A></DT>
20 <DT><A href=
"#reference">Reference
</A></DT>
25 <A NAME=
"description"></A>
29 The class templates
<CODE>filter
</CODE>,
<CODE>wfilter
</CODE>,
<CODE>multichar_filter
</CODE>,
<CODE>multichar_wfilter
</CODE> and their specializations are provided by the Iostreams library for use as base classes for user-defined
<A HREF=
"../concepts/filter.html">Filters
</A>. These base classes supply the member types
<CODE>char_type
</CODE> and
<CODE>category
</CODE> used internally by the Iostreams library to classify filters.
32 The supplied
<CODE>category
</CODE> member is convertible to
<A HREF=
"../guide/traits.html#category_tags"><CODE>closable_tag
</CODE></A> and to
<A HREF=
"../guide/traits.html#category_tags"><CODE>localizable_tag
</CODE></A>. This allows users to define models of the concepts
<A HREF=
"../concepts/closable.html">Closable
</A> and
<A HREF=
"../concepts/closable.html">Localizable
</A> simply by providing definitions of member functions
<CODE>close
</CODE> and
<CODE>imbue
</CODE>.
35 <A NAME=
"headers"></A>
38 <DL class=
"page-index">
39 <DT><A CLASS=
"header" HREF=
"../../../../boost/iostreams/concepts.hpp"><CODE><boost/iostreams/concepts.hpp
></CODE></A></DT>
42 <A NAME=
"reference"></A>
45 <A NAME=
"synopsis"></A>
48 <PRE CLASS=
"broken_ie"><SPAN CLASS=
"keyword">namespace
</SPAN> boost{
<SPAN CLASS=
"keyword">namespace
</SPAN> iostreams {
50 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Mode,
<SPAN CLASS=
"keyword">typename
</SPAN> Ch =
<SPAN CLASS=
"keyword">char
</SPAN>>
51 <SPAN CLASS=
"keyword">struct
</SPAN> <A CLASS=
"documented" HREF=
"#description">filter
</A>;
53 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Mode,
<SPAN CLASS=
"keyword">typename
</SPAN> Ch =
<SPAN CLASS=
"keyword">wchar_t
</SPAN>>
54 <SPAN CLASS=
"keyword">struct
</SPAN> <SPAN CLASS=
"defined">wfilter
</SPAN> : filter
<Mode, Ch
> { };
56 <SPAN CLASS=
"keyword">typedef
</SPAN> filter
<input
> input_filter;
57 <SPAN CLASS=
"keyword">typedef
</SPAN> wfilter
<input
> input_wfilter;
58 <SPAN CLASS=
"keyword">typedef
</SPAN> filter
<output
> output_filter;
59 <SPAN CLASS=
"keyword">typedef
</SPAN> wfilter
<output
> output_wfilter;
60 <SPAN CLASS=
"keyword">typedef
</SPAN> filter
<seekable
> seekable_filter;
61 <SPAN CLASS=
"keyword">typedef
</SPAN> wfilter
<seekable
> seekable_wfilter;
62 <SPAN CLASS=
"keyword">typedef
</SPAN> filter
<dual_use
> dual_use_filter;
63 <SPAN CLASS=
"keyword">typedef
</SPAN> wfilter
<dual_use
> dual_use_wfilter;
65 <SPAN CLASS=
"keyword"><SPAN CLASS=
"keyword">template
</SPAN></SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Mode,
<SPAN CLASS=
"keyword">typename
</SPAN> Ch =
<SPAN CLASS=
"keyword">char
</SPAN>>
66 <SPAN CLASS=
"keyword">struct
</SPAN> <A CLASS=
"documented" HREF=
"#multichar_filter">multichar_filter
</A> : filter
<Mode, Ch
> {
67 <SPAN CLASS=
"keyword">typedef
</SPAN> <A STYLE=
"text-decoration:none" HREF=
"#category"><SPAN CLASS=
"omitted">see below
</SPAN></A> category;
70 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Mode,
<SPAN CLASS=
"keyword">typename
</SPAN> Ch =
<SPAN CLASS=
"keyword">wchar_t
</SPAN>>
71 <SPAN CLASS=
"keyword">struct
</SPAN> <SPAN CLASS=
"defined">multichar_wfilter
</SPAN> : multichar_filter
<Mode, Ch
> { };
73 <SPAN CLASS=
"keyword">typedef
</SPAN> multichar_filter
<input
> multichar_input_filter;
74 <SPAN CLASS=
"keyword">typedef
</SPAN> multichar_filter
<input
> multichar_input_wfilter;
75 <SPAN CLASS=
"keyword">typedef
</SPAN> multichar_filter
<output
> multichar_output_filter;
76 <SPAN CLASS=
"keyword">typedef
</SPAN> multichar_filter
<output
> multichar_output_wfilter;
77 <SPAN CLASS=
"keyword">typedef
</SPAN> multichar_filter
<dual_use
> multichar_dual_use_filter;
78 <SPAN CLASS=
"keyword">typedef
</SPAN> multichar_filter
<dual_use
> multichar_dual_use_wfilter;
80 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> <A CLASS=
"documented" HREF=
"#filter_template_params">Mode
</A>,
<SPAN CLASS=
"keyword">typename
</SPAN> <A CLASS=
"documented" HREF=
"#filter_template_params">Ch
</A> =
<SPAN CLASS=
"keyword">char
</SPAN>>
81 <SPAN CLASS=
"keyword">struct
</SPAN> <A CLASS=
"documented" HREF=
"#filter">filter
</A> {
82 <SPAN CLASS=
"keyword">typedef
</SPAN> Ch char_type;
83 <SPAN CLASS=
"keyword">typedef
</SPAN> <A STYLE=
"text-decoration:none" HREF=
"#category"><SPAN CLASS=
"omitted">see below
</SPAN></A> category;
85 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Device
>
86 <SPAN CLASS=
"keyword">void
</SPAN> <A CLASS=
"documented" HREF=
"#close">close
</A>(Device
&);
88 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Device
>
89 <SPAN CLASS=
"keyword">void
</SPAN> <A CLASS=
"documented" HREF=
"#close">close
</A>(Device
&, std::ios_base::openmode);
91 <SPAN CLASS=
"keyword">void
</SPAN> <A CLASS=
"documented" HREF=
"#imbue">imbue
</A>(
<SPAN CLASS=
"keyword">const
</SPAN> std::locale
&);
94 } }
<SPAN CLASS=
"comment">// End namespace boost::io
</SPAN></PRE>
97 <H3>Class Template
<CODE>filter
</CODE></H3>
101 <P>Convenience base class for defining
<A HREF=
"../concepts/filter.html">Filters
</A></P>
103 <A NAME=
"filter_template_params"></A>
104 <H4>Template parameters
</H4>
106 <TABLE STYLE=
"margin-left:2em" BORDER=
0 CELLPADDING=
2>
108 <TD VALIGN=
"top"><I>Mode
</I></TD><TD WIDTH=
"2em" VALIGN=
"top">-
</TD>
109 <TD>A
<A HREF=
"../guide/modes.html#mode_tags">mode tag
</A>.
</TD>
112 <TD VALIGN=
"top"><I>Ch
</I></TD><TD WIDTH=
"2em" VALIGN=
"top">-
</TD>
113 <TD>The character type
</TD>
117 <A NAME=
"category"></A>
118 <H4><CODE>filter::category
</CODE></H4>
120 <PRE CLASS=
"broken_ie"> <SPAN CLASS=
"keyword">typedef
</SPAN> <SPAN CLASS=
"omitted">see below
</SPAN> category;
</PRE>
123 A category tag convertible to
<A HREF=
"#filter_template_params"><CODE>Mode
</CODE></A>,
<A HREF=
"../guide/traits.html#category_tags"><CODE>filter_tag
</CODE></A>,
<A HREF=
"../guide/traits.html#category_tags"><CODE>closable_tag
</CODE></A> and
<A HREF=
"../guide/traits.html#category_tags"><CODE>localizable_tag
</CODE></A>.
127 <H4><CODE>filter::close
</CODE></H4>
129 <PRE CLASS=
"broken_ie"> <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Device
>
130 <SPAN CLASS=
"keyword">void
</SPAN> <A CLASS=
"documented" HREF=
"#close">close
</A>(Device
&);
132 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> Device
>
133 <SPAN CLASS=
"keyword">void
</SPAN> <A CLASS=
"documented" HREF=
"#close">close
</A>(Device
&, std::ios_base::openmode);
</PRE>
136 Both overloads are implemented as no-ops. The second is available only if
<A HREF=
"#filter_template_params">Mode
</A> is convertible to
<A HREF=
"../guide/modes.html#mode_tags"><CODE>bidirectional
</CODE></A>. The first is available only if Mode is
<I>not
</I> convertible to
<A HREF=
"../guide/modes.html#mode_tags"><CODE>bidirectional
</CODE></A>.
139 Required by
<A HREF=
"../concepts/closable.html">Closable
</A>.
143 <H4><CODE>filter::imbue
</CODE></H4>
144 <PRE CLASS=
"broken_ie"> <SPAN CLASS=
"keyword">void
</SPAN> <A CLASS=
"documented" HREF=
"#imbue">imbue
</A>(
<SPAN CLASS=
"keyword">const
</SPAN> std::locale
&);
</PRE>
147 Implemented as a no-op. Required by
<A HREF=
"../concepts/localizable.html">Localizable
</A>.
150 <A NAME=
"multichar_filter"></A>
151 <H3>Class Template
<CODE>multichar_filter
</CODE></H3>
155 <P>Convenience base class for defining
<A HREF=
"../concepts/multi_character.html">Multi-Character Filters
</A>. Derived class of
<A HREF=
"#filter"><CODE>filter
</CODE></A> whose member type
<CODE>category
</CODE> is convertible to the template parameter Mode and to
<A HREF=
"../guide/traits.html#category_tags"><CODE>multichar_filter_tag
</CODE></A>,
<A HREF=
"../guide/traits.html#category_tags"><CODE>closable_tag
</CODE></A> and
<A HREF=
"../guide/traits.html#category_tags"><CODE>localizable_tag
</CODE></A>.
</P>
157 <A NAME=
"multichar_filter_template_params"></A>
158 <H4>Template parameters
</H4>
160 <TABLE STYLE=
"margin-left:2em" BORDER=
0 CELLPADDING=
2>
162 <TD VALIGN=
"top"><I>Mode
</I></TD><TD WIDTH=
"2em" VALIGN=
"top">-
</TD>
163 <TD>A
<A HREF=
"../guide/modes.html#mode_tags">mode tag
</A>.
</TD>
166 <TD VALIGN=
"top"><I>Ch
</I></TD><TD WIDTH=
"2em" VALIGN=
"top">-
</TD>
167 <TD>The character type
</TD>
171 <!-- Begin Footer -->
173 <HR STYLE=
"margin-top:2em">
175 <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>
176 <P CLASS=
"copyright">
177 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>)