Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62344 - in sandbox/filesystem-v3: boost/filesystem libs/filesystem/doc libs/filesystem/example libs/filesystem/src libs/filesystem/test
From: bdawes_at_[hidden]
Date: 2010-05-31 10:03:36


Author: bemandawes
Date: 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
New Revision: 62344
URL: http://svn.boost.org/trac/boost/changeset/62344

Log:
Remove BOOST_WINDOWS_PATH and BOOST_POSIX_PATH. Makes library easier to understand, reason about, test, explain.
Text files modified:
   sandbox/filesystem-v3/boost/filesystem/config.hpp | 8 ------
   sandbox/filesystem-v3/boost/filesystem/path.hpp | 6 ++--
   sandbox/filesystem-v3/libs/filesystem/doc/do_list.html | 6 +---
   sandbox/filesystem-v3/libs/filesystem/doc/index.htm | 27 +++++--------------------
   sandbox/filesystem-v3/libs/filesystem/example/path_info.cpp | 4 +-
   sandbox/filesystem-v3/libs/filesystem/src/operations.cpp | 2
   sandbox/filesystem-v3/libs/filesystem/src/path.cpp | 41 ++++++++++++++++++---------------------
   sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp | 8 +++---
   sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp | 8 +++---
   sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp | 26 ++++++++++++------------
   10 files changed, 55 insertions(+), 81 deletions(-)

Modified: sandbox/filesystem-v3/boost/filesystem/config.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/config.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/config.hpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -43,13 +43,7 @@
 #define BOOST_FILESYSTEM_THROW(EX) throw EX
 
 # if defined( BOOST_NO_STD_WSTRING )
-# error Boost.Filesystem V3 and later requires std::wstring support
-# endif
-
-# ifdef BOOST_WINDOWS_API
-# define BOOST_WINDOWS_PATH
-# else
-# define BOOST_POSIX_PATH
+# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
 # endif
 
 // enable dynamic linking -------------------------------------------------------------//

Modified: sandbox/filesystem-v3/boost/filesystem/path.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/path.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/path.hpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -208,9 +208,9 @@
     void clear() { m_pathname.clear(); }
     path& make_absolute(const path& base);
     path& make_preferred()
-# ifdef BOOST_POSIX_PATH
+# ifdef BOOST_POSIX_API
                                { return *this; } // POSIX no effect
-# else // BOOST_WINDOWS_PATH
+# else // BOOST_WINDOWS_API
                                ; // change slashes to backslashes
 # endif
     path& remove_filename();
