Boost logo

Boost-Commit :

From: technews_at_[hidden]
Date: 2008-01-24 01:50:33


Author: turkanis
Date: 2008-01-24 01:50:32 EST (Thu, 24 Jan 2008)
New Revision: 42948
URL: http://svn.boost.org/trac/boost/changeset/42948

Log:
merged changes from iostreams_dev, revisions 42825-42947
Added:
   trunk/libs/iostreams/test/stream_offset_32bit_test.cpp
      - copied unchanged from r42947, /branches/iostreams_dev/libs/iostreams/test/stream_offset_32bit_test.cpp
   trunk/libs/iostreams/test/stream_offset_64bit_test.cpp
      - copied unchanged from r42947, /branches/iostreams_dev/libs/iostreams/test/stream_offset_64bit_test.cpp
Text files modified:
   trunk/boost/iostreams/device/file_descriptor.hpp | 18 ++++++++++++++++++
   trunk/libs/iostreams/build/Jamfile.v2 | 3 +--
   trunk/libs/iostreams/src/file_descriptor.cpp | 11 +++++++++++
   trunk/libs/iostreams/src/mapped_file.cpp | 9 ++++++---
   trunk/libs/iostreams/test/large_file_test.cpp | 1 +
   5 files changed, 37 insertions(+), 5 deletions(-)

Modified: trunk/boost/iostreams/device/file_descriptor.hpp
==============================================================================
--- trunk/boost/iostreams/device/file_descriptor.hpp (original)
+++ trunk/boost/iostreams/device/file_descriptor.hpp 2008-01-24 01:50:32 EST (Thu, 24 Jan 2008)
@@ -51,11 +51,21 @@
                                   BOOST_IOS::in | BOOST_IOS::out,
                               BOOST_IOS::openmode base_mode =
                                   BOOST_IOS::in | BOOST_IOS::out );
+ explicit file_descriptor( const char* path,
+ BOOST_IOS::openmode mode =
+ BOOST_IOS::in | BOOST_IOS::out,
+ BOOST_IOS::openmode base_mode =
+ BOOST_IOS::in | BOOST_IOS::out );
     void open( const std::string& path,
                BOOST_IOS::openmode =
                    BOOST_IOS::in | BOOST_IOS::out,
                BOOST_IOS::openmode base_mode =
                    BOOST_IOS::in | BOOST_IOS::out );
+ void open( const char* path,
+ BOOST_IOS::openmode =
+ BOOST_IOS::in | BOOST_IOS::out,
+ BOOST_IOS::openmode base_mode =
+ BOOST_IOS::in | BOOST_IOS::out );
     bool is_open() const { return pimpl_->flags_ != 0; }
     std::streamsize read(char_type* s, std::streamsize n);
     std::streamsize write(const char_type* s, std::streamsize n);
@@ -125,6 +135,10 @@
                                      BOOST_IOS::openmode m = BOOST_IOS::in )
         : file_descriptor(path, m & ~BOOST_IOS::out, BOOST_IOS::in)
         { }
+ explicit file_descriptor_source( const char* path,
+ BOOST_IOS::openmode m = BOOST_IOS::in )
+ : file_descriptor(path, m & ~BOOST_IOS::out, BOOST_IOS::in)
+ { }
 };
 
 struct file_descriptor_sink : private file_descriptor {
@@ -158,6 +172,10 @@
                                    BOOST_IOS::openmode m = BOOST_IOS::out )
         : file_descriptor(path, m & ~BOOST_IOS::in, BOOST_IOS::out)
         { }
+ explicit file_descriptor_sink( const char* path,
+ BOOST_IOS::openmode m = BOOST_IOS::out )
+ : file_descriptor(path, m & ~BOOST_IOS::in, BOOST_IOS::out)
+ { }
 };
 
 } } // End namespaces iostreams, boost.

Modified: trunk/libs/iostreams/build/Jamfile.v2
==============================================================================
--- trunk/libs/iostreams/build/Jamfile.v2 (original)
+++ trunk/libs/iostreams/build/Jamfile.v2 2008-01-24 01:50:32 EST (Thu, 24 Jan 2008)
@@ -125,8 +125,7 @@
 }
 
 local bz2 = [ create-library bzip2 : libbz2 bz2 :
- blocksort bzlib compress crctable decompress huffman
- mk251 randtable :
+ blocksort bzlib compress crctable decompress huffman randtable :
     <link>shared:<def-file>$(BZIP2_SOURCE)/libbz2.def ] ;
 
 if $(bz2)

Modified: trunk/libs/iostreams/src/file_descriptor.cpp
==============================================================================
--- trunk/libs/iostreams/src/file_descriptor.cpp (original)
+++ trunk/libs/iostreams/src/file_descriptor.cpp 2008-01-24 01:50:32 EST (Thu, 24 Jan 2008)
@@ -56,6 +56,12 @@
         { }
 #endif
 
+file_descriptor::file_descriptor( const char* path,
+ BOOST_IOS::openmode mode,
+ BOOST_IOS::openmode base_mode )
+ : pimpl_(new impl)
+{ open(std::string(path), mode, base_mode); }
+
 file_descriptor::file_descriptor( const std::string& path,
                                   BOOST_IOS::openmode mode,
                                   BOOST_IOS::openmode base_mode )
@@ -155,6 +161,11 @@
 #endif // #ifndef BOOST_IOSTREAMS_WINDOWS //----------------------------------//
 }
 
+void file_descriptor::open
+ ( const char* path, BOOST_IOS::openmode m,
+ BOOST_IOS::openmode base )
+{ open(std::string(path), m, base); }
+
 std::streamsize file_descriptor::read(char_type* s, std::streamsize n)
 {
 #ifdef BOOST_IOSTREAMS_WINDOWS

Modified: trunk/libs/iostreams/src/mapped_file.cpp
==============================================================================
--- trunk/libs/iostreams/src/mapped_file.cpp (original)
+++ trunk/libs/iostreams/src/mapped_file.cpp 2008-01-24 01:50:32 EST (Thu, 24 Jan 2008)
@@ -123,9 +123,6 @@
 mapped_file_source::size_type mapped_file_source::size() const
 { return pimpl_->size_; }
 
-bool mapped_file_source::is_open() const
-{ return !!pimpl_ && pimpl_->handle_ != 0; }
-
 void mapped_file_source::close() { pimpl_->close(); }
 
 mapped_file_source::operator mapped_file_source::safe_bool() const
@@ -283,6 +280,9 @@
     pimpl_->data_ = reinterpret_cast<char*>(data);
 }
 
+bool mapped_file_source::is_open() const
+{ return !!pimpl_ && pimpl_->handle_ != INVALID_HANDLE_VALUE; }
+
 int mapped_file_source::alignment()
 {
     SYSTEM_INFO info;
@@ -368,6 +368,9 @@
     return;
 }
 
+bool mapped_file_source::is_open() const
+{ return !!pimpl_ && pimpl_->handle_ != 0; }
+
 int mapped_file_source::alignment()
 { return static_cast<int>(sysconf(_SC_PAGESIZE)); }
 

Modified: trunk/libs/iostreams/test/large_file_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/large_file_test.cpp (original)
+++ trunk/libs/iostreams/test/large_file_test.cpp 2008-01-24 01:50:32 EST (Thu, 24 Jan 2008)
@@ -27,6 +27,7 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
+#include <iostream>
 
     // OS-specific headers for low-level i/o.
 


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