Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55397 - in sandbox/filesystem-v3/boost/filesystem: . detail
From: bdawes_at_[hidden]
Date: 2009-08-04 06:27:28


Author: bemandawes
Date: 2009-08-04 06:27:27 EDT (Tue, 04 Aug 2009)
New Revision: 55397
URL: http://svn.boost.org/trac/boost/changeset/55397

Log:
Move path_traits.hpp from detail to filesystem
Added:
   sandbox/filesystem-v3/boost/filesystem/path_traits.hpp
      - copied unchanged from r55396, /sandbox/filesystem-v3/boost/filesystem/detail/path_traits.hpp
Removed:
   sandbox/filesystem-v3/boost/filesystem/detail/path_traits.hpp
Text files modified:
   sandbox/filesystem-v3/boost/filesystem/config.hpp | 4
   sandbox/filesystem-v3/boost/filesystem/fstream.hpp | 830 +++++++++++++++++----------------------
   sandbox/filesystem-v3/boost/filesystem/operations.hpp | 1
   sandbox/filesystem-v3/boost/filesystem/path.hpp | 27
   4 files changed, 381 insertions(+), 481 deletions(-)

Modified: sandbox/filesystem-v3/boost/filesystem/config.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/config.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/config.hpp 2009-08-04 06:27:27 EDT (Tue, 04 Aug 2009)
@@ -29,10 +29,6 @@
 
 // BOOST_POSIX_API or BOOST_WINDOWS_API specify which API to use
 
-#ifdef BOOST_WINDOWS_API
-# warning BOOST_WINDOWS_API defined
-#endif
-
 # if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API )
 # error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined
 # elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API )

Deleted: sandbox/filesystem-v3/boost/filesystem/detail/path_traits.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/detail/path_traits.hpp 2009-08-04 06:27:27 EDT (Tue, 04 Aug 2009)
+++ (empty file)
@@ -1,105 +0,0 @@
-// filesystem convert.hpp ------------------------------------------------------------//
-
-// Copyright Beman Dawes 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// Library home page: http://www.boost.org/libs/filesystem
-
-#ifndef BOOST_FILESYSTEM_CONVERT_HPP
-#define BOOST_FILESYSTEM_CONVERT_HPP
-
-#include <boost/filesystem/config.hpp>
-#include <string>
-#include <iterator>
-#include <boost/assert.hpp>
-#include <boost/system/error_code.hpp>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-namespace boost { namespace filesystem {
-
- typedef std::codecvt<wchar_t, char, std::mbstate_t> codecvt_type;
-
-namespace detail {
-
- // value types differ ---------------------------------------------------------------//
- //
- // A from_end argument of 0 is less efficient than a known end, so use only if needed
-
- BOOST_FILESYSTEM_DECL
- void convert( const char * from,
- const char * from_end, // 0 for null terminated MBCS
- std::wstring & to,
- const codecvt_type & cvt );
-
- BOOST_FILESYSTEM_DECL
- void convert( const wchar_t * from,
- const wchar_t * from_end, // 0 for null terminated MBCS
- std::string & to,
- const codecvt_type & cvt );
-
- inline
- void convert( const char * from,
- std::wstring & to,
- const codecvt_type & cvt )
- {
- BOOST_ASSERT( from );
- convert( from, 0, to, cvt );
- }
-
- inline
- void convert( const wchar_t * from,
- std::string & to,
- const codecvt_type & cvt )
- {
- BOOST_ASSERT( from );
- convert( from, 0, to, cvt );
- }
-
- // value types same -----------------------------------------------------------------//
-
- // char
-
- inline
- void convert( const char * from, const char * from_end, std::string & to,
- const codecvt_type & )
- {
- BOOST_ASSERT( from );
- BOOST_ASSERT( from_end );
- to.append( from, from_end );
- }
-
- inline
- void convert( const char * from,
- std::string & to,
- const codecvt_type & )
- {
- BOOST_ASSERT( from );
- to += from;
- }
-
- // wchar_t
-
- inline
- void convert( const wchar_t * from, const wchar_t * from_end, std::wstring & to,
- const codecvt_type & )
- {
- BOOST_ASSERT( from );
- BOOST_ASSERT( from_end );
- to.append( from, from_end );
- }
-
- inline
- void convert( const wchar_t * from,
- std::wstring & to,
- const codecvt_type & )
- {
- BOOST_ASSERT( from );
- to += from;
- }
-
-}}} // namespace boost::filesystem::detail
-
-#endif // BOOST_FILESYSTEM_CONVERT_HPP

