Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63513 - in branches/release: boost/iostreams boost/iostreams/device libs/iostreams libs/iostreams/build libs/iostreams/doc libs/iostreams/doc/classes libs/iostreams/src libs/iostreams/test libs/iostreams/test/detail
From: daniel_james_at_[hidden]
Date: 2010-07-02 14:56:16


Author: danieljames
Date: 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
New Revision: 63513
URL: http://svn.boost.org/trac/boost/changeset/63513

Log:
Revert iostreams merge.

Removed:
   branches/release/libs/iostreams/test/deprecated_file_descriptor_test.cpp
   branches/release/libs/iostreams/test/detail/file_handle.hpp
Properties modified:
   branches/release/boost/iostreams/ (props changed)
   branches/release/libs/iostreams/ (props changed)
Text files modified:
   branches/release/boost/iostreams/device/file_descriptor.hpp | 54 --------------
   branches/release/libs/iostreams/build/Jamfile.v2 | 1
   branches/release/libs/iostreams/doc/classes/file_descriptor.html | 152 ++++-----------------------------------
   branches/release/libs/iostreams/doc/release_notes.html | 19 ----
   branches/release/libs/iostreams/src/file_descriptor.cpp | 148 +++++++-------------------------------
   branches/release/libs/iostreams/test/Jamfile.v2 | 25 ------
   branches/release/libs/iostreams/test/detail/temp_file.hpp | 33 +++++++
   branches/release/libs/iostreams/test/file_descriptor_test.cpp | 129 ---------------------------------
   branches/release/libs/iostreams/test/tee_test.cpp | 37 +++++----
   9 files changed, 99 insertions(+), 499 deletions(-)

Modified: branches/release/boost/iostreams/device/file_descriptor.hpp
==============================================================================
--- branches/release/boost/iostreams/device/file_descriptor.hpp (original)
+++ branches/release/boost/iostreams/device/file_descriptor.hpp 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -37,12 +37,6 @@
 class file_descriptor_sink;
 namespace detail { struct file_descriptor_impl; }
 