@@ -301,7 +301,7 @@
     bool has_extension() const { return !extension().empty(); }
     bool is_absolute() const
     {
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
       return has_root_name() && has_root_directory();
 # else
       return has_root_directory();

Modified: sandbox/filesystem-v3/libs/filesystem/doc/do_list.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/do_list.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/do_list.html 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -16,7 +16,7 @@
 <body>
 
 <h1>Boost Filesystem Do List<br>
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->05 March 2010<!--webbot bot="Timestamp" endspan i-checksum="27230" --></h1>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->31 May 2010<!--webbot bot="Timestamp" endspan i-checksum="15103" --></h1>
 
 <h2>Beta 1 comments</h2>
 <ul>
@@ -123,7 +123,7 @@
   <li>Review all operations.cpp code for race conditions similar to #2925. Fix
   or document.</li>
   <li>Enable all BOOST_FILESYSTEM_NO_DEPRECATED code.</li>
- <li>rename and remove really need to be renamed. If users says &quot;using
+ <li>rename and remove names are problems. If users says &quot;using
   namespace boost::filesystem&quot;<br>
   and some header included stdio, there is just too much chance of silent error.</li>
   <li>create_directories error handling needs work.</li>
@@ -131,12 +131,10 @@
   <li>Two argument recursive_directory_iterator ctor isn't recognizing throws().
   Would it be better to fold into a single two argument ctor with default?</li>
   <li>Add the push_directory class from tools/release/required_files.cpp</li>
- <li>directory_entry needs relational operators?</li>
 </ul>
 
 <h3>Miscellaneous</h3>
 <ul>
- <li style="font-size: 10pt">directory_entry needs relationals.</li>
   <li style="font-size: 10pt"><i>Regular</i> classes need hash functions.</li>
 </ul>
 

Modified: sandbox/filesystem-v3/libs/filesystem/doc/index.htm
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/index.htm (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/index.htm 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -251,20 +251,6 @@
     <td valign="top">Deprecated features are excluded from headers.</td>
   </tr>
   <tr>
- <td valign="top"><code>BOOST_WINDOWS_API</code></td>
- <td valign="top">Defined if Windows is detected by Boost.System's automatic configuration
- code, otherwise not defined.</td>
- <td valign="top">Implementation uses the Microsoft Windows native
- application program interface (API).</td>
- </tr>
- <tr>
- <td valign="top"><code>BOOST_POSIX_API</code></td>
- <td valign="top">Defined if Windows is not detected by Boost.System's automatic configuration
- code.</td>
- <td valign="top">Implementation uses the POSIX native
- application program interface (API).</td>
- </tr>
- <tr>
     <td valign="top"><code>BOOST_FILESYSTEM_DYN_LINK</code></td>
     <td valign="top">Defined if <code>BOOST_ALL_DYN_LINK</code> is defined,
     otherwise not defined.</td>
@@ -279,6 +265,8 @@
     facility.</td>
   </tr>
   </table>
+<p>User-defined BOOST_POSIX_API and BOOST_WINDOWS_API macros are no longer
+supported.</p>
 <h2><a name="Building">Building</a> the object-library</h2>
 <p>The object-library will be built automatically if you are using the Boost
 build system. See
@@ -299,12 +287,9 @@
 Compilation</a> page for a description of the techniques used.</p>
 <h3>Note for <a name="Cgywin">Cygwin</a> users</h3>
 <p> Cygwin version 1.7 or later is
-required. The current platform (POSIX emulation via Cygwin, or Windows via MinGW)
-is detected automatically. Automatic
-platform detection during object library compilation can be overridden by
-defining either BOOST_POSIX_API or BOOST_WINDOWS_API macros. There is usually no reason to define these macros, as the
-software development kits supplied with most compilers only support a single
-platform.</p>
+required. Only later versions of GCC with wide character strings are supported.
+The library's implementation code treats Cygwin as a Windows platform, and thus
+uses the Windows API.</p>
 
 <h2><a name="Change-history">Version history</a></h2>
 
@@ -443,7 +428,7 @@
 
 <hr>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 March, 2010<!--webbot bot="Timestamp" endspan i-checksum="28754" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->31 May, 2010<!--webbot bot="Timestamp" endspan i-checksum="13955" --></p>
 
 <p>&copy; Copyright Beman Dawes, 2002-2005</p>
 <p> Use, modification, and distribution are subject to the Boost Software

Modified: sandbox/filesystem-v3/libs/filesystem/example/path_info.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/example/path_info.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/example/path_info.cpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -20,9 +20,9 @@
   {
     cout << "Usage: path_info path-portion...\n"
              "Example: path_info foo/bar baz\n"
-# ifdef BOOST_POSIX_PATH
+# ifdef BOOST_POSIX_API
              " would report info about the composed path foo/bar/baz\n";
-# else // BOOST_WINDOWS_PATH
+# else // BOOST_WINDOWS_API
              " would report info about the composed path foo/bar\\baz\n";
 # endif
     return 1;

Modified: sandbox/filesystem-v3/libs/filesystem/src/operations.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/src/operations.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/src/operations.cpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -214,7 +214,7 @@
 namespace
 {
 
-# ifdef BOOST_POSIX_PATH
+# ifdef BOOST_POSIX_API
   const char dot = '.';
 # else
   const wchar_t dot = L'.';

Modified: sandbox/filesystem-v3/libs/filesystem/src/path.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/src/path.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/src/path.cpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -22,6 +22,7 @@
 
 #ifdef BOOST_WINDOWS_API
 # include "windows_file_codecvt.hpp"
+# include <windows.h>
 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
 # include "utf8_codecvt_facet.hpp"
 #endif
@@ -31,10 +32,6 @@
 # include <iomanip>
 #endif
 
-#ifdef BOOST_WINDOWS_PATH
-# include <windows.h>
-#endif
-
 namespace fs = boost::filesystem;
 
 using fs::path;
@@ -66,7 +63,7 @@
 
   const std::size_t default_codecvt_buf_size = BOOST_FILESYSTEM_CODECVT_BUF_SIZE;
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
 
   const wchar_t separator = L'/';
   const wchar_t preferred_separator = L'\\';
@@ -95,7 +92,7 @@
   inline bool is_separator(fs::path::value_type c)
   {
     return c == separator
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
       || c == preferred_separator
 # endif
       ;
@@ -145,7 +142,7 @@
     return *this;
   }
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
 
   const std::string path::string() const
   {
@@ -180,14 +177,14 @@
     return tmp.wstring();
   }
 
-# endif // BOOST_WINDOWS_PATH
+# endif // BOOST_WINDOWS_API
 
   // m_append_separator_if_needed ----------------------------------------------------//
 
   path::string_type::size_type path::m_append_separator_if_needed()
   {
     if (!m_pathname.empty() &&
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
       *(m_pathname.end()-1) != colon &&
 # endif
       !is_separator(*(m_pathname.end()-1)))
@@ -206,7 +203,7 @@
     if (sep_pos // a separator was added
       && sep_pos < m_pathname.size() // and something was appended
       && (m_pathname[sep_pos+1] == separator // and it was also separator
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
        || m_pathname[sep_pos+1] == preferred_separator // or preferred_separator
 # endif
 )) { m_pathname.erase(sep_pos, 1); } // erase the added separator
@@ -221,7 +218,7 @@
     path base_root_name (base.root_name());
     path this_root_directory (root_directory());
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     BOOST_ASSERT(!this_root_name.empty() || !base_root_name.empty());
 # endif
 
@@ -243,7 +240,7 @@
 
     else if (has_root_directory())
     {
-# ifdef BOOST_POSIX_PATH
+# ifdef BOOST_POSIX_API
       if (base_root_name.empty()) return *this;
 # endif
       path tmp (base_root_name / m_pathname);
@@ -259,7 +256,7 @@
     return *this;
   }
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
   path & path::make_preferred()
   {
     for (string_type::iterator it = m_pathname.begin();
@@ -312,7 +309,7 @@
             && is_separator(itr.m_element.m_pathname[0])
             && is_separator(itr.m_element.m_pathname[1])
    )
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
         || itr.m_element.m_pathname[itr.m_element.m_pathname.size()-1] == colon
 # endif
   ))
@@ -335,7 +332,7 @@
 
     for (; itr.m_pos != m_pathname.size()
       && (is_separator(itr.m_element.m_pathname[0])
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
       || itr.m_element.m_pathname[itr.m_element.m_pathname.size()-1] == colon
 # endif
     ); ++itr) {}
@@ -435,7 +432,7 @@
           && (lf.size() != 2
             || (lf[0] != dot
               && lf[1] != dot
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
               && lf[1] != colon
 # endif
                )
@@ -497,7 +494,7 @@
     return pos != 0
       && (pos <= 2 || !is_separator(str[1])
         || str.find_first_of(separators, 2) != pos)
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
       && (pos !=2 || str[1] != colon)
 # endif
         ;
@@ -521,7 +518,7 @@
     // set pos to start of last element
     size_type pos(str.find_last_of(separators, end_pos-1));
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     if (pos == string_type::npos)
       pos = str.find_last_of(colon, end_pos-2);
 # endif
@@ -538,7 +535,7 @@
   // return npos if no root_directory found
   {
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     // case "c:/"
     if (size > 2
       && path[1] == colon
@@ -613,7 +610,7 @@
 
     // find the end
     while (cur < size
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
       && src[cur] != colon
 # endif
       && !is_separator(src[cur]))
@@ -622,7 +619,7 @@
       ++element_size;
     }
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     if (cur == size) return;
     // include device delimiter
     if (src[cur] == colon)
@@ -690,7 +687,7 @@
     {
       // detect root directory
       if (was_net
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
         // case "c:/"
         || it.m_element.m_pathname[it.m_element.m_pathname.size()-1] == colon
 # endif

Modified: sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -1176,11 +1176,11 @@
 #ifdef BOOST_WINDOWS_API
   std::cout << "BOOST_WINDOWS_API is defined\n";
 #endif
-#ifdef BOOST_POSIX_PATH
- std::cout << "BOOST_POSIX_PATH is defined\n";
+#ifdef BOOST_POSIX_API
+ std::cout << "BOOST_POSIX_API is defined\n";
 #endif
-#ifdef BOOST_WINDOWS_PATH
- std::cout << "BOOST_WINDOWS_PATH is defined\n";
+#ifdef BOOST_WINDOWS_API
+ std::cout << "BOOST_WINDOWS_API is defined\n";
 #endif
 
   if (argc > 1 && *argv[1]=='-' && *(argv[1]+1)=='t') report_throws = true;

Modified: sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -204,11 +204,11 @@
 #ifdef BOOST_WINDOWS_API
   cout << "BOOST_WINDOWS_API is defined\n";
 #endif
-#ifdef BOOST_POSIX_PATH
- cout << "BOOST_POSIX_PATH is defined\n";
+#ifdef BOOST_POSIX_API
+ cout << "BOOST_POSIX_API is defined\n";
 #endif
-#ifdef BOOST_WINDOWS_PATH
- cout << "BOOST_WINDOWS_PATH is defined\n";
+#ifdef BOOST_WINDOWS_API
+ cout << "BOOST_WINDOWS_API is defined\n";
 #endif
   cout << "BOOST_FILESYSTEM_DECL" << BOOST_STRINGIZE(=BOOST_FILESYSTEM_DECL) << "\n";
   cout << "BOOST_SYMBOL_VISIBLE" << BOOST_STRINGIZE(=BOOST_SYMBOL_VISIBLE) << "\n";

Modified: sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp 2010-05-31 10:03:33 EDT (Mon, 31 May 2010)
@@ -218,11 +218,11 @@
   {
     std::cout << "testing appends..." << std::endl;
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
 # define BOOST_FS_FOO L"/foo\\"
-# else // POSIX paths
+# else // POSIX paths
 # define BOOST_FS_FOO L"/foo/"
-# endif
+# endif
 
     x = "/foo";
     x /= path(""); // empty path
@@ -291,7 +291,7 @@
     CHECK(p0.wstring() == L"abc");
     CHECK(p0.wstring().size() == 3);
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
 
     path p("abc\\def/ghi");
 
@@ -307,7 +307,7 @@
     CHECK(p.generic_string<wstring>() == L"abc/def/ghi");
     CHECK(p.generic_string<path::string_type>() == L"abc/def/ghi");
 
-# else // BOOST_POSIX_PATH
+# else // BOOST_POSIX_API
 
     path p("abc\\def/ghi");
 
@@ -474,7 +474,7 @@
 // CHECK(path("").make_absolute("") == ""); // should assert
 // CHECK(path("").make_absolute("foo") == ""); // should assert
 
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     CHECK(path("baa").make_absolute("c:/") == "c:/baa");
     CHECK(path("/baa").make_absolute("c:/foo").string() == path("c:/baa").string());
     CHECK(path("baa/baz").make_absolute("c:/foo/bar").string()
@@ -581,14 +581,14 @@
 
     std::cout << " testing p0 ..." << std::endl;
     path p0(L"\u2722"); // for tests that depend on path_traits::convert
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     CHECK(p0.string() != "\xE2\x9C\xA2");
 # endif
     string p0_string(p0.string());
 
     std::cout << " testing p1 ..." << std::endl;
     path p1("\xE2\x9C\xA2");
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     CHECK(p1 != L"\u2722");
 # endif
     wstring p1_wstring(p1.wstring());
@@ -611,7 +611,7 @@
     std::cout << " testing with the original locale ..." << std::endl;
     CHECK(p0.string() == p0_string);
     path p3("\xE2\x9C\xA2");
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
     CHECK(p3 != L"\u2722");
 # endif
     CHECK(p3.wstring() == p1_wstring);
@@ -693,7 +693,7 @@
     // These tests rely on a path constructor that fails in the locale conversion.
     // Thus construction has to call codecvt. Force that by using a narrow string
     // for Windows, and a wide string for POSIX.
-# ifdef BOOST_WINDOWS_PATH
+# ifdef BOOST_WINDOWS_API
 # define STRING_FOO_ "foo"
 # else
 # define STRING_FOO_ L"foo"
@@ -843,11 +843,11 @@
 #ifdef BOOST_WINDOWS_API
   cout << "BOOST_WINDOWS_API" << endl;
 #endif
-#ifdef BOOST_POSIX_PATH
+#ifdef BOOST_POSIX_API
   cout << "BOOST_PATH_API" << endl;
 #endif
-#ifdef BOOST_WINDOWS_PATH
- cout << "BOOST_WINDOWS_PATH" << endl;
+#ifdef BOOST_WINDOWS_API
+ cout << "BOOST_WINDOWS_API" << endl;
 #endif
 
   l.push_back('s');


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