Modified: sandbox/filesystem-v3/boost/filesystem/fstream.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/fstream.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/fstream.hpp 2009-08-04 06:27:27 EDT (Tue, 04 Aug 2009)
@@ -33,51 +33,51 @@
   {
     namespace detail
     {
-# if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY)
-# if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405
- // The 8.3 hack:
- // C++98 does not supply a wchar_t open, so try to get an equivalent
- // narrow char name based on the short, so-called 8.3, name.
- // Not needed for Dinkumware 405 and later as they do supply wchar_t open.
- BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
- std::ios_base::openmode mode ); // true if succeeds
- BOOST_FILESYSTEM_DECL std::string narrow_path_api(
- const std::wstring & ph ); // return is empty if fails
-
- inline std::string path_proxy( const std::wstring & file_ph,
- std::ios_base::openmode mode )
- // Return a non-existant path if cannot supply narrow short path.
- // An empty path doesn't work because some Dinkumware versions
- // assert the path is non-empty.
- {
- std::string narrow_ph;
- bool created_file( false );
- if ( !exists( file_ph )
- && (mode & std::ios_base::out) != 0
- && create_file_api( file_ph, mode ) )
- {
- created_file = true;
- }
- narrow_ph = narrow_path_api( file_ph );
- if ( narrow_ph.empty() )
- {
- if ( created_file ) remove_api( file_ph );
- narrow_ph = "\x01";
- }
- return narrow_ph;
- }
-# else
- // Dinkumware 405 and later does supply wchar_t functions
- inline const std::wstring & path_proxy( const std::wstring & file_ph,
- std::ios_base::openmode )
- { return file_ph; }
-# endif
-# endif
-
- inline const std::string & path_proxy( const std::string & file_ph,
- std::ios_base::openmode )
- { return file_ph; }
-
+//# if defined(BOOST_WINDOWS_API)
+//# if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405
+// // The 8.3 hack:
+// // C++98 does not supply a wchar_t open, so try to get an equivalent
+// // narrow char name based on the short, so-called 8.3, name.
+// // Not needed for Dinkumware 405 and later as they do supply wchar_t open.
+// BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
+// std::ios_base::openmode mode ); // true if succeeds
+// BOOST_FILESYSTEM_DECL std::string narrow_path_api(
+// const std::wstring & ph ); // return is empty if fails
+//
+// inline std::string path_proxy( const std::wstring & file_ph,
+// std::ios_base::openmode mode )
+// // Return a non-existant path if cannot supply narrow short path.
+// // An empty path doesn't work because some Dinkumware versions
+// // assert the path is non-empty.
+// {
+// std::string narrow_ph;
+// bool created_file( false );
+// if ( !exists( file_ph )
+// && (mode & std::ios_base::out) != 0
+// && create_file_api( file_ph, mode ) )
+// {
+// created_file = true;
+// }
+// narrow_ph = narrow_path_api( file_ph );
+// if ( narrow_ph.empty() )
+// {
+// if ( created_file ) remove_api( file_ph );
+// narrow_ph = "\x01";
+// }
+// return narrow_ph;
+// }
+//# else
+// // Dinkumware 405 and later does supply wchar_t functions
+// inline const std::wstring & path_proxy( const std::wstring & file_ph,
+// std::ios_base::openmode )
+// { return file_ph; }
+//# endif
+//# endif
+//
+// inline const std::string & path_proxy( const std::string & file_ph,
+// std::ios_base::openmode )
+// { return file_ph; }
+//
     } // namespace detail
 
     template < class charT, class traits = std::char_traits<charT> >
@@ -90,20 +90,8 @@
       basic_filebuf() {}
       virtual ~basic_filebuf() {}
 
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>,
- basic_filebuf<charT,traits> *>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
-
       basic_filebuf<charT,traits> *
- open( const wpath & file_ph, std::ios_base::openmode mode );
-# endif
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- basic_filebuf<charT,traits> *
- open( const path & file_ph, std::ios_base::openmode mode );
-# endif
+ open( const path & p, std::ios_base::openmode mode );
     };
 
     template < class charT, class traits = std::char_traits<charT> >
@@ -118,35 +106,13 @@
       // use two signatures, rather than one signature with default second
       // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
 
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- template<class Path>
- explicit basic_ifstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
-
- template<class Path>
- basic_ifstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
-
- explicit basic_ifstream( const wpath & file_ph );
- basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-# endif
-
- explicit basic_ifstream( const path & file_ph );
- basic_ifstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
+ explicit basic_ifstream( const path & p );
+
+ basic_ifstream( const path & p, std::ios_base::openmode mode );
+
+ void open( const path & p );
+ void open( const path & p, std::ios_base::openmode mode );
+
       virtual ~basic_ifstream() {}
     };
 
@@ -162,36 +128,13 @@
       // use two signatures, rather than one signature with default second
       // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
 
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
+ explicit basic_ofstream( const path & p );
+
+ basic_ofstream( const path & p, std::ios_base::openmode mode );
+
+ void open( const path & p );
+ void open( const path & p, std::ios_base::openmode mode );
 
- template<class Path>
- explicit basic_ofstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- explicit basic_ofstream( const wpath & file_ph );
-
- template<class Path>
- basic_ofstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
- void open( const wpath & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-
-# endif
-
- explicit basic_ofstream( const path & file_ph );
- basic_ofstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
       virtual ~basic_ofstream() {}
     };
 
@@ -207,36 +150,13 @@
       // use two signatures, rather than one signature with default second
       // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
 
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
+ explicit basic_fstream( const path & p );
+
+ basic_fstream( const path & p, std::ios_base::openmode mode );
+
+ void open( const path & p );
+ void open( const path & p, std::ios_base::openmode mode );
 
- template<class Path>
- explicit basic_fstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- explicit basic_fstream( const wpath & file_ph );
-
- template<class Path>
- basic_fstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- basic_fstream( const wpath & file_ph, std::ios_base::openmode mode );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
- void open( const wpath & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-
-# endif
-
- explicit basic_fstream( const path & file_ph );
- basic_fstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
       virtual ~basic_fstream() {}
 
     };
@@ -246,337 +166,321 @@
     typedef basic_ofstream<char> ofstream;
     typedef basic_fstream<char> fstream;
 
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
     typedef basic_filebuf<wchar_t> wfilebuf;
     typedef basic_ifstream<wchar_t> wifstream;
     typedef basic_fstream<wchar_t> wfstream;
     typedef basic_ofstream<wchar_t> wofstream;
-# endif
     
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
-
 // basic_filebuf definitions ---------------------------------------------------------//
 
     template <class charT, class traits>
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>,
- basic_filebuf<charT,traits> *>::type
- basic_filebuf<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(
- file_ph.external_file_string(), mode ).c_str(), mode )
- == 0) ? 0 : this;
- }
-
- template <class charT, class traits>
- basic_filebuf<charT,traits> *
- basic_filebuf<charT, traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );
- }
-
-// basic_ifstream definitions --------------------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits> template<class Path>
- basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ifstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ifstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in );
- }
-
-// basic_ofstream definitions --------------------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ofstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ofstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out );
- }
-
-// basic_fstream definitions ---------------------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_fstream<charT,traits>::basic_fstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- basic_fstream<charT,traits>::basic_fstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_fstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_fstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
- }
-
-# endif
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
     basic_filebuf<charT,traits> *
