Boost logo

Boost-Commit :

From: technews_at_[hidden]
Date: 2008-01-24 01:37:11


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

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/libs/iostreams/src/file_descriptor.cpp | 11 +++++++++++
   1 files changed, 11 insertions(+), 0 deletions(-)

Modified: branches/iostreams_dev/libs/iostreams/src/file_descriptor.cpp
==============================================================================
--- branches/iostreams_dev/libs/iostreams/src/file_descriptor.cpp (original)
+++ branches/iostreams_dev/libs/iostreams/src/file_descriptor.cpp 2008-01-24 01:37:09 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


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