1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
2 // (C) Copyright 2003-2007 Jonathan Turkanis
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
6 // See http://www.boost.org/libs/iostreams for documentation.
8 // Contains category and mode tags for classifying filters, devices and
9 // standard stream and stream buffers types.
11 #ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
12 #define BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
18 namespace boost { namespace iostreams {
20 //------------------Tags for dispatch according to i/o mode-------------------//
23 namespace detail { struct two_sequence : virtual any_tag { }; }
24 namespace detail { struct random_access : virtual any_tag { }; }
25 namespace detail { struct one_head : virtual any_tag { }; }
26 namespace detail { struct two_head : virtual any_tag { }; }
27 struct input : virtual any_tag { };
28 struct output : virtual any_tag { };
29 struct bidirectional : virtual input, virtual output, detail::two_sequence { };
30 struct dual_use : virtual input, virtual output { }; // Pseudo-mode.
31 struct input_seekable : virtual input, virtual detail::random_access { };
32 struct output_seekable : virtual output, virtual detail::random_access { };
34 : virtual input_seekable,
35 virtual output_seekable,
39 : virtual input_seekable,
40 virtual output_seekable,
43 struct bidirectional_seekable
44 : input_seekable, output_seekable,
45 bidirectional, detail::two_head
48 //------------------Tags for use as i/o categories----------------------------//
50 struct device_tag : virtual any_tag { };
51 struct filter_tag : virtual any_tag { };
54 // Tags for optional behavior.
57 struct peekable_tag : virtual any_tag { }; // Devices.
58 struct closable_tag : virtual any_tag { };
59 struct flushable_tag : virtual any_tag { };
60 struct localizable_tag : virtual any_tag { };
61 struct optimally_buffered_tag : virtual any_tag { };
62 struct direct_tag : virtual any_tag { }; // Devices.
63 struct multichar_tag : virtual any_tag { }; // Filters.
65 struct source_tag : device_tag, input { };
66 struct sink_tag : device_tag, output { };
67 struct bidirectional_device_tag : device_tag, bidirectional { };
68 struct seekable_device_tag : virtual device_tag, seekable { };
70 struct input_filter_tag : filter_tag, input { };
71 struct output_filter_tag : filter_tag, output { };
72 struct bidirectional_filter_tag : filter_tag, bidirectional { };
73 struct seekable_filter_tag : filter_tag, seekable { };
74 struct dual_use_filter_tag : filter_tag, dual_use { };
76 struct multichar_input_filter_tag
80 struct multichar_output_filter_tag
84 struct multichar_bidirectional_filter_tag
86 bidirectional_filter_tag
88 struct multichar_seekable_filter_tag
92 struct multichar_dual_use_filter_tag
98 // Tags for standard streams and streambufs.
101 struct std_io_tag : virtual localizable_tag { };
103 : virtual device_tag,
104 virtual peekable_tag,
108 : virtual device_tag,
140 struct istringstream_tag
144 struct ostringstream_tag
148 struct stringstream_tag
156 struct generic_istream_tag
160 struct generic_ostream_tag
164 struct generic_iostream_tag
168 struct generic_streambuf_tag
173 } } // End namespaces iostreams, boost.
175 #endif // #ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED