Boost logo

Boost-Commit :

From: technews_at_[hidden]
Date: 2008-01-11 17:58:21


Author: turkanis
Date: 2008-01-11 17:58:21 EST (Fri, 11 Jan 2008)
New Revision: 42688
URL: http://svn.boost.org/trac/boost/changeset/42688

Log:
merged changes from iostreams_dev; fixes for IBM and more documentation
Text files modified:
   trunk/boost/iostreams/positioning.hpp | 17 ++++++++++++++---
   1 files changed, 14 insertions(+), 3 deletions(-)

Modified: trunk/boost/iostreams/positioning.hpp
==============================================================================
--- trunk/boost/iostreams/positioning.hpp (original)
+++ trunk/boost/iostreams/positioning.hpp 2008-01-11 17:58:21 EST (Fri, 11 Jan 2008)
@@ -65,17 +65,28 @@
 
 # else // # ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS
 
-// Helper function
+// In the Dinkumware standard library, a stream position is represented by two
+// integral stream offsets -- _Fpos, of type std::fpos_t, and _Myoff, of type
+// std::streamoff -- together with a conversion state. The value of _Fpos can be
+// extracted using the implementation-defined member functions seekpos() or
+// get_fpos_t(), depending on the Dinkumware version. The value of _Myoff cannot
+// be extracted directly, but can be calculated as the difference between the
+// result of converting the std::fpos to a std::streamoff and the result of
+// converting the member _Fpos to a long. The latter operation is accomplished
+// with the macro _FPOSOFF, which works correctly on platforms where std::fpos_t
+// is a struct and platforms where it is an integral type.
+
+// Converts a std::fpos_t to a stream_offset
 inline stream_offset fpos_t_to_offset(std::fpos_t pos)
 {
-# if defined(_POSIX_) || (_INTEGRAL_MAX_BITS >= 64)
+# if defined(_POSIX_) || (_INTEGRAL_MAX_BITS >= 64) || defined(__IBMCPP__)
     return pos;
 # else
     return _FPOSOFF(pos);
 # endif
 }
 
-// Helper function
+// Extracts the member _Fpos from a std::fpos
 inline std::fpos_t streampos_to_fpos_t(std::streampos pos)
 {
 # if defined (_CPPLIB_VER) || defined(__IBMCPP__)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk