// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2003-2007 Jonathan Turkanis // 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.) // See http://www.boost.org/libs/iostreams for documentation. #ifndef BOOST_IOSTREAMS_CONCEPTS_HPP_INCLUDED #define BOOST_IOSTREAMS_CONCEPTS_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include // BOOST_MSVC #include #include #include #include // openmode. #include #include #include namespace boost { namespace iostreams { //--------------Definitions of helper templates for device concepts-----------// template struct device { typedef Ch char_type; struct category : Mode, device_tag, closable_tag, localizable_tag { }; void close() { using namespace detail; BOOST_STATIC_ASSERT((!is_convertible::value)); } void close(BOOST_IOS::openmode) { using namespace detail; BOOST_STATIC_ASSERT((is_convertible::value)); } template void imbue(const Locale&) { } }; template struct wdevice : device { }; typedef device source; typedef wdevice wsource; typedef device sink; typedef wdevice wsink; //--------------Definitions of helper templates for simple filter concepts----// template struct filter { typedef Ch char_type; struct category : Mode, filter_tag, closable_tag, localizable_tag { }; template void close(Device&) { using namespace detail; BOOST_STATIC_ASSERT((!is_convertible::value)); BOOST_STATIC_ASSERT((!is_convertible::value)); } template void close(Device&, BOOST_IOS::openmode) { using namespace detail; BOOST_STATIC_ASSERT( (is_convertible::value) || (is_convertible::value) ); } template void imbue(const Locale&) { } }; template struct wfilter : filter { }; typedef filter input_filter; typedef wfilter input_wfilter; typedef filter output_filter; typedef wfilter output_wfilter; typedef filter seekable_filter; typedef wfilter seekable_wfilter; typedef filter dual_use_filter; typedef wfilter dual_use_wfilter; //------Definitions of helper templates for multi-character filter cncepts----// template struct multichar_filter : filter { struct category : filter::category, multichar_tag { }; }; template struct multichar_wfilter : multichar_filter { }; typedef multichar_filter multichar_input_filter; typedef multichar_wfilter multichar_input_wfilter; typedef multichar_filter multichar_output_filter; typedef multichar_wfilter multichar_output_wfilter; typedef multichar_filter multichar_dual_use_filter; typedef multichar_wfilter multichar_dual_use_wfilter; //----------------------------------------------------------------------------// } } // End namespaces iostreams, boost. #endif // #ifndef BOOST_IOSTREAMS_CONCEPTS_HPP_INCLUDED