Update of /cvsroot/boost/boost/boost/iostreams/detail/streambuf
In directory
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3406/boost/iostreams/detail/streambuf
Modified Files:
Tag: RC_1_34_0
direct_streambuf.hpp indirect_streambuf.hpp
Log Message:
Applied Kim Barret's patches to bring the iostreams library into line with
133.1: http://svn.boost.org/trac/boost/ticket/971
Index: direct_streambuf.hpp
===================================================================
RCS file:
/cvsroot/boost/boost/boost/iostreams/detail/streambuf/direct_streambuf.hpp,v
retrieving revision 1.22
retrieving revision 1.22.6.1
diff -u -d -r1.22 -r1.22.6.1
--- direct_streambuf.hpp 15 Jul 2005 23:49:15 -0000 1.22
+++ direct_streambuf.hpp 23 May 2007 08:27:29 -0000 1.22.6.1
@@ -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.6.1
retrieving revision 1.26.6.2
diff -u -d -r1.26.6.1 -r1.26.6.2
--- indirect_streambuf.hpp 16 Feb 2007 17:49:38 -0000 1.26.6.1
+++ indirect_streambuf.hpp 23 May 2007 08:27:29 -0000 1.26.6.2
@@ -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,
@@ -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