Boost logo

Boost :

From: Steve Nutt (Steve.Nutt_at_[hidden])
Date: 2007-10-15 00:37:30

I've created a device with the boost::iostreams::dual_seekable category
to use with the boost::iostreams::stream class, but I'm having trouble
implementing seek.


When I call seekp on the stream, seek on my device is called with a
which (openmode) of both BOOST_IOS::in and BOOST_IOS::out. I would have
expected for a call to seekp the which parameter in the seek call on my
device would be BOOST_IOS::out, and calling seekg would set which to


The following code in
boost\iostream\detail\streambuf\indirect_streambuf.hpp ignores the which
argument passed and passes on through both in and out.


template<typename T, typename Tr, typename Alloc, typename Mode>

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( position_to_offset(sp), BOOST_IOS::beg,

                      BOOST_IOS::in | BOOST_IOS::out );



Is this correct, and if so how do I implement seeking when using a dual
head device?


Many thanks,


Steve Nutt

Boost list run by bdawes at, gregod at, cpdaniel at, john at