File indexing completed on 2025-01-18 09:38:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
0019 #define BOOST_IOSTREAMS_DETAIL_DEVICE_ADAPTER_HPP_INCLUDED
0020
0021 #include <boost/iostreams/categories.hpp>
0022 #include <boost/iostreams/detail/call_traits.hpp>
0023 #include <boost/iostreams/detail/ios.hpp>
0024 #include <boost/iostreams/operations.hpp>
0025 #include <boost/iostreams/traits.hpp>
0026 #include <boost/static_assert.hpp>
0027
0028 namespace boost { namespace iostreams { namespace detail {
0029
0030 template<typename T>
0031 class device_adapter {
0032 private:
0033 typedef typename detail::value_type<T>::type value_type;
0034 typedef typename detail::param_type<T>::type param_type;
0035 public:
0036 explicit device_adapter(param_type t) : t_(t) { }
0037 T& component() { return t_; }
0038
0039 void close()
0040 {
0041 detail::close_all(t_);
0042 }
0043
0044 void close(BOOST_IOS::openmode which)
0045 {
0046 iostreams::close(t_, which);
0047 }
0048
0049 bool flush()
0050 {
0051 return iostreams::flush(t_);
0052 }
0053
0054 template<typename Locale>
0055 void imbue(const Locale& loc) { iostreams::imbue(t_, loc); }
0056
0057 std::streamsize optimal_buffer_size() const
0058 { return iostreams::optimal_buffer_size(t_); }
0059 public:
0060 value_type t_;
0061 };
0062
0063
0064
0065 } } }
0066
0067 #endif