mirror of
https://github.com/boostorg/iostreams.git
synced 2026-02-22 15:32:20 +00:00
142 lines
6.7 KiB
HTML
Executable File
142 lines
6.7 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Class Template 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>filter</CODE></H1>
|
|
<HR CLASS="banner">
|
|
|
|
<!-- End Banner -->
|
|
|
|
<DL class="page-index">
|
|
<DT><A href="#description">Description</A></DT>
|
|
<DT><A href="#headers">Headers</A></DT>
|
|
<DT><A href="#reference">Reference</A></DT>
|
|
</DL>
|
|
|
|
<HR>
|
|
|
|
<A NAME="description">
|
|
<H2>Description</H2>
|
|
|
|
<P>
|
|
The class template <CODE>filter</CODE>, its subcass <CODE>wfilter</CODE> and their specializations <CODE>input_filter</CODE>, <CODE>output_filter</CODE>, <CODE>input_wfilter</CODE> and <CODE>output_wfilter</CODE> are provided by the Iostreams Library to ease the definitions of new models of the various <A HREF="../concepts.html#filter_concepts">Filter concepts</A>. These templates and <CODE>typedef</CODE>s supply the member types <CODE>char_type</CODE> and <CODE>category</CODE> required by the Iostreams Library; they are inteded to be used as base classes for user-defined Filters.
|
|
</P>
|
|
<P>
|
|
The supplied <CODE>category</CODE> member is convertible to <A HREF="../traits.html#category_tags"><CODE>closable_tag</CODE></A> and to <A HREF="../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>.
|
|
</P>
|
|
|
|
<A NAME="headers">
|
|
<H2>Headers</H2>
|
|
|
|
<DL class="page-index">
|
|
<DT><A CLASS="header" HREF="../../../../boost/iostreams/concepts.hpp"><CODE><boost/iostreams/concepts.hpp></CODE></A></DT>
|
|
</DL>
|
|
|
|
<A NAME="reference">
|
|
<H2>Reference</H2>
|
|
|
|
<A NAME="synopsis"></A>
|
|
<H3>Synopsis</H3>
|
|
|
|
<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost{ <SPAN CLASS="keyword">namespace</SPAN> iostreams {
|
|
|
|
<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> Mode, <SPAN CLASS="keyword">typename</SPAN> Ch = <SPAN CLASS="keyword">char</SPAN>>
|
|
<SPAN CLASS="keyword">struct</SPAN> <A CLASS="documented" HREF="#description">filter</A>;
|
|
|
|
<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> Mode, <SPAN CLASS="keyword">typename</SPAN> Ch = <SPAN CLASS="keyword">wchar_t</SPAN>>
|
|
<SPAN CLASS="keyword">struct</SPAN> <SPAN CLASS="defined">wfilter</SPAN> : filter<Mode, Ch> { };
|
|
|
|
<SPAN CLASS="keyword">typedef</SPAN> filter<input> <SPAN CLASS="defined">input_filter</SPAN></A>;
|
|
<SPAN CLASS="keyword">typedef</SPAN> filter<output> <SPAN CLASS="defined">output_filter</SPAN>;
|
|
<SPAN CLASS="keyword">typedef</SPAN> wfilter<input> <SPAN CLASS="defined">input_wfilter</SPAN>;
|
|
<SPAN CLASS="keyword">typedef</SPAN> wfilter<output> <SPAN CLASS="defined">output_wfilter</SPAN>;
|
|
|
|
<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Mode</A>, <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Ch</A> = <SPAN CLASS="keyword">char</SPAN>>
|
|
<SPAN CLASS="keyword">struct</SPAN> <A CLASS="documented" HREF="#description">filter</A> {
|
|
<SPAN CLASS="keyword">typedef</SPAN> Ch char_type;
|
|
<SPAN CLASS="keyword">typedef</SPAN> <A STYLE="text-decoration:none" HREF="#category"><SPAN CLASS="omitted">see below</SPAN></A> category;
|
|
|
|
<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> Device>
|
|
<SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#close">close</A>(Device&);
|
|
|
|
<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> Device>
|
|
<SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#close">close</A>(std::ios_base::openmode, Device&);
|
|
|
|
<SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#imbue">imbue</A>(<SPAN CLASS="keyword">const</SPAN> std::locale&);
|
|
};
|
|
|
|
} } <SPAN CLASS="comment">// End namespace boost::io</SPAN></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>Mode</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
|
|
<TD>A <A HREF="../modes.html#mode_tags">mode tag</A>.</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD VALIGN="top"><I>Ch</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
|
|
<TD>The character type</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<A NAME="category"></A>
|
|
<H4><CODE>filter::category</CODE></H4>
|
|
|
|
<PRE CLASS="broken_ie"> <SPAN CLASS="keyword">typedef</SPAN> <SPAN CLASS="omitted">see below</SPAN> category;</PRE>
|
|
|
|
<P>
|
|
A category tag convertible to <A HREF="#template_params"><CODE>Mode</CODE></A>, <A HREF="../traits.html#category_tags"><CODE>filter_tag</CODE></A>, <A HREF="../traits.html#category_tags"><CODE>closable_tag</CODE></A> and <A HREF="../traits.html#category_tags"><CODE>localizable_tag</CODE></A>.
|
|
</P>
|
|
|
|
<A NAME="close"></A>
|
|
<H4><CODE>filter::close</CODE></H4>
|
|
|
|
<PRE CLASS="broken_ie"> <SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> Device>
|
|
<SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#close">close</A>(Device&);
|
|
|
|
<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> Device>
|
|
<SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#close">close</A>(std::ios_base::openmode, Device&);</PRE>
|
|
|
|
<P>
|
|
Both overloads are implemented as no-ops. The second is available only if <A HREF="#template_params">Mode</A> is convertible to <A HREF="../modes.html#mode_tags"><CODE>bidirectional</CODE></A>. The first is available only if Mode is <I>not</I> convertible to <A HREF="../modes.html#mode_tags"><CODE>bidirectional</CODE></A>.
|
|
</P>
|
|
<P>
|
|
Required by <A HREF="../concepts/closable.html">Closable</A>.
|
|
</P>
|
|
|
|
<A NAME="imbue"></A>
|
|
<H4><CODE>filter::imbue</CODE></H4>
|
|
<PRE CLASS="broken_ie"> <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#imbue">imbue</A>(<SPAN CLASS="keyword">const</SPAN> std::locale&);</PRE>
|
|
|
|
<P>
|
|
Implemented as a no-op. Required by <A HREF="../concepts/localizable.html">Localizable</A>.
|
|
</P>
|
|
|
|
<!-- Begin Footer -->
|
|
|
|
<HR>
|
|
<P CLASS="copyright">Revised
|
|
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
|
20 May, 2004
|
|
<!--webbot bot="Timestamp" endspan i-checksum="38504" -->
|
|
</P>
|
|
|
|
<P CLASS="copyright">© Copyright Jonathan Turkanis, 2004</P>
|
|
<P CLASS="copyright">
|
|
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>)
|
|
</P>
|
|
|
|
<!-- End Footer -->
|
|
|
|
</BODY>
|