- basic_filebuf<charT, traits>::open( const path & file_ph,
+ basic_filebuf<charT, traits>::open( const path & p,
       std::ios_base::openmode mode )
     {
- return std::basic_filebuf<charT,traits>::open(
- file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
+ return this->open( p.c_str(), mode );
     }
-# endif
 
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph )
- : std::basic_ifstream<charT,traits>(
- file_ph.file_string().c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ifstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph )
- : std::basic_ofstream<charT,traits>(
- file_ph.file_string().c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ofstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const path & file_ph )
- : std::basic_fstream<charT,traits>(
- file_ph.file_string().c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_fstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
+//// basic_ifstream definitions --------------------------------------------------------//
+//
+// template <class charT, class traits> template<class Path>
+// basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph,
+// typename boost::enable_if<is_basic_path<Path> >::type* )
+// : std::basic_ifstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in ).c_str(), std::ios_base::in ) {}
+//
+// template <class charT, class traits>
+// basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph )
+// : std::basic_ifstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in ).c_str(), std::ios_base::in ) {}
+//
+// template <class charT, class traits> template<class Path>
+// basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
+// std::ios_base::openmode mode,
+// typename boost::enable_if<is_basic_path<Path> >::type* )
+// : std::basic_ifstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in ) {}
+//
+// template <class charT, class traits>
+// basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph,
+// std::ios_base::openmode mode )
+// : std::basic_ifstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in ) {}
+//
+// template <class charT, class traits> template<class Path>
+// typename boost::enable_if<is_basic_path<Path>, void>::type
+// basic_ifstream<charT,traits>::open( const Path & file_ph )
+// {
+// std::basic_ifstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in ).c_str(), std::ios_base::in );
+// }
+//
+// template <class charT, class traits>
+// void basic_ifstream<charT,traits>::open( const wpath & file_ph )
+// {
+// std::basic_ifstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in ).c_str(), std::ios_base::in );
+// }
+//
+// template <class charT, class traits> template<class Path>
+// typename boost::enable_if<is_basic_path<Path>, void>::type
+// basic_ifstream<charT,traits>::open( const Path & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_ifstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in );
+// }
+//
+// template <class charT, class traits>
+// void basic_ifstream<charT,traits>::open( const wpath & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_ifstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in );
+// }
+//
+//// basic_ofstream definitions --------------------------------------------------------//
+//
+// template <class charT, class traits> template<class Path>
+// basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph,
+// typename boost::enable_if<is_basic_path<Path> >::type* )
+// : std::basic_ofstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::out ).c_str(), std::ios_base::out ) {}
+//
+// template <class charT, class traits>
+// basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph )
+// : std::basic_ofstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::out ).c_str(), std::ios_base::out ) {}
+//
+// template <class charT, class traits> template<class Path>
+// basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph,
+// std::ios_base::openmode mode,
+// typename boost::enable_if<is_basic_path<Path> >::type* )
+// : std::basic_ofstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::out ) {}
+//
+// template <class charT, class traits>
+// basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph,
+// std::ios_base::openmode mode )
+// : std::basic_ofstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::out ) {}
+//
+// template <class charT, class traits> template<class Path>
+// typename boost::enable_if<is_basic_path<Path>, void>::type
+// basic_ofstream<charT,traits>::open( const Path & file_ph )
+// {
+// std::basic_ofstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::out ).c_str(), std::ios_base::out );
+// }
+//
+// template <class charT, class traits>
+// void basic_ofstream<charT,traits>::open( const wpath & file_ph )
+// {
+// std::basic_ofstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::out ).c_str(), std::ios_base::out );
+// }
+//
+// template <class charT, class traits> template<class Path>
+// typename boost::enable_if<is_basic_path<Path>, void>::type
+// basic_ofstream<charT,traits>::open( const Path & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_ofstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::out );
+// }
+//
+// template <class charT, class traits>
+// void basic_ofstream<charT,traits>::open( const wpath & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_ofstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::out );
+// }
+//
+//// basic_fstream definitions ---------------------------------------------------------//
+//
+// template <class charT, class traits> template<class Path>
+// basic_fstream<charT,traits>::basic_fstream(const Path & file_ph,
+// typename boost::enable_if<is_basic_path<Path> >::type* )
+// : std::basic_fstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in|std::ios_base::out ).c_str(),
+// std::ios_base::in|std::ios_base::out ) {}
+//
+// template <class charT, class traits>
+// basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph )
+// : std::basic_fstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in|std::ios_base::out ).c_str(),
+// std::ios_base::in|std::ios_base::out ) {}
+//
+// template <class charT, class traits> template<class Path>
+// basic_fstream<charT,traits>::basic_fstream( const Path & file_ph,
+// std::ios_base::openmode mode,
+// typename boost::enable_if<is_basic_path<Path> >::type* )
+// : std::basic_fstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
+//
+// template <class charT, class traits>
+// basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
+// std::ios_base::openmode mode )
+// : std::basic_fstream<charT,traits>(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
+//
+// template <class charT, class traits> template<class Path>
+// typename boost::enable_if<is_basic_path<Path>, void>::type
+// basic_fstream<charT,traits>::open( const Path & file_ph )
+// {
+// std::basic_fstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in|std::ios_base::out ).c_str(),
+// std::ios_base::in|std::ios_base::out );
+// }
+//
+// template <class charT, class traits>
+// void basic_fstream<charT,traits>::open( const wpath & file_ph )
+// {
+// std::basic_fstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// std::ios_base::in|std::ios_base::out ).c_str(),
+// std::ios_base::in|std::ios_base::out );
+// }
+//
+// template <class charT, class traits> template<class Path>
+// typename boost::enable_if<is_basic_path<Path>, void>::type
+// basic_fstream<charT,traits>::open( const Path & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_fstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
+// }
+//
+// template <class charT, class traits>
+// void basic_fstream<charT,traits>::open( const wpath & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_fstream<charT,traits>::open(
+// detail::path_proxy( file_ph.external_file_string(),
+// mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
+// }
+//
+//
+//
+//# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
+// template <class charT, class traits>
+// basic_filebuf<charT,traits> *
+// basic_filebuf<charT, traits>::open( const path & file_ph,
+// std::ios_base::openmode mode )
+// {
+// return std::basic_filebuf<charT,traits>::open(
+// file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
+// }
+//# endif
+//
+// template <class charT, class traits>
+// basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph )
+// : std::basic_ifstream<charT,traits>(
+// file_ph.file_string().c_str(), std::ios_base::in ) {}
+//
+// template <class charT, class traits>
+// basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph,
+// std::ios_base::openmode mode )
+// : std::basic_ifstream<charT,traits>(
+// file_ph.file_string().c_str(), mode ) {}
+//
+//# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
+// template <class charT, class traits>
+// void basic_ifstream<charT,traits>::open( const path & file_ph )
+// {
+// std::basic_ifstream<charT,traits>::open(
+// file_ph.file_string().c_str(), std::ios_base::in );
+// }
+//
+// template <class charT, class traits>
+// void basic_ifstream<charT,traits>::open( const path & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_ifstream<charT,traits>::open(
+// file_ph.file_string().c_str(), mode );
+// }
+//# endif
+//
+// template <class charT, class traits>
+// basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph )
+// : std::basic_ofstream<charT,traits>(
+// file_ph.file_string().c_str(), std::ios_base::out ) {}
+//
+// template <class charT, class traits>
+// basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph,
+// std::ios_base::openmode mode )
+// : std::basic_ofstream<charT,traits>(
+// file_ph.file_string().c_str(), mode ) {}
+//
+//# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
+// template <class charT, class traits>
+// void basic_ofstream<charT,traits>::open( const path & file_ph )
+// {
+// std::basic_ofstream<charT,traits>::open(
+// file_ph.file_string().c_str(), std::ios_base::out );
+// }
+//
+// template <class charT, class traits>
+// void basic_ofstream<charT,traits>::open( const path & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_ofstream<charT,traits>::open(
+// file_ph.file_string().c_str(), mode );
+// }
+//# endif
+//
+// template <class charT, class traits>
+// basic_fstream<charT,traits>::basic_fstream( const path & file_ph )
+// : std::basic_fstream<charT,traits>(
+// file_ph.file_string().c_str(),
+// std::ios_base::in|std::ios_base::out ) {}
+//
+//
+// template <class charT, class traits>
+// basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
+// std::ios_base::openmode mode )
+// : std::basic_fstream<charT,traits>(
+// file_ph.file_string().c_str(), mode ) {}
+//
+//# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
+// template <class charT, class traits>
+// void basic_fstream<charT,traits>::open( const path & file_ph )
+// {
+// std::basic_fstream<charT,traits>::open(
+// file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
+// }
+//
+// template <class charT, class traits>
+// void basic_fstream<charT,traits>::open( const path & file_ph,
+// std::ios_base::openmode mode )
+// {
+// std::basic_fstream<charT,traits>::open(
+// file_ph.file_string().c_str(), mode );
+// }
+//# endif
   } // namespace filesystem
 } // namespace boost
 

