filter
The class template filter, its subcass wfilter and their specializations input_filter, output_filter, input_wfilter and output_wfilter are provided by the Iostreams Library to ease the definitions of new models of the various Filter concepts. These templates and typedefs supply the member types char_type and category required by the Iostreams Library; they are inteded to be used as base classes for user-defined Filters.
The supplied category member is convertible to closable_tag and to localizable_tag. This allows users to define models of the concepts Closable and Localizable simply by providing definitions of member functions close and imbue.
<boost/iostreams/concepts.hpp>namespace boost{ namespace iostreams { template<typename Mode, typename Ch = char> struct filter; template<typename Mode, typename Ch = wchar_t> struct wfilter : filter<Mode, Ch> { }; typedef filter<input> input_filter; typedef filter<output> output_filter; typedef wfilter<input> input_wfilter; typedef wfilter<output> output_wfilter; template<typename Mode, typename Ch = char> struct filter { typedef Ch char_type; typedef see below category; template<typename Device> void close(Device&); template<typename Device> void close(std::ios_base::openmode, Device&); void imbue(const std::locale&); }; } } // End namespace boost::io
| Mode | - | A mode tag. |
| Ch | - | The character type |
filter::categorytypedef see below category;
A category tag convertible to Mode, filter_tag, closable_tag and localizable_tag.
filter::closetemplate<typename Device> void close(Device&); template<typename Device> void close(std::ios_base::openmode, Device&);
Both overloads are implemented as no-ops. The second is available only if Mode is convertible to bidirectional. The first is available only if Mode is not convertible to bidirectional.
Required by Closable.
filter::imbuevoid imbue(const std::locale&);
Implemented as a no-op. Required by Localizable.
Revised 20 May, 2004
© Copyright Jonathan Turkanis, 2004
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)