sl@0: // (C) Copyright Jonathan Turkanis 2003. sl@0: // Distributed under the Boost Software License, Version 1.0. (See accompanying sl@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) sl@0: sl@0: // See http://www.boost.org/libs/iostreams for documentation. sl@0: sl@0: #ifndef BOOST_IOSTREAMS_CONCEPTS_HPP_INCLUDED sl@0: #define BOOST_IOSTREAMS_CONCEPTS_HPP_INCLUDED sl@0: sl@0: #if defined(_MSC_VER) && (_MSC_VER >= 1020) sl@0: # pragma once sl@0: #endif sl@0: sl@0: #include // BOOST_MSVC sl@0: #include sl@0: #include sl@0: #include sl@0: #include // openmode. sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: namespace boost { namespace iostreams { sl@0: sl@0: //--------------Definitions of helper templates for device concepts-----------// sl@0: sl@0: template sl@0: struct device { sl@0: typedef Ch char_type; sl@0: struct category sl@0: : Mode, sl@0: device_tag, sl@0: closable_tag, sl@0: localizable_tag sl@0: { }; sl@0: sl@0: void close() sl@0: { sl@0: using namespace detail; sl@0: BOOST_STATIC_ASSERT((!is_convertible::value)); sl@0: } sl@0: sl@0: void close(BOOST_IOS::openmode) sl@0: { sl@0: using namespace detail; sl@0: BOOST_STATIC_ASSERT((is_convertible::value)); sl@0: } sl@0: sl@0: template sl@0: void imbue(const Locale&) { } sl@0: }; sl@0: sl@0: template sl@0: struct wdevice : device { }; sl@0: sl@0: typedef device source; sl@0: typedef wdevice wsource; sl@0: typedef device sink; sl@0: typedef wdevice wsink; sl@0: sl@0: //--------------Definitions of helper templates for simple filter concepts----// sl@0: sl@0: template sl@0: struct filter { sl@0: typedef Ch char_type; sl@0: struct category sl@0: : Mode, sl@0: filter_tag, sl@0: closable_tag, sl@0: localizable_tag sl@0: { }; sl@0: sl@0: template sl@0: void close(Device&) sl@0: { sl@0: using namespace detail; sl@0: BOOST_STATIC_ASSERT((!is_convertible::value)); sl@0: BOOST_STATIC_ASSERT((!is_convertible::value)); sl@0: } sl@0: sl@0: template sl@0: void close(Device&, BOOST_IOS::openmode) sl@0: { sl@0: using namespace detail; sl@0: BOOST_STATIC_ASSERT( sl@0: (is_convertible::value) || sl@0: (is_convertible::value) sl@0: ); sl@0: } sl@0: sl@0: template sl@0: void imbue(const Locale&) { } sl@0: }; sl@0: sl@0: template sl@0: struct wfilter : filter { }; sl@0: sl@0: typedef filter input_filter; sl@0: typedef wfilter input_wfilter; sl@0: typedef filter output_filter; sl@0: typedef wfilter output_wfilter; sl@0: typedef filter seekable_filter; sl@0: typedef wfilter seekable_wfilter; sl@0: typedef filter dual_use_filter; sl@0: typedef wfilter dual_use_wfilter; sl@0: sl@0: //------Definitions of helper templates for multi-character filter cncepts----// sl@0: sl@0: template sl@0: struct multichar_filter : filter { sl@0: struct category : filter::category, multichar_tag { }; sl@0: }; sl@0: sl@0: template sl@0: struct multichar_wfilter : multichar_filter { }; sl@0: sl@0: typedef multichar_filter multichar_input_filter; sl@0: typedef multichar_filter multichar_input_wfilter; sl@0: typedef multichar_filter multichar_output_filter; sl@0: typedef multichar_filter multichar_output_wfilter; sl@0: typedef multichar_filter multichar_dual_use_filter; sl@0: typedef multichar_filter multichar_dual_use_wfilter; sl@0: sl@0: //----------------------------------------------------------------------------// sl@0: sl@0: } } // End namespaces iostreams, boost. sl@0: sl@0: #endif // #ifndef BOOST_IOSTREAMS_CONCEPTS_HPP_INCLUDED