Modified: sandbox/filesystem-v3/boost/filesystem/operations.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/operations.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/operations.hpp 2009-08-04 06:27:27 EDT (Tue, 04 Aug 2009)
@@ -14,6 +14,7 @@
 /*
 * TODO List
 *
+* Review all operations.cpp code for race conditions similar to #2925. Fix or document.
 * Scoped enum workaround for file_type.
 * Enable all BOOST_FILESYSTEM_NO_DEPRECATED code.
 * Vista symlink_status support.

Modified: sandbox/filesystem-v3/boost/filesystem/path.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/path.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/path.hpp 2009-08-04 06:27:27 EDT (Tue, 04 Aug 2009)
@@ -34,9 +34,14 @@
    * path_unit_test needs to probe error handling, verify exceptions are thrown when
      requested.
    * Provide the name check functions for more character types? Templatize?
+ * Why do native() and generic() return paths rather than const strings/string refs?
+ Either change or document rationale.
      
                          Design Questions
 
+ * Could sentinel_iterator be used to reduce number of overloads?
+ * Should append be changed to convert, and use back_inserter to append?
+
    * Should path_locale use thread local storage?
    * Will locale overloads be needed in practice?
    * Is it OK for single-element decomposition functions to return paths? Yes;
@@ -136,7 +141,7 @@
 // path_traits //
 // //
 // Specializations are provided for char, wchar_t, char16_t, and char32_t value //
-// types and their related string and iterator types . //
+// types and their related string and iterator types. //
 // //
 // Users are permitted to add specializations for additional types. //
 // //
@@ -350,26 +355,21 @@
     path( const path & p ) : m_path(p.m_path) {} // #2
 
     // construct from null terminated sequence
-
     template< class InputIterator >
       path( InputIterator begin,
         system::error_code & ec = boost::throws(),
         typename boost::enable_if<path_traits::is_iterator<InputIterator> >::type* dummy=0 ) // #3
           { m_append( begin, m_path, ec ); }
 
- // construct from (potentially) multi-byte character string, which may have
- // embedded nulls. Embedded null support is required for some Asian languages on
- // Windows.
-
+ // construct from (potentially) multi-byte character string, which may have embedded
+ // nulls. Embedded null support is required for some Asian languages on Windows.
     template< class ForwardIterator >
       path( ForwardIterator begin, ForwardIterator end,
         system::error_code & ec = boost::throws() ) // #4
           { m_append( begin, end, m_path, ec ); }
 
- // construct from container of (potentially) multi-byte character string,
- // which may have embedded nulls. Embedded null support is required for
- // some Asian languages on Windows.
-
+ // construct from container of (potentially) multi-byte chars, which may have embedded
+ // nulls. Embedded null support is required for some Asian languages on Windows.
     template< class Container >
       path( const Container & ctr,
         system::error_code & ec = boost::throws(),
@@ -513,11 +513,11 @@
     // For POSIX, these are all the same format; slashes and backslashes are not modified.
     //
     // For Windows, native: slashes are converted to backslashes
- // generic: backslashes are converted to backslashes
+ // generic: backslashes are converted to slashes
     // source: slashes and backslashes are not modified
 
     template< class T >
- T string( system::error_code & ec = boost::throws() ) const // source format
+ T string( system::error_code & ec = boost::throws() ) const // source (i.e. original) format
     {
       return path_traits::convert<T>( m_path, ec );
     }
@@ -542,7 +542,6 @@
     
 # ifdef BOOST_WINDOWS_PATH
 
-
     const path native() const; // native format
     const path generic() const; // generic format
 
@@ -557,7 +556,7 @@
 
     // c_str() returns a C string suitable for calls to the operating system API.
     // On POSIX and Windows that's source format, on some OS's it may be native format.
- const value_type * c_str() const { return m_path.c_str(); } //
+ const value_type * c_str() const { return m_path.c_str(); }
 
     // ----- decomposition -----
 


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