Boost logo

Boost-Commit :

From: technews_at_[hidden]
Date: 2008-01-24 01:35:45


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

Log:
added overloads of ctor and open taking a const char* instead of a std::string, to prevent ambiguity between HANDLE and std::string when a const char* is passed as arg
Text files modified:
   branches/iostreams_dev/boost/iostreams/device/file_descriptor.hpp | 18 ++++++++++++++++++
   1 files changed, 18 insertions(+), 0 deletions(-)

Modified: branches/iostreams_dev/boost/iostreams/device/file_descriptor.hpp
==============================================================================
--- branches/iostreams_dev/boost/iostreams/device/file_descriptor.hpp (original)
+++ branches/iostreams_dev/boost/iostreams/device/file_descriptor.hpp 2008-01-24 01:35:44 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.


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