Update of /cvsroot/boost/boost/boost/iostreams/detail/streambuf
In directory 
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19574/boost/iostreams/detail/streambuf

Modified Files:
        direct_streambuf.hpp indirect_streambuf.hpp 
Log Message:
Added Kim Barrett's patches that merge the changes from 1.33.1 into cvs HEAD.

Index: direct_streambuf.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/iostreams/detail/streambuf/direct_streambuf.hpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- direct_streambuf.hpp        15 Jul 2005 23:49:15 -0000      1.22
+++ direct_streambuf.hpp        26 May 2007 12:42:42 -0000      1.23
@@ -24,6 +24,7 @@
 #include <boost/iostreams/detail/streambuf/linked_streambuf.hpp>
 #include <boost/iostreams/detail/error.hpp>
 #include <boost/iostreams/operations.hpp>
+#include <boost/iostreams/positioning.hpp>
 #include <boost/iostreams/traits.hpp>
 
 // Must come last.
@@ -52,7 +53,7 @@
             )                                             streambuf_type;
 public: // stream needs access.
     void open(const T& t, int buffer_size, int pback_size);
-    bool is_open();
+    bool is_open() const;
     void close();
     bool auto_close() const { return auto_close_; }
     void set_auto_close(bool close) { auto_close_ = close; }
@@ -85,7 +86,7 @@
                       BOOST_IOS::openmode which );
     pos_type seekpos(pos_type sp, BOOST_IOS::openmode which);
 private:
-    pos_type seek_impl( off_type off, BOOST_IOS::seekdir way,
+    pos_type seek_impl( stream_offset off, BOOST_IOS::seekdir way,
                         BOOST_IOS::openmode which );
     void init_input(any_tag) { }
     void init_input(input);
@@ -118,7 +119,8 @@
 }
 
 template<typename T, typename Tr>
-bool direct_streambuf<T, Tr>::is_open() { return ibeg_ != 0 && !obeg_ != 0; }
+bool direct_streambuf<T, Tr>::is_open() const 
+{ return ibeg_ != 0 && !obeg_ != 0; }
 
 template<typename T, typename Tr>
 void direct_streambuf<T, Tr>::close() 
@@ -185,7 +187,10 @@
 inline typename direct_streambuf<T, Tr>::pos_type
 direct_streambuf<T, Tr>::seekpos
     (pos_type sp, BOOST_IOS::openmode)
-{ return seek_impl(sp, BOOST_IOS::beg, BOOST_IOS::in | BOOST_IOS::out); }
+{ 
+    return seek_impl( position_to_offset(sp), BOOST_IOS::beg, 
+                      BOOST_IOS::in | BOOST_IOS::out );
+}
 
 template<typename T, typename Tr>
 void direct_streambuf<T, Tr>::close(BOOST_IOS::openmode which)
@@ -204,13 +209,13 @@
 
 template<typename T, typename Tr>
 typename direct_streambuf<T, Tr>::pos_type direct_streambuf<T, Tr>::seek_impl
-    (off_type off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
+    (stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
 {
     using namespace std;
     BOOST_IOS::openmode both = BOOST_IOS::in | BOOST_IOS::out;
     if (two_head() && (which & both) == both)
         throw bad_seek();
-    off_type result = -1;
+    stream_offset result = -1;
     bool one = one_head();
     if (one && (pptr() != 0 || gptr()== 0))
         init_get_area(); // Switch to input mode, for code reuse.
@@ -242,7 +247,7 @@
         pbump(static_cast<int>(next - (pptr() - obeg_)));
         result = next;
     }
-    return result;
+    return offset_to_position(result);
 }
 
 template<typename T, typename Tr>

Index: indirect_streambuf.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/iostreams/detail/streambuf/indirect_streambuf.hpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- indirect_streambuf.hpp      7 Jul 2005 13:03:06 -0000       1.26
+++ indirect_streambuf.hpp      26 May 2007 12:42:42 -0000      1.27
@@ -58,7 +58,7 @@
     indirect_streambuf();
 
     void open(const T& t BOOST_IOSTREAMS_PUSH_PARAMS());
-    bool is_open();
+    bool is_open() const;
     void close();
     bool auto_close() const;
     void set_auto_close(bool close);
@@ -118,7 +118,7 @@
     void sync_impl();
     void close_impl(BOOST_IOS::openmode);
 
-    enum {
+    enum flag_type {
         f_open             = 1,
         f_input_closed     = f_open << 1,
         f_output_closed    = f_input_closed << 1,
@@ -189,7 +189,7 @@
 }
 
 template<typename T, typename Tr, typename Alloc, typename Mode>
-inline bool indirect_streambuf<T, Tr, Alloc, Mode>::is_open()
+inline bool indirect_streambuf<T, Tr, Alloc, Mode>::is_open() const
 { return (flags_ & f_open) != 0; }
 
 template<typename T, typename Tr, typename Alloc, typename Mode>
@@ -328,7 +328,10 @@
 inline typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type
 indirect_streambuf<T, Tr, Alloc, Mode>::seekpos
     (pos_type sp, BOOST_IOS::openmode)
-{ return seek_impl(sp, BOOST_IOS::beg, BOOST_IOS::in | BOOST_IOS::out); }
+{ 
+    return seek_impl( position_to_offset(sp), BOOST_IOS::beg, 
+                      BOOST_IOS::in | BOOST_IOS::out ); 
+}
 
 template<typename T, typename Tr, typename Alloc, typename Mode>
 typename indirect_streambuf<T, Tr, Alloc, Mode>::pos_type


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to