-enum file_descriptor_flags
-{
- never_close_handle = 0,
- close_handle = 3
-};
-
 class BOOST_IOSTREAMS_DECL file_descriptor {
 public:
     friend class file_descriptor_source;
@@ -58,18 +52,10 @@
     file_descriptor();
 
     // Constructors taking file desciptors
- file_descriptor(handle_type fd, file_descriptor_flags);
-#ifdef BOOST_IOSTREAMS_WINDOWS
- file_descriptor(int fd, file_descriptor_flags);
-#endif
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
- // Constructors taking file desciptors
     explicit file_descriptor(handle_type fd, bool close_on_exit = false);
 #ifdef BOOST_IOSTREAMS_WINDOWS
     explicit file_descriptor(int fd, bool close_on_exit = false);
 #endif
-#endif
 
     // Constructor taking a std:: string
     explicit file_descriptor( const std::string& path,
@@ -95,18 +81,10 @@
     file_descriptor(const file_descriptor& other);
 
     // open overloads taking file descriptors
- void open(handle_type fd, file_descriptor_flags);
-#ifdef BOOST_IOSTREAMS_WINDOWS
- void open(int fd, file_descriptor_flags);
-#endif
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
- // open overloads taking file descriptors
     void open(handle_type fd, bool close_on_exit = false);
 #ifdef BOOST_IOSTREAMS_WINDOWS
     void open(int fd, bool close_on_exit = false);
 #endif
-#endif
 
     // open overload taking a std::string
     void open( const std::string& path,
@@ -166,18 +144,10 @@
     file_descriptor_source() { }
 
     // Constructors taking file desciptors
- explicit file_descriptor_source(handle_type fd, file_descriptor_flags);
-#ifdef BOOST_IOSTREAMS_WINDOWS
- explicit file_descriptor_source(int fd, file_descriptor_flags);
-#endif
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
- // Constructors taking file desciptors
     explicit file_descriptor_source(handle_type fd, bool close_on_exit = false);
 #ifdef BOOST_IOSTREAMS_WINDOWS
     explicit file_descriptor_source(int fd, bool close_on_exit = false);
 #endif
-#endif
 
     // Constructor taking a std:: string
     explicit file_descriptor_source( const std::string& path,
@@ -196,19 +166,11 @@
     // Copy constructor
     file_descriptor_source(const file_descriptor_source& other);
 
- // Constructors taking file desciptors
- void open(handle_type fd, file_descriptor_flags);
-#ifdef BOOST_IOSTREAMS_WINDOWS
- void open(int fd, file_descriptor_flags);
-#endif
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
     // open overloads taking file descriptors
     void open(handle_type fd, bool close_on_exit = false);
 #ifdef BOOST_IOSTREAMS_WINDOWS
     void open(int fd, bool close_on_exit = false);
 #endif
-#endif
 
     // open overload taking a std::string
     void open(const std::string& path, BOOST_IOS::openmode mode = BOOST_IOS::in);
@@ -248,18 +210,10 @@
     file_descriptor_sink() { }
 
     // Constructors taking file desciptors
- file_descriptor_sink(handle_type fd, file_descriptor_flags);
-#ifdef BOOST_IOSTREAMS_WINDOWS
- file_descriptor_sink(int fd, file_descriptor_flags);
-#endif
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
- // Constructors taking file desciptors
     explicit file_descriptor_sink(handle_type fd, bool close_on_exit = false);
 #ifdef BOOST_IOSTREAMS_WINDOWS
     explicit file_descriptor_sink(int fd, bool close_on_exit = false);
 #endif
-#endif
 
     // Constructor taking a std:: string
     explicit file_descriptor_sink( const std::string& path,
@@ -279,18 +233,10 @@
     file_descriptor_sink(const file_descriptor_sink& other);
 
     // open overloads taking file descriptors
- void open(handle_type fd, file_descriptor_flags);
-#ifdef BOOST_IOSTREAMS_WINDOWS
- void open(int fd, file_descriptor_flags);
-#endif
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
- // open overloads taking file descriptors
     void open(handle_type fd, bool close_on_exit = false);
 #ifdef BOOST_IOSTREAMS_WINDOWS
     void open(int fd, bool close_on_exit = false);
 #endif
-#endif
 
     // open overload taking a std::string
     void open( const std::string& path,

Modified: branches/release/libs/iostreams/build/Jamfile.v2
==============================================================================
--- branches/release/libs/iostreams/build/Jamfile.v2 (original)
+++ branches/release/libs/iostreams/build/Jamfile.v2 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -155,7 +155,6 @@
 lib boost_iostreams
     : $(sources)
     : <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
- <define>BOOST_IOSTREAMS_USE_DEPRECATED
     :
     : <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
     ;

Modified: branches/release/libs/iostreams/doc/classes/file_descriptor.html
==============================================================================
--- branches/release/libs/iostreams/doc/classes/file_descriptor.html (original)
+++ branches/release/libs/iostreams/doc/classes/file_descriptor.html 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -97,11 +97,6 @@
 
 <PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
 
-<SPAN CLASS="keyword">enum</SPAN> file_descriptor_flags {
- never_close_handle,
- close_handle
-};
-
 <SPAN CLASS="keyword">class</SPAN> file_descriptor_source {
 <SPAN CLASS="keyword">public</SPAN>:
     <SPAN CLASS='keyword'>typedef</SPAN> <SPAN CLASS='keyword'>char</SPAN> char_type;
@@ -112,30 +107,18 @@
     <A CLASS="documented" HREF="#file_descriptor_source_ctor">file_descriptor_source</A>( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                             std::ios_base::open_mode mode =
                                 std::ios_base::in );
- <A CLASS="documented" HREF="#file_descriptor_source_ctor">file_descriptor_source</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <A CLASS="documented" HREF="#file_descriptor_source_ctor">file_descriptor_source</A>( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <A CLASS="documented" HREF="#file_descriptor_source_ctor">file_descriptor_source</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <A CLASS="documented" HREF="#file_descriptor_source_ctor">file_descriptor_source</A>( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
     <SPAN CLASS="keyword">template</SPAN>&lt;<SPAN CLASS="keyword">typename</SPAN> Path&gt;
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_source_open">open</A>( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::in );
- <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_source_open">open</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_source_open">open</A>( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_source_open">open</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_source_open">open</A>( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
     <SPAN CLASS="keyword">bool</SPAN> <A CLASS="documented" HREF="#file_descriptor_source_is_open">is_open</A>() <SPAN CLASS="keyword">const</SPAN>;
@@ -153,16 +136,11 @@
     file_descriptor_source( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                             std::ios_base::open_mode mode =
                                 std::ios_base::in );
- file_descriptor_source( <SPAN CLASS="keyword">int </SPAN>fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- file_descriptor_source( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     file_descriptor_source( <SPAN CLASS="keyword">int </SPAN>fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     file_descriptor_source( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );</PRE>
+
 <P>
     The first member constructs an empty <CODE>file_descriptor_source</CODE>.
 </P>
@@ -172,19 +150,11 @@
 </P>
 
 <P>
- The third member constructs a <CODE>file_descriptor_source</CODE> to access the file with the given operating system or runtime-library file descriptor.
- If the second argument is <CODE>close_handle</CODE>, the file descriptor is closed when the <CODE>file_descriptor_source</CODE> being constructed &#8212; or one of its copies &#8212; is closed or destructed.
+ The third member constructs a <CODE>file_descriptor_source</CODE> to access the file with the given operating system or runtime-library file descriptor. If the second argument is <CODE>true</CODE>, the file descriptor is closed when the <CODE>file_descriptor_source</CODE> being constructed &#8212; or one of its copies &#8212; is closed.
 </P>
 
 <P>
- The fourth member is the same as the third, except that it accepts a Windows file handle instead of a file descriptor.
- If the second argument is <CODE>close_handle</CODE>, the file descriptor is closed when the <CODE>file_descriptor_source</CODE> being constructed &#8212; or one of its copies &#8212; is closed or destructed.
-</P>
-
-<P>
- The deprecated members are there to provide backwards compatability with old versions.
- To use them you need to define <CODE>BOOST_IOSTREAMS_USE_DEPRECATED</CODE>.
- The descriptor is always closed by <CODE>close</CODE> but only closed in destructors if <CODE>close_on_exit</CODE> is <CODE>true</CODE>.
+ The fourth member is the same as the third, except that it accepts a Windows file handle instead of a file descriptor. If the second argument is <CODE>true</CODE>, the file descriptor is closed when the <CODE>file_descriptor_source</CODE> being constructed &#8212; or one of its copies &#8212; is closed.
 </P>
 
 <A NAME="file_descriptor_source_open"></A>
@@ -194,21 +164,13 @@
     <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::in );
- <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <SPAN CLASS="keyword">void</SPAN> open( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <SPAN CLASS="keyword">void</SPAN> open( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );</PRE>
 
 <P>
     The parameters of <CODE>open</CODE> the same as those of the corresponding constructors.
- If the file descriptor already holds a file, it'll be closed
- (unless opened or constructed with <CODE>never_close_handle</CODE>).
 </P>
 
 <A NAME="file_descriptor_source_is_open"></A>
@@ -236,11 +198,6 @@
 
 <PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
 
-<SPAN CLASS="keyword">enum</SPAN> file_descriptor_flags {
- never_close_handle,
- close_handle
-};
-
 <SPAN CLASS="keyword">class</SPAN> file_descriptor_sink {
 <SPAN CLASS="keyword">public</SPAN>:
     <SPAN CLASS='keyword'>typedef</SPAN> <SPAN CLASS='keyword'>char</SPAN> char_type;
@@ -256,25 +213,13 @@
     <SPAN CLASS='comment'>// Windows-only</SPAN>
     <A CLASS="documented" HREF="#file_descriptor_sink_ctor">file_descriptor_sink</A>( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated</SPAN>
- <A CLASS="documented" HREF="#file_descriptor_sink_ctor">file_descriptor_sink</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
- <A CLASS="documented" HREF="#file_descriptor_sink_ctor">file_descriptor_sink</A>( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
     <SPAN CLASS="keyword">template</SPAN>&lt;<SPAN CLASS="keyword">typename</SPAN> Path&gt;
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_sink_open">open</A>( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::out );
- <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_sink_open">open</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_sink_open">open</A>( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_sink_open">open</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_sink_open">open</A>( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
     <SPAN CLASS="keyword">bool</SPAN> <A CLASS="documented" HREF="#file_descriptor_sink_is_open">is_open</A>() <SPAN CLASS="keyword">const</SPAN>;
@@ -295,13 +240,7 @@
     file_descriptor_sink( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
     <SPAN CLASS='comment'>// Windows-only</SPAN>
- file_descriptor_sink( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
- file_descriptor_sink( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
- file_descriptor_sink( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );</PRE>
+ file_descriptor_sink( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );</PRE>
 
 <P>
     The first member constructs an empty <CODE>file_descriptor_sink</CODE>.
@@ -312,19 +251,11 @@
 </P>
 
 <P>
- The third member constructs a <CODE>file_descriptor_sink</CODE> to access the file with the given operating system or runtime-library file descriptor.
- If the second argument is <CODE>close_handle</CODE>, the file descriptor is closed when the <CODE>file_descriptor_sink</CODE> being constructed &#8212; or one of its copies &#8212; is closed or destructed.
-</P>
-
-<P>
- The fourth member is the same as the third, except that it accepts a Windows file handle instead of a file descriptor.
- If the second argument is <CODE>close_handle</CODE>, the file descriptor is closed when the <CODE>file_descriptor_sink</CODE> being constructed &#8212; or one of its copies &#8212; is closed or destructed.
+ The third member constructs a <CODE>file_descriptor_sink</CODE> to access the file with the given operating system or runtime-library file descriptor. If the second argument is <CODE>true</CODE>, the file descriptor is closed when the new <CODE>file_descriptor_sink</CODE> &#8212; or one of its copies &#8212; is closed.
 </P>
 
 <P>
- The deprecated members are there to provide backwards compatability with old versions.
- To use them you need to define <CODE>BOOST_IOSTREAMS_USE_DEPRECATED</CODE>.
- The descriptor is always closed by <CODE>close</CODE> but only closed in destructors if <CODE>close_on_exit</CODE> is <CODE>true</CODE>.
+ The fourth member is the same as the third, except that it accepts a Windows file handle instead of a file descriptor. If the second argument is <CODE>true</CODE>, the file descriptor is closed when the new <CODE>file_descriptor_sink</CODE> &#8212; or one of its copies &#8212; is closed.
 </P>
 
 <A NAME="file_descriptor_sink_open"></A>
@@ -334,21 +265,13 @@
     <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::out );
- <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <SPAN CLASS="keyword">void</SPAN> open( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <SPAN CLASS="keyword">void</SPAN> open( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );</PRE>
 
 <P>
     The parameters of <CODE>open</CODE> the same as those of the corresponding constructors.
- If the file descriptor already holds a file, it'll be closed
- (unless opened or constructed with <CODE>never_close_handle</CODE>).
 </P>
 
 <A NAME="file_descriptor_sink_is_open"></A>
@@ -376,11 +299,6 @@
 
 <PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
 
-<SPAN CLASS="keyword">enum</SPAN> file_descriptor_flags {
- never_close_handle,
- close_handle
-};
-
 <SPAN CLASS="keyword">class</SPAN> file_descriptor {
 <SPAN CLASS="keyword">public</SPAN>:
     <SPAN CLASS='keyword'>typedef</SPAN> <SPAN CLASS='keyword'>char</SPAN> char_type;
@@ -391,30 +309,18 @@
     <A CLASS="documented" HREF="#file_descriptor_constructor">file_descriptor</A>( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::in | std::ios_base::out );
- <A CLASS="documented" HREF="#file_descriptor_constructor">file_descriptor</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <A CLASS="documented" HREF="#file_descriptor_constructor">file_descriptor</A>( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <A CLASS="documented" HREF="#file_descriptor_constructor">file_descriptor</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <A CLASS="documented" HREF="#file_descriptor_constructor">file_descriptor</A>( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
     <SPAN CLASS="keyword">template</SPAN>&lt;<SPAN CLASS="keyword">typename</SPAN> Path&gt;
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_open">open</A>( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::in | std::ios_base::out );
- <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_open">open</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_open">open</A>( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_open">open</A>( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#file_descriptor_open">open</A>( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
     <SPAN CLASS="keyword">bool</SPAN> <A CLASS="documented" HREF="#file_descriptor_is_open">is_open</A>() <SPAN CLASS="keyword">const</SPAN>;
@@ -432,15 +338,9 @@
     file_descriptor( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::in | std::ios_base::out );
- file_descriptor( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- file_descriptor( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     file_descriptor( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     file_descriptor( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );</PRE>
 
 <P>
@@ -452,19 +352,11 @@
 </P>
 
 <P>
- The third member constructs a <CODE>file_descriptor</CODE> to access the file with the given operating system or runtime-library file descriptor.
- If the second argument is <CODE>close_handle</CODE>, the file descriptor is closed when the <CODE>file_descriptor</CODE> being constructed &#8212; or one of its copies &#8212; is closed or destructed.
+ The third member constructs a <CODE>file_descriptor</CODE> to access the file with the given operating system or runtime-library file descriptor. If the second argument is <CODE>true</CODE>, the file descriptor is closed when the new <CODE>file_descriptor</CODE> &#8212; or one of its copies &#8212; is closed.
 </P>
 
 <P>
- The fourth member is the same as the third, except that it accepts a Windows file handle instead of a file descriptor.
- If the second argument is <CODE>close_handle</CODE>, the file descriptor is closed when the new <CODE>file_descriptor</CODE> &#8212; or one of its copies &#8212; is closed or destructed.
-</P>
-
-<P>
- The deprecated members are there to provide backwards compatability with old versions.
- To use them you need to define <CODE>BOOST_IOSTREAMS_USE_DEPRECATED</CODE>.
- The descriptor is always closed by <CODE>close</CODE> but only closed in destructors if <CODE>close_on_exit</CODE> is <CODE>true</CODE>.
+ The fourth member is the same as the third, except that it accepts a Windows file handle instead of a file descriptor. If the second argument is <CODE>true</CODE>, the file descriptor is closed when the new <CODE>file_descriptor</CODE> &#8212; or one of its copies &#8212; is closed.
 </P>
 
 <A NAME="file_descriptor_open"></A>
@@ -474,21 +366,13 @@
     <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">const</SPAN> Path& pathname,
                      std::ios_base::open_mode mode =
                          std::ios_base::in | std::ios_base::out );
- <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Windows-only</SPAN>
- <SPAN CLASS="keyword">void</SPAN> open( HANDLE hFile, <SPAN CLASS="keyword">file_descriptor_flags</SPAN> );
-
- <SPAN CLASS='comment'>// Deprecated</SPAN>
     <SPAN CLASS="keyword">void</SPAN> open( <SPAN CLASS="keyword">int</SPAN> fd, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );
 
- <SPAN CLASS='comment'>// Deprecated, Windows-only</SPAN>
+ <SPAN CLASS='comment'>// Windows-only</SPAN>
     <SPAN CLASS="keyword">void</SPAN> open( HANDLE hFile, <SPAN CLASS="keyword">bool</SPAN> close_on_exit = <SPAN CLASS="keyword">false</SPAN> );</PRE>
 
 <P>
     The parameters of <CODE>open</CODE> the same as those of the corresponding constructors.
- If the file descriptor already holds a file, it'll be closed
- (unless opened or constructed with <CODE>never_close_handle</CODE>).
 </P>
 
 <A NAME="file_descriptor_is_open"></A>

Modified: branches/release/libs/iostreams/doc/release_notes.html
==============================================================================
--- branches/release/libs/iostreams/doc/release_notes.html (original)
+++ branches/release/libs/iostreams/doc/release_notes.html 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -14,23 +14,6 @@
 
 <!-- End Banner -->
 
-<h4>1.44</h4>
-
-<ul>
- <li>
- Lots of fixes, especially for compression and decompression, by Steven Watanabe.
- </li>
- <li>
- New constructors and <code>open</code> methods from file descriptors/handles for
- <code>file_descriptor</code>, <code>file_descriptor_source</code>
- and <code>file_descriptor_sink</code>. See
- <a title="File descriptor devices referece" href="classes/file_descriptor.html">the documentation</a>
- for details. The old methods are still available is you define
- <code>BOOST_IOSTREAMS_USE_DEPRECATED</code>
- (#3517).
- </li>
-</ul>
-
 <h4>1.43</h4>
 
 <p>
@@ -64,7 +47,7 @@
 <h4>1.42</h4>
 
 <p>
-Fixed many outstanding issues. Thanks to Richard Smith for working on a lot
+Fixed many outstanding issues. Thanks to Richard Smith for mworking on a lot
 of these changes.
 </p>
 

Modified: branches/release/libs/iostreams/src/file_descriptor.cpp
==============================================================================
--- branches/release/libs/iostreams/src/file_descriptor.cpp (original)
+++ branches/release/libs/iostreams/src/file_descriptor.cpp 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -48,28 +48,22 @@
 
 // Contains the platform dependant implementation
 struct file_descriptor_impl {
- // Note: These need to match file_desciptor_flags
- enum flags {
- never_close = 0,
- close_on_exit = 1,
- close_on_close = 2,
- close_always = 3
- };
-
     file_descriptor_impl();
     ~file_descriptor_impl();
- void open(file_handle fd, flags);
+ void open(file_handle fd, bool close_on_exit);
 #ifdef BOOST_IOSTREAMS_WINDOWS
- void open(int fd, flags);
+ void open(int fd, bool close_on_exit);
 #endif
     void open(const detail::path&, BOOST_IOS::openmode);
     bool is_open() const;
     void close();
- void close_impl(bool close_flag, bool throw_);
     std::streamsize read(char* s, std::streamsize n);
     std::streamsize write(const char* s, std::streamsize n);
     std::streampos seek(stream_offset off, BOOST_IOS::seekdir way);
     static file_handle invalid_handle();
+ enum flags {
+ close_on_exit = 1
+ };
     file_handle handle_;
     int flags_;
 };
@@ -82,38 +76,30 @@
 
 file_descriptor_impl::~file_descriptor_impl()
 {
- close_impl(flags_ & close_on_exit, false);
+ if (flags_ & close_on_exit) {
+ try {
+ close();
+ } catch (...) { }
+ }
 }
 
-void file_descriptor_impl::open(file_handle fd, flags f)
+void file_descriptor_impl::open(file_handle fd, bool close_on_exit)
 {
- // Using 'close' to close the existing handle so that it will throw an
- // exception if it fails.
- //
- // Only closing after assigning the new handle, so that the class will
- // take ownership of the handle regardless of whether close throws.
-
- file_descriptor_impl tmp;
- tmp.handle_ = handle_;
- tmp.flags_ = flags_ & close_on_exit ? close_on_close : never_close;
-
     handle_ = fd;
- flags_ = f;
-
- tmp.close();
+ flags_ = close_on_exit ?
+ file_descriptor_impl::close_on_exit :
+ 0;
 }
 
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
-void file_descriptor_impl::open(int fd, flags f)
-{ open(reinterpret_cast<file_handle>(_get_osfhandle(fd)), f); }
+void file_descriptor_impl::open(int fd, bool close_on_exit)
+{ open(reinterpret_cast<file_handle>(_get_osfhandle(fd)), close_on_exit); }
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
 
 void file_descriptor_impl::open(const detail::path& p, BOOST_IOS::openmode mode)
 {
- close_impl(flags_ & close_on_exit, true);
-
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
     DWORD dwDesiredAccess;
     DWORD dwCreationDisposition;
@@ -171,7 +157,7 @@
                        NULL ); // hTemplateFile
     if (handle != INVALID_HANDLE_VALUE) {
         handle_ = handle;
- flags_ = close_always;
+ flags_ |= close_on_exit;
     } else {
         flags_ = 0;
         throw_system_failure("failed opening file");
@@ -228,7 +214,7 @@
         boost::throw_exception(system_failure("failed opening file"));
     } else {
         handle_ = fd;
- flags_ = close_always;
+ flags_ = close_on_exit;
     }
 #endif // #ifndef BOOST_IOSTREAMS_WINDOWS //----------------------------------//
 }
@@ -238,21 +224,15 @@
 
 void file_descriptor_impl::close()
 {
- close_impl(flags_ & close_on_close, true);
-}
-
-void file_descriptor_impl::close_impl(bool close_flag, bool throw_) {
     if (handle_ != invalid_handle()) {
- if (close_flag) {
- bool success =
- #ifdef BOOST_IOSTREAMS_WINDOWS
- ::CloseHandle(handle_) == 1;
- #else
- BOOST_IOSTREAMS_FD_CLOSE(handle_) != -1;
- #endif
- if (!success && throw_)
- throw_system_failure("failed closing file");
- }
+ bool success =
+ #ifdef BOOST_IOSTREAMS_WINDOWS
+ ::CloseHandle(handle_) == 1;
+ #else
+ BOOST_IOSTREAMS_FD_CLOSE(handle_) != -1;
+ #endif
+ if (!success)
+ throw_system_failure("failed closing file");
         handle_ = invalid_handle();
         flags_ = 0;
     }
@@ -351,27 +331,15 @@
 
 file_descriptor::file_descriptor() : pimpl_(new impl_type) { }
 
-file_descriptor::file_descriptor(handle_type fd, file_descriptor_flags f)
- : pimpl_(new impl_type)
-{ open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 file_descriptor::file_descriptor(handle_type fd, bool close_on_exit)
     : pimpl_(new impl_type)
 { open(fd, close_on_exit); }
-#endif
 
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
-file_descriptor::file_descriptor(int fd, file_descriptor_flags f)
- : pimpl_(new impl_type)
-{ open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 file_descriptor::file_descriptor(int fd, bool close_on_exit)
     : pimpl_(new impl_type)
 { open(fd, close_on_exit); }
-#endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
 
@@ -389,27 +357,13 @@
     : pimpl_(other.pimpl_)
     { }
 
-void file_descriptor::open(handle_type fd, file_descriptor_flags f)
-{ pimpl_->open(fd, static_cast<detail::file_descriptor_impl::flags>(f)); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor::open(handle_type fd, bool close_on_exit)
-{ pimpl_->open(fd, close_on_exit ?
- detail::file_descriptor_impl::close_always :
- detail::file_descriptor_impl::close_on_close); }
-#endif
+{ pimpl_->open(fd, close_on_exit); }
 
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
-void file_descriptor::open(int fd, file_descriptor_flags f)
-{ pimpl_->open(fd, static_cast<detail::file_descriptor_impl::flags>(f)); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor::open(int fd, bool close_on_exit)
-{ pimpl_->open(fd, close_on_exit ?
- detail::file_descriptor_impl::close_always :
- detail::file_descriptor_impl::close_on_close); }
-#endif
+{ pimpl_->open(fd, close_on_exit); }
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
 
@@ -448,24 +402,13 @@
 //------------------Implementation of file_descriptor_source------------------//
 
 file_descriptor_source::file_descriptor_source(
- handle_type fd, file_descriptor_flags f)
-{ open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
-file_descriptor_source::file_descriptor_source(
     handle_type fd, bool close_on_exit)
 { open(fd, close_on_exit); }
-#endif
 
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
-file_descriptor_source::file_descriptor_source(int fd, file_descriptor_flags f)
-{ open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 file_descriptor_source::file_descriptor_source(int fd, bool close_on_exit)
 { open(fd, close_on_exit); }
-#endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
 
@@ -482,23 +425,13 @@
         : file_descriptor(static_cast<const file_descriptor&>(other))
     { }
 
-void file_descriptor_source::open(handle_type fd, file_descriptor_flags f)
-{ file_descriptor::open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor_source::open(handle_type fd, bool close_on_exit)
-{ file_descriptor::open(fd, close_on_exit); }
-#endif
+{ file_descriptor::open(fd, close_on_exit); }
 
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
-void file_descriptor_source::open(int fd, file_descriptor_flags f)
-{ file_descriptor::open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor_source::open(int fd, bool close_on_exit)
 { file_descriptor::open(fd, close_on_exit); }
-#endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
 
@@ -521,24 +454,13 @@
 //------------------Implementation of file_descriptor_sink--------------------//
 
 file_descriptor_sink::file_descriptor_sink(
- handle_type fd, file_descriptor_flags f)
-{ open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
-file_descriptor_sink::file_descriptor_sink(
     handle_type fd, bool close_on_exit)
 { open(fd, close_on_exit); }
-#endif
 
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
-file_descriptor_sink::file_descriptor_sink(int fd, file_descriptor_flags f)
-{ open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 file_descriptor_sink::file_descriptor_sink(int fd, bool close_on_exit)
 { open(fd, close_on_exit); }
-#endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
 
@@ -554,23 +476,13 @@
     : file_descriptor(static_cast<const file_descriptor&>(other))
     { }
 
-void file_descriptor_sink::open(handle_type fd, file_descriptor_flags f)
-{ file_descriptor::open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor_sink::open(handle_type fd, bool close_on_exit)
-{ file_descriptor::open(fd, close_on_exit); }
-#endif
+{ file_descriptor::open(fd, close_on_exit); }
 
 #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
 
-void file_descriptor_sink::open(int fd, file_descriptor_flags f)
-{ file_descriptor::open(fd, f); }
-
-#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
 void file_descriptor_sink::open(int fd, bool close_on_exit)
 { file_descriptor::open(fd, close_on_exit); }
-#endif
 
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//
 

Modified: branches/release/libs/iostreams/test/Jamfile.v2
==============================================================================
--- branches/release/libs/iostreams/test/Jamfile.v2 (original)
+++ branches/release/libs/iostreams/test/Jamfile.v2 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -20,7 +20,6 @@
             run
                 $(sources)
                 /boost/test//boost_unit_test_framework/<link>static
- /boost/filesystem//boost_filesystem/<link>static
             : # command
             : # input files
             : # build requirements
@@ -33,24 +32,6 @@
         ] ;
 }
 
-rule compile-fail-iostreams ( sources * : requirements * : target-name ? ) {
- return [
- compile-fail
- $(sources)
- /boost/test//boost_unit_test_framework/<link>static
- /boost/filesystem//boost_filesystem/<link>static
- : # build requirements
- <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
- <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
- <toolset>cw-9.3,<os>darwin:<runtime-link>static
- <define>BOOST_IOSTREAMS_NO_LIB
- <link>shared:<define>BOOST_IOSTREAMS_DYN_LINK=1
- $(requirements)
- : $(target-name)
- ] ;
-}
-
-
     local all-tests =
           [ test-iostreams array_test.cpp ]
           [ test-iostreams auto_close_test.cpp ]
@@ -70,12 +51,6 @@
           [ test-iostreams file_test.cpp ]
           [ test-iostreams file_descriptor_test.cpp
                 ../build//boost_iostreams ]
- [ test-iostreams deprecated_file_descriptor_test.cpp
- ../build//boost_iostreams
- : <define>BOOST_IOSTREAMS_USE_DEPRECATED ]
- [ compile-fail-iostreams deprecated_file_descriptor_test.cpp
- :
- : deprecated_file_descriptor_fail ]
           [ test-iostreams filtering_stream_test.cpp ]
           [ test-iostreams finite_state_filter_test.cpp ]
           [ test-iostreams flush_test.cpp ]

Deleted: branches/release/libs/iostreams/test/deprecated_file_descriptor_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/deprecated_file_descriptor_test.cpp 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
+++ (empty file)
@@ -1,239 +0,0 @@
-#include <boost/iostreams/device/file_descriptor.hpp>
-#include <boost/iostreams/stream.hpp>
-#include <boost/test/unit_test.hpp>
-#include "detail/temp_file.hpp"
-#include "detail/verification.hpp"
-#include "detail/file_handle.hpp"
-
-// Test file_descriptor with the depreacted constructors.
-
-namespace boost_ios = boost::iostreams;
-namespace ios_test = boost::iostreams::test;
-
-template <class FileDescriptor>
-void file_handle_test_impl(FileDescriptor*)
-{
- ios_test::test_file test1;
- ios_test::test_file test2;
-
- //--------------Deprecated file descriptor constructor--------------------//
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- {
- FileDescriptor device1(handle);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_OPEN(handle);
- ios_test::close_file_handle(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- {
- FileDescriptor device1(handle, false);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_OPEN(handle);
- ios_test::close_file_handle(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- {
- FileDescriptor device1(handle, true);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- FileDescriptor device1(handle);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- FileDescriptor device1(handle, false);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- FileDescriptor device1(handle, true);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- //--------------Deprecated file descriptor open---------------------------//
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- {
- FileDescriptor device1;
- device1.open(handle);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_OPEN(handle);
- ios_test::close_file_handle(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- {
- FileDescriptor device1;
- device1.open(handle, false);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_OPEN(handle);
- ios_test::close_file_handle(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- {
- FileDescriptor device1;
- device1.open(handle, true);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- FileDescriptor device1;
- device1.open(handle);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- FileDescriptor device1;
- device1.open(handle, false);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = ios_test::open_file_handle(test1.name());
- FileDescriptor device1;
- device1.open(handle, true);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- //--------------Deprecated open with existing descriptor------------------//
-
- {
- boost_ios::detail::file_handle handle1 = ios_test::open_file_handle(test1.name());
- boost_ios::detail::file_handle handle2 = ios_test::open_file_handle(test1.name());
-
- {
- FileDescriptor device1(handle1);
- BOOST_CHECK(device1.handle() == handle1);
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- device1.open(handle2);
- BOOST_CHECK(device1.handle() == handle2);
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- device1.close();
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_CLOSED(handle2);
- }
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_CLOSED(handle2);
-
- ios_test::close_file_handle(handle1);
- }
-
- {
- boost_ios::detail::file_handle handle1 = ios_test::open_file_handle(test1.name());
- boost_ios::detail::file_handle handle2 = ios_test::open_file_handle(test1.name());
-
- {
- FileDescriptor device1(handle1, true);
- BOOST_CHECK(device1.handle() == handle1);
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- device1.open(handle2);
- BOOST_CHECK(device1.handle() == handle2);
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- device1.close();
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_CLOSED(handle2);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_CLOSED(handle2);
- }
-
- {
- boost_ios::detail::file_handle handle1 = ios_test::open_file_handle(test1.name());
- boost_ios::detail::file_handle handle2 = ios_test::open_file_handle(test1.name());
-
- {
- FileDescriptor device1(handle1, false);
- BOOST_CHECK(device1.handle() == handle1);
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- device1.open(handle2, false);
- BOOST_CHECK(device1.handle() == handle2);
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- }
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
-
- ios_test::close_file_handle(handle1);
- ios_test::close_file_handle(handle2);
- }
-
- {
- boost_ios::detail::file_handle handle1 = ios_test::open_file_handle(test1.name());
- boost_ios::detail::file_handle handle2 = ios_test::open_file_handle(test1.name());
-
- {
- FileDescriptor device1(handle1, true);
- BOOST_CHECK(device1.handle() == handle1);
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- device1.open(handle2, true);
- BOOST_CHECK(device1.handle() == handle2);
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_CLOSED(handle2);
- }
-}
-
-void deprecated_file_descriptor_test()
-{
- file_handle_test_impl((boost_ios::file_descriptor*) 0);
- file_handle_test_impl((boost_ios::file_descriptor_sink*) 0);
- file_handle_test_impl((boost_ios::file_descriptor_source*) 0);
-}
-
-boost::unit_test::test_suite* init_unit_test_suite(int, char* [])
-{
- boost::unit_test::test_suite* test = BOOST_TEST_SUITE("deprecated file_descriptor test");
- test->add(BOOST_TEST_CASE(&deprecated_file_descriptor_test));
- return test;
-}

Deleted: branches/release/libs/iostreams/test/detail/file_handle.hpp
==============================================================================
--- branches/release/libs/iostreams/test/detail/file_handle.hpp 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
+++ (empty file)
@@ -1,108 +0,0 @@
-// (C) Copyright 2010 Daniel James
-// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
-// (C) Copyright 2003-2007 Jonathan Turkanis
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
-
-// A few methods for getting and manipulating file handles.
-
-#ifndef BOOST_IOSTREAMS_FILE_HANDLE_HPP_INCLUDED
-#define BOOST_IOSTREAMS_FILE_HANDLE_HPP_INCLUDED
-
-#include <boost/iostreams/detail/file_handle.hpp>
-#include <boost/iostreams/detail/config/rtl.hpp>
-#include <boost/test/test_tools.hpp>
-#include <string>
-
-#ifdef BOOST_IOSTREAMS_WINDOWS
-# include <io.h> // low-level file i/o.
-# define WINDOWS_LEAN_AND_MEAN
-# include <windows.h>
-#else
-# include <sys/stat.h>
-# include <fcntl.h>
-#endif
-
-namespace boost { namespace iostreams { namespace test {
-
-#ifdef BOOST_IOSTREAMS_WINDOWS
-
-// Windows implementation
-
-boost::iostreams::detail::file_handle open_file_handle(std::string const& name)
-{
- HANDLE handle =
- ::CreateFileA( name.c_str(),
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, // lpSecurityAttributes
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL ); // hTemplateFile
-
- BOOST_REQUIRE (handle != INVALID_HANDLE_VALUE);
- return handle;
-}
-
-void close_file_handle(boost::iostreams::detail::file_handle handle)
-{
- BOOST_REQUIRE(::CloseHandle(handle) == 1);
-}
-
-#define BOOST_CHECK_HANDLE_CLOSED(handle)
-#define BOOST_CHECK_HANDLE_OPEN(handle)
-
-#else // BOOST_IOSTREAMS_WINDOWS
-
-// Non-windows implementation
-
-boost::iostreams::detail::file_handle open_file_handle(std::string const& name)
-{
- int oflag = O_RDWR;
-
- #ifdef _LARGEFILE64_SOURCE
- oflag |= O_LARGEFILE;
- #endif
-
- // Calculate pmode argument to open.
-
- mode_t pmode = S_IRUSR | S_IWUSR |
- S_IRGRP | S_IWGRP |
- S_IROTH | S_IWOTH;
-
- // Open file.
-
- int fd = BOOST_IOSTREAMS_FD_OPEN(name.c_str(), oflag, pmode);
- BOOST_REQUIRE (fd != -1);
-
- return fd;
-}
-
-void close_file_handle(boost::iostreams::detail::file_handle handle)
-{
- BOOST_REQUIRE(BOOST_IOSTREAMS_FD_CLOSE(handle) != -1);
-}
-
-// This is pretty dubious. First you must make sure that no other
-// operations that could open a descriptor are called before this
-// check, otherwise it's quite likely that a closed descriptor
-// could be used. Secondly, I'm not sure if it's guaranteed that
-// fcntl will know that the descriptor is closed but this seems
-// to work okay, and I can't see any other convenient way to check
-// that a descripter has been closed.
-bool is_handle_open(boost::iostreams::detail::file_handle handle)
-{
- return ::fcntl(handle, F_GETFD) != -1;
-}
-
-#define BOOST_CHECK_HANDLE_CLOSED(handle) \
- BOOST_CHECK(!::boost::iostreams::test::is_handle_open(handle))
-#define BOOST_CHECK_HANDLE_OPEN(handle) \
- BOOST_CHECK(::boost::iostreams::test::is_handle_open(handle))
-
-
-#endif // BOOST_IOSTREAMS_WINDOWS
-
-}}}
-
-#endif // BOOST_IOSTREAMS_FILE_HANDLE_HPP_INCLUDED

Modified: branches/release/libs/iostreams/test/detail/temp_file.hpp
==============================================================================
--- branches/release/libs/iostreams/test/detail/temp_file.hpp (original)
+++ branches/release/libs/iostreams/test/detail/temp_file.hpp 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -13,7 +13,10 @@
 #include <cstdlib> // rand, toupper, tolower (VC6)
 #include <fstream>
 #include <string>
-#include <boost/filesystem/v3/operations.hpp>
+#if defined(__CYGWIN__)
+# include <boost/random/linear_congruential.hpp>
+# include <boost/random/uniform_smallint.hpp>
+#endif
 #include "./constants.hpp"
 
 #ifdef BOOST_NO_STDC_NAMESPACE
@@ -39,9 +42,33 @@
     operator const ::std::string() const { return name_; }
 private:
     void set_name() {
- name_ = boost::filesystem3::unique_path().string();
+ // Windows CreateFileMapping API function doesn't accept some
+ // names generated by std::tmpnam.
+ #if defined(_WIN32) || defined(__WIN32__) || \
+ defined(WIN32) || defined(__CYGWIN__) \
+ /**/
+ for (int z = 0; z < 5; ++z)
+ name_ += static_cast<char>('0' + rand());
+ #else
+ using namespace std;
+ char tmp[L_tmpnam]; name_ = tmpnam(tmp);
+ #endif
     }
-
+ #if defined(__CYGWIN__)
+ int rand()
+ {
+ static rand48 random_gen;
+ static uniform_smallint<int> random_dist(0, 9);
+ return random_dist(random_gen);
+ }
+ #else
+ # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+ int rand()
+ {
+ return (std::rand() * 10) / RAND_MAX;
+ }
+ # endif
+ #endif
     ::std::string name_;
 };
 

Modified: branches/release/libs/iostreams/test/file_descriptor_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/file_descriptor_test.cpp (original)
+++ branches/release/libs/iostreams/test/file_descriptor_test.cpp 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -6,19 +6,16 @@
 // See http://www.boost.org/libs/iostreams for documentation.
 
 #include <fstream>
-#include <fcntl.h>
 #include <boost/iostreams/device/file_descriptor.hpp>
 #include <boost/iostreams/stream.hpp>
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 #include "detail/temp_file.hpp"
 #include "detail/verification.hpp"
-#include "detail/file_handle.hpp"
 
 using namespace boost;
 using namespace boost::iostreams;
 using namespace boost::iostreams::test;
-namespace boost_ios = boost::iostreams;
 using std::ifstream;
 using boost::unit_test::test_suite;
 
@@ -83,7 +80,7 @@
         first->close();
         BOOST_CHECK(!first->is_open());
     }
-
+
     // test illegal flag combinations
     {
         BOOST_CHECK_THROW(
@@ -510,133 +507,9 @@
     }
 }
 
-template <class FileDescriptor>
-void file_handle_test_impl(FileDescriptor*)
-{
- test_file test1;
- test_file test2;
-
- {
- boost_ios::detail::file_handle handle = open_file_handle(test1.name());
- {
- FileDescriptor device1(handle, boost_ios::never_close_handle);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_OPEN(handle);
- close_file_handle(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = open_file_handle(test1.name());
- {
- FileDescriptor device1(handle, boost_ios::close_handle);
- BOOST_CHECK(device1.handle() == handle);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = open_file_handle(test1.name());
- FileDescriptor device1(handle, boost_ios::never_close_handle);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_OPEN(handle);
- close_file_handle(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = open_file_handle(test1.name());
- FileDescriptor device1(handle, boost_ios::close_handle);
- BOOST_CHECK(device1.handle() == handle);
- device1.close();
- BOOST_CHECK(!device1.is_open());
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-
- {
- boost_ios::detail::file_handle handle1 = open_file_handle(test1.name());
- boost_ios::detail::file_handle handle2 = open_file_handle(test2.name());
- {
- FileDescriptor device1(handle1, boost_ios::never_close_handle);
- BOOST_CHECK(device1.handle() == handle1);
- device1.open(handle2, boost_ios::never_close_handle);
- BOOST_CHECK(device1.handle() == handle2);
- }
- BOOST_CHECK_HANDLE_OPEN(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- close_file_handle(handle1);
- close_file_handle(handle2);
- }
-
- {
- boost_ios::detail::file_handle handle1 = open_file_handle(test1.name());
- boost_ios::detail::file_handle handle2 = open_file_handle(test2.name());
- {
- FileDescriptor device1(handle1, boost_ios::close_handle);
- BOOST_CHECK(device1.handle() == handle1);
- device1.open(handle2, boost_ios::close_handle);
- BOOST_CHECK(device1.handle() == handle2);
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_CLOSED(handle2);
- }
-
- {
- boost_ios::detail::file_handle handle1 = open_file_handle(test1.name());
- boost_ios::detail::file_handle handle2 = open_file_handle(test2.name());
- {
- FileDescriptor device1(handle1, boost_ios::close_handle);
- BOOST_CHECK(device1.handle() == handle1);
- device1.open(handle2, boost_ios::never_close_handle);
- BOOST_CHECK(device1.handle() == handle2);
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle1);
- BOOST_CHECK_HANDLE_OPEN(handle2);
- close_file_handle(handle2);
- }
-
- {
- boost_ios::detail::file_handle handle = open_file_handle(test1.name());
- {
- FileDescriptor device1;
- BOOST_CHECK(!device1.is_open());
- device1.open(handle, boost_ios::never_close_handle);
- BOOST_CHECK(device1.handle() == handle);
- BOOST_CHECK_HANDLE_OPEN(handle);
- }
- BOOST_CHECK_HANDLE_OPEN(handle);
- close_file_handle(handle);
- }
-
- {
- boost_ios::detail::file_handle handle = open_file_handle(test1.name());
- {
- FileDescriptor device1;
- BOOST_CHECK(!device1.is_open());
- device1.open(handle, boost_ios::close_handle);
- BOOST_CHECK(device1.handle() == handle);
- BOOST_CHECK_HANDLE_OPEN(handle);
- }
- BOOST_CHECK_HANDLE_CLOSED(handle);
- }
-}
-
-void file_handle_test()
-{
- file_handle_test_impl((boost_ios::file_descriptor*) 0);
- file_handle_test_impl((boost_ios::file_descriptor_source*) 0);
- file_handle_test_impl((boost_ios::file_descriptor_sink*) 0);
-}
-
 test_suite* init_unit_test_suite(int, char* [])
 {
     test_suite* test = BOOST_TEST_SUITE("file_descriptor test");
     test->add(BOOST_TEST_CASE(&file_descriptor_test));
- test->add(BOOST_TEST_CASE(&file_handle_test));
     return test;
 }

Modified: branches/release/libs/iostreams/test/tee_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/tee_test.cpp (original)
+++ branches/release/libs/iostreams/test/tee_test.cpp 2010-07-02 03:45:09 EDT (Fri, 02 Jul 2010)
@@ -22,6 +22,7 @@
 using namespace boost::iostreams;
 using namespace boost::iostreams::test;
 using boost::unit_test::test_suite;
+namespace io = boost::iostreams;
 
 void read_write_test()
 {
@@ -153,7 +154,7 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
+ io::tee(
                 closable_device<output>(seq.new_operation(1)),
                 closable_device<
                     #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
@@ -173,7 +174,7 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
+ io::tee(
                 closable_device<bidirectional>(
                     seq.new_operation(1),
                     seq.new_operation(2)
@@ -193,7 +194,7 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
+ io::tee(
                 closable_device<seekable>(seq.new_operation(1)),
                 closable_device<seekable>(seq.new_operation(2))
             )
@@ -206,7 +207,7 @@
     {
         operation_sequence seq;
         chain<output> ch;
- ch.push(boost::iostreams::tee(closable_device<output>(seq.new_operation(1))));
+ ch.push(io::tee(closable_device<output>(seq.new_operation(1))));
         ch.push(closable_device<output>(seq.new_operation(2)));
         BOOST_CHECK_NO_THROW(ch.reset());
         BOOST_CHECK_OPERATION_SEQUENCE(seq);
@@ -217,7 +218,7 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
+ io::tee(
                 closable_device<bidirectional>(
                     seq.new_operation(1),
                     seq.new_operation(2)
@@ -233,7 +234,7 @@
     {
         operation_sequence seq;
         chain<output> ch;
- ch.push(boost::iostreams::tee(closable_device<seekable>(seq.new_operation(1))));
+ ch.push(io::tee(closable_device<seekable>(seq.new_operation(1))));
         ch.push(closable_device<seekable>(seq.new_operation(2)));
         BOOST_CHECK_NO_THROW(ch.reset());
         BOOST_CHECK_OPERATION_SEQUENCE(seq);
@@ -250,8 +251,8 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
- boost::iostreams::compose(
+ io::tee(
+ io::compose(
                     closable_filter<output>(seq.new_operation(1)),
                     closable_device<output>(seq.new_operation(2))
                 ),
@@ -267,8 +268,8 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
- boost::iostreams::compose(
+ io::tee(
+ io::compose(
                     closable_filter<bidirectional>(
                         seq.new_operation(2),
                         seq.new_operation(3)
@@ -290,8 +291,8 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
- boost::iostreams::compose(
+ io::tee(
+ io::compose(
                     closable_filter<seekable>(seq.new_operation(1)),
                     closable_device<seekable>(seq.new_operation(2))
                 ),
@@ -308,8 +309,8 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
- boost::iostreams::compose(
+ io::tee(
+ io::compose(
                     closable_filter<output>(seq.new_operation(1)),
                     closable_device<output>(seq.new_operation(2))
                 )
@@ -325,8 +326,8 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
- boost::iostreams::compose(
+ io::tee(
+ io::compose(
                     closable_filter<bidirectional>(
                         seq.new_operation(2),
                         seq.new_operation(3)
@@ -348,8 +349,8 @@
         operation_sequence seq;
         chain<output> ch;
         ch.push(
- boost::iostreams::tee(
- boost::iostreams::compose(
+ io::tee(
+ io::compose(
                     closable_filter<seekable>(seq.new_operation(1)),
                     closable_device<seekable>(seq.new_operation(2))
                 )


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