Class Template multichar_filter

Description
Headers
Reference

Description

The class template multichar_filter, its subcass multichar_wfilter and their specializations multichar_input_filter, multichar_output_filter, multichar_input_wfilter and multichar_output_wfilter are provided by the Iostreams Library to ease the definitions of new Multi-Character Filters. 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.

Headers

<boost/iostreams/concepts.hpp>

Reference

Synopsis

namespace boost{ namespace iostreams {

template<typename Mode, typename Ch = char>
struct multichar_filter;

template<typename Mode, typename Ch = wchar_t>
struct multichar_wfilter : multichar_filter<Mode, Ch> { };

typedef multichar_filter<input>    multichar_input_filter;
typedef multichar_filter<output>   multichar_output_filter;
typedef multichar_wfilter<input>   multichar_input_wfilter;
typedef multichar_wfilter<output>  multichar_output_wfilter;

template<typename Mode, typename Ch = char>
struct multichar_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

Template parameters

Mode- A mode tag.
Ch- The character type

multichar_filter::category

    typedef see below category;

A category tag convertible to Mode, filter_tag, multichar_tag, closable_tag and localizable_tag.

multichar_filter::close

    template<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.

multichar_filter::imbue

    void imbue(const std::locale&);

Implemented as a no-op. Required by Localizable.