Chris@16
|
1 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
|
Chris@16
|
2 // (C) Copyright 2003-2007 Jonathan Turkanis
|
Chris@16
|
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
|
Chris@16
|
5
|
Chris@16
|
6 // See http://www.boost.org/libs/iostreams for documentation.
|
Chris@16
|
7
|
Chris@16
|
8 // Contains category and mode tags for classifying filters, devices and
|
Chris@16
|
9 // standard stream and stream buffers types.
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
|
Chris@16
|
12 #define BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
|
Chris@16
|
13
|
Chris@16
|
14 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
Chris@16
|
15 # pragma once
|
Chris@16
|
16 #endif
|
Chris@16
|
17
|
Chris@16
|
18 namespace boost { namespace iostreams {
|
Chris@16
|
19
|
Chris@16
|
20 //------------------Tags for dispatch according to i/o mode-------------------//
|
Chris@16
|
21
|
Chris@16
|
22 struct any_tag { };
|
Chris@16
|
23 namespace detail { struct two_sequence : virtual any_tag { }; }
|
Chris@16
|
24 namespace detail { struct random_access : virtual any_tag { }; }
|
Chris@16
|
25 namespace detail { struct one_head : virtual any_tag { }; }
|
Chris@16
|
26 namespace detail { struct two_head : virtual any_tag { }; }
|
Chris@16
|
27 struct input : virtual any_tag { };
|
Chris@16
|
28 struct output : virtual any_tag { };
|
Chris@16
|
29 struct bidirectional : virtual input, virtual output, detail::two_sequence { };
|
Chris@16
|
30 struct dual_use : virtual input, virtual output { }; // Pseudo-mode.
|
Chris@16
|
31 struct input_seekable : virtual input, virtual detail::random_access { };
|
Chris@16
|
32 struct output_seekable : virtual output, virtual detail::random_access { };
|
Chris@16
|
33 struct seekable
|
Chris@16
|
34 : virtual input_seekable,
|
Chris@16
|
35 virtual output_seekable,
|
Chris@16
|
36 detail::one_head
|
Chris@16
|
37 { };
|
Chris@16
|
38 struct dual_seekable
|
Chris@16
|
39 : virtual input_seekable,
|
Chris@16
|
40 virtual output_seekable,
|
Chris@16
|
41 detail::two_head
|
Chris@16
|
42 { };
|
Chris@16
|
43 struct bidirectional_seekable
|
Chris@16
|
44 : input_seekable, output_seekable,
|
Chris@16
|
45 bidirectional, detail::two_head
|
Chris@16
|
46 { };
|
Chris@16
|
47
|
Chris@16
|
48 //------------------Tags for use as i/o categories----------------------------//
|
Chris@16
|
49
|
Chris@16
|
50 struct device_tag : virtual any_tag { };
|
Chris@16
|
51 struct filter_tag : virtual any_tag { };
|
Chris@16
|
52
|
Chris@16
|
53 //
|
Chris@16
|
54 // Tags for optional behavior.
|
Chris@16
|
55 //
|
Chris@16
|
56
|
Chris@16
|
57 struct peekable_tag : virtual any_tag { }; // Devices.
|
Chris@16
|
58 struct closable_tag : virtual any_tag { };
|
Chris@16
|
59 struct flushable_tag : virtual any_tag { };
|
Chris@16
|
60 struct localizable_tag : virtual any_tag { };
|
Chris@16
|
61 struct optimally_buffered_tag : virtual any_tag { };
|
Chris@16
|
62 struct direct_tag : virtual any_tag { }; // Devices.
|
Chris@16
|
63 struct multichar_tag : virtual any_tag { }; // Filters.
|
Chris@16
|
64
|
Chris@16
|
65 struct source_tag : device_tag, input { };
|
Chris@16
|
66 struct sink_tag : device_tag, output { };
|
Chris@16
|
67 struct bidirectional_device_tag : device_tag, bidirectional { };
|
Chris@16
|
68 struct seekable_device_tag : virtual device_tag, seekable { };
|
Chris@16
|
69
|
Chris@16
|
70 struct input_filter_tag : filter_tag, input { };
|
Chris@16
|
71 struct output_filter_tag : filter_tag, output { };
|
Chris@16
|
72 struct bidirectional_filter_tag : filter_tag, bidirectional { };
|
Chris@16
|
73 struct seekable_filter_tag : filter_tag, seekable { };
|
Chris@16
|
74 struct dual_use_filter_tag : filter_tag, dual_use { };
|
Chris@16
|
75
|
Chris@16
|
76 struct multichar_input_filter_tag
|
Chris@16
|
77 : multichar_tag,
|
Chris@16
|
78 input_filter_tag
|
Chris@16
|
79 { };
|
Chris@16
|
80 struct multichar_output_filter_tag
|
Chris@16
|
81 : multichar_tag,
|
Chris@16
|
82 output_filter_tag
|
Chris@16
|
83 { };
|
Chris@16
|
84 struct multichar_bidirectional_filter_tag
|
Chris@16
|
85 : multichar_tag,
|
Chris@16
|
86 bidirectional_filter_tag
|
Chris@16
|
87 { };
|
Chris@16
|
88 struct multichar_seekable_filter_tag
|
Chris@16
|
89 : multichar_tag,
|
Chris@16
|
90 seekable_filter_tag
|
Chris@16
|
91 { };
|
Chris@16
|
92 struct multichar_dual_use_filter_tag
|
Chris@16
|
93 : multichar_tag,
|
Chris@16
|
94 dual_use_filter_tag
|
Chris@16
|
95 { };
|
Chris@16
|
96
|
Chris@16
|
97 //
|
Chris@16
|
98 // Tags for standard streams and streambufs.
|
Chris@16
|
99 //
|
Chris@16
|
100
|
Chris@16
|
101 struct std_io_tag : virtual localizable_tag { };
|
Chris@16
|
102 struct istream_tag
|
Chris@16
|
103 : virtual device_tag,
|
Chris@16
|
104 virtual peekable_tag,
|
Chris@16
|
105 virtual std_io_tag
|
Chris@16
|
106 { };
|
Chris@16
|
107 struct ostream_tag
|
Chris@16
|
108 : virtual device_tag,
|
Chris@16
|
109 virtual std_io_tag
|
Chris@16
|
110 { };
|
Chris@16
|
111 struct iostream_tag
|
Chris@16
|
112 : istream_tag,
|
Chris@16
|
113 ostream_tag
|
Chris@16
|
114 { };
|
Chris@16
|
115 struct streambuf_tag
|
Chris@16
|
116 : device_tag,
|
Chris@16
|
117 peekable_tag,
|
Chris@16
|
118 std_io_tag
|
Chris@16
|
119 { };
|
Chris@16
|
120 struct ifstream_tag
|
Chris@16
|
121 : input_seekable,
|
Chris@16
|
122 closable_tag,
|
Chris@16
|
123 istream_tag
|
Chris@16
|
124 { };
|
Chris@16
|
125 struct ofstream_tag
|
Chris@16
|
126 : output_seekable,
|
Chris@16
|
127 closable_tag,
|
Chris@16
|
128 ostream_tag
|
Chris@16
|
129 { };
|
Chris@16
|
130 struct fstream_tag
|
Chris@16
|
131 : seekable,
|
Chris@16
|
132 closable_tag,
|
Chris@16
|
133 iostream_tag
|
Chris@16
|
134 { };
|
Chris@16
|
135 struct filebuf_tag
|
Chris@16
|
136 : seekable,
|
Chris@16
|
137 closable_tag,
|
Chris@16
|
138 streambuf_tag
|
Chris@16
|
139 { };
|
Chris@16
|
140 struct istringstream_tag
|
Chris@16
|
141 : input_seekable,
|
Chris@16
|
142 istream_tag
|
Chris@16
|
143 { };
|
Chris@16
|
144 struct ostringstream_tag
|
Chris@16
|
145 : output_seekable,
|
Chris@16
|
146 ostream_tag
|
Chris@16
|
147 { };
|
Chris@16
|
148 struct stringstream_tag
|
Chris@16
|
149 : dual_seekable,
|
Chris@16
|
150 iostream_tag
|
Chris@16
|
151 { };
|
Chris@16
|
152 struct stringbuf_tag
|
Chris@16
|
153 : dual_seekable,
|
Chris@16
|
154 streambuf_tag
|
Chris@16
|
155 { };
|
Chris@16
|
156 struct generic_istream_tag
|
Chris@16
|
157 : input_seekable,
|
Chris@16
|
158 istream_tag
|
Chris@16
|
159 { };
|
Chris@16
|
160 struct generic_ostream_tag
|
Chris@16
|
161 : output_seekable,
|
Chris@16
|
162 ostream_tag
|
Chris@16
|
163 { };
|
Chris@16
|
164 struct generic_iostream_tag
|
Chris@16
|
165 : seekable,
|
Chris@16
|
166 iostream_tag
|
Chris@16
|
167 { };
|
Chris@16
|
168 struct generic_streambuf_tag
|
Chris@16
|
169 : seekable,
|
Chris@16
|
170 streambuf_tag
|
Chris@16
|
171 { };
|
Chris@16
|
172
|
Chris@16
|
173 } } // End namespaces iostreams, boost.
|
Chris@16
|
174
|
Chris@16
|
175 #endif // #ifndef BOOST_IOSTREAMS_CATEGORIES_HPP_INCLUDED
|