adapt
The overloaded function template adapt takes an OutputIterator, a pair of ForwardIterators or a standard i/o stream or stream buffer and returns a Device.[1] Certain properties of the returned Device, including its i/o mode, are left indeterminate until the Device is added to a filtering_streambuf or filtering_stream. This is for two reasons:
adapt is invoked.
adapt allows a standard i/o stream or stream buffer to be added to a filtering_streambuf or filtering_stream regardless of the latter's mode.
See STL Sequence Adapters for usage examples.
<boost/iostreams/adapt.hpp>namespace boost { namespace iostreams { template<typename OutIt> implementation-defined adapt(const OutIt& out); template<typename FwdIt> implementation-defined adapt(FwdIt first, FwdIt last); template<typename Ch, typename Tr> implementation-defined adapt(std::basic_iostream<Ch, Tr>& io); template<typename Ch, typename Tr> implementation-defined adapt(std::basic_streambuf<Ch, Tr>& sb); } } // End namespace boost::io
adapt — OutputIteratorstemplate<typename OutIt> implementation-defined adapt(const OutIt& out);
| OutIt | - | A model of OutputIterator. |
Returns a Sink for writing to the sequence controlled by out.[1]
adapt — Iterator Rangestemplate<typename FwdIt> implementation-defined adapt(FwdIt first, FwdIt last);
| Source | - | A model of ForwardIterator. |
Returns a Device for accessing the sequence delimited by first and last.[1] The i/o mode of the Device is determined at the time it is added to a filtering_streambuf or filtering_stream.
adapt — Standard I/O Streams and Stream Bufferstemplate<typename Ch, typename Tr> implementation-defined adapt(std::basic_iostream<Ch, Tr>& io); template<typename Ch, typename Tr> implementation-defined adapt(std::basic_streambuf<Ch, Tr>& sb);
| Ch | - | A character type. |
| Tr | - | A standard library character traits type ([ISO], 21.1.1) with char_type equal to Ch
|
Returns a Device for accessing the sequence or sequences controlled by the given i/o stream or stream buffer.[1] The i/o mode of the Device is determined at the time it is added to a filtering_streambuf or filtering_stream.
[1]Striclty speaking, the object returned is not a true Device, since its i/o mode and possibly its character type are indeterminate. It is better termed a pseudo Device.
Revised 20 May, 2004
© Copyright Jonathan Turkanis, 2004
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)