File indexing completed on 2025-01-30 09:44:33
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_IOSTREAMS_FILTERING_STREAMBUF_HPP_INCLUDED
0009 #define BOOST_IOSTREAMS_FILTERING_STREAMBUF_HPP_INCLUDED
0010
0011 #if defined(_MSC_VER)
0012 # pragma once
0013 #endif
0014
0015 #include <exception>
0016 #include <memory> // allocator.
0017 #include <boost/iostreams/chain.hpp>
0018 #include <boost/iostreams/detail/access_control.hpp>
0019 #include <boost/iostreams/detail/char_traits.hpp>
0020 #include <boost/iostreams/detail/push.hpp>
0021 #include <boost/iostreams/detail/streambuf.hpp> // pubsync.
0022 #include <boost/iostreams/detail/streambuf/chainbuf.hpp>
0023 #include <boost/mpl/if.hpp>
0024
0025 namespace boost { namespace iostreams {
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #define BOOST_IOSTREAMS_DEFINE_FILTER_STREAMBUF(name_, chain_type_, default_char_) \
0038 template< typename Mode, \
0039 typename Ch = default_char_, \
0040 typename Tr = BOOST_IOSTREAMS_CHAR_TRAITS(Ch), \
0041 typename Alloc = std::allocator<Ch>, \
0042 typename Access = public_ > \
0043 class name_ : public boost::iostreams::detail::chainbuf< \
0044 chain_type_<Mode, Ch, Tr, Alloc>, Mode, Access \
0045 > \
0046 { \
0047 public: \
0048 typedef Ch char_type; \
0049 struct category \
0050 : Mode, closable_tag, streambuf_tag \
0051 { }; \
0052 BOOST_IOSTREAMS_STREAMBUF_TYPEDEFS(Tr) \
0053 typedef Mode mode; \
0054 typedef chain_type_<Mode, Ch, Tr, Alloc> chain_type; \
0055 name_() { } \
0056 BOOST_IOSTREAMS_DEFINE_PUSH_CONSTRUCTOR(name_, mode, Ch, push_impl) \
0057 ~name_() { if (this->is_complete()) this->BOOST_IOSTREAMS_PUBSYNC(); } \
0058 }; \
0059
0060 BOOST_IOSTREAMS_DEFINE_FILTER_STREAMBUF(filtering_streambuf, boost::iostreams::chain, char)
0061 BOOST_IOSTREAMS_DEFINE_FILTER_STREAMBUF(filtering_wstreambuf, boost::iostreams::chain, wchar_t)
0062
0063 typedef filtering_streambuf<input> filtering_istreambuf;
0064 typedef filtering_streambuf<output> filtering_ostreambuf;
0065 typedef filtering_wstreambuf<input> filtering_wistreambuf;
0066 typedef filtering_wstreambuf<output> filtering_wostreambuf;
0067
0068 } }
0069
0070 #endif