diff --git a/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp b/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp index 7ad33e1..149de8e 100755 --- a/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp +++ b/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp @@ -68,17 +68,22 @@ protected: //--------------Virtual functions-----------------------------------------// + // Declared in linked_streambuf. + void close(BOOST_IOS::openmode m); + const std::type_info& component_type() const { return typeid(T); } + void* component_impl() { return component(); } + +#ifdef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES + public: +#endif + + // Declared in basic_streambuf. int_type underflow(); int_type pbackfail(int_type c); int_type overflow(int_type c); pos_type seekoff( off_type off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ); pos_type seekpos(pos_type sp, BOOST_IOS::openmode which); - - // Declared in linked_streambuf. - void close(BOOST_IOS::openmode m); - const std::type_info& component_type() const { return typeid(T); } - void* component_impl() { return component(); } private: pos_type seek_impl( off_type off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ); diff --git a/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp b/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp index 6156386..6da12c8 100755 --- a/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp +++ b/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp @@ -75,6 +75,9 @@ protected: #ifndef BOOST_IOSTREAMS_NO_LOCALE void imbue(const std::locale& loc); +#endif +#ifdef BOOST_IOSTREAMS_NO_STREAM_TEMPLATES + public: #endif int_type underflow(); int_type pbackfail(int_type c); diff --git a/include/boost/iostreams/filter/line_filter.hpp b/include/boost/iostreams/filter/line_filter.hpp index 0f4991a..87bb495 100755 --- a/include/boost/iostreams/filter/line_filter.hpp +++ b/include/boost/iostreams/filter/line_filter.hpp @@ -17,9 +17,9 @@ #include #include // BOOST_STATIC_CONSTANT. #include -#include #include #include // openmode, streamsize. +#include // Must come last. #include // VC7.1 C4244. @@ -33,14 +33,23 @@ namespace boost { namespace iostreams { // Alloc - The allocator type. // Description: Filter which processes data one line at a time. // -template > -class basic_line_filter { +template< typename Ch, + typename Alloc = + #if BOOST_WORKAROUND(__GNUC__, < 3) + typename std::basic_string::allocator_type + #else + std::allocator + #endif + > +class basic_line_filter { +private: + typedef typename std::basic_string::traits_type string_traits; public: typedef Ch char_type; typedef char_traits traits_type; typedef std::basic_string< - Ch, - BOOST_IOSTREAMS_CHAR_TRAITS(char_type), + Ch, + string_traits, Alloc > string_type; struct category @@ -126,7 +135,7 @@ public: private: virtual string_type do_filter(const string_type& line) = 0; - // Copies filtered characters fron the current line into + // Copies filtered characters fron the current line into // the given buffer. std::streamsize read_line(char_type* s, std::streamsize n) { @@ -145,7 +154,7 @@ private: { using namespace std; typename traits_type::int_type c; - while ( traits_type::is_good(c = iostreams::get(src)) && + while ( traits_type::is_good(c = iostreams::get(src)) && c != traits_type::newline() ) { cur_line_ += traits_type::to_int_type(c); diff --git a/include/boost/iostreams/skip.hpp b/include/boost/iostreams/skip.hpp index 1bf1ce9..e773ea2 100755 --- a/include/boost/iostreams/skip.hpp +++ b/include/boost/iostreams/skip.hpp @@ -31,9 +31,9 @@ void skip(Device& dev, stream_offset off, mpl::true_) template void skip(Device& dev, stream_offset off, mpl::false_) -{ +{ // gcc 2.95 needs namespace qualification for char_traits. typedef typename char_type_of::type char_type; - typedef char_traits traits_type; + typedef iostreams::char_traits traits_type; for (stream_offset z = 0; z < off; ) { typename traits_type::int_type c; if (traits_type::is_eof(c = iostreams::get(dev)))