Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62433 - in trunk/libs/filesystem/v3: boost/filesystem libs/filesystem/doc
From: bdawes_at_[hidden]
Date: 2010-06-04 16:24:41


Author: bemandawes
Date: 2010-06-04 16:24:40 EDT (Fri, 04 Jun 2010)
New Revision: 62433
URL: http://svn.boost.org/trac/boost/changeset/62433

Log:
Backward compatibility tweaks
Text files modified:
   trunk/libs/filesystem/v3/boost/filesystem/operations.hpp | 3 +++
   trunk/libs/filesystem/v3/boost/filesystem/path.hpp | 8 +++++---
   trunk/libs/filesystem/v3/libs/filesystem/doc/deprecated.html | 14 +++++++-------
   trunk/libs/filesystem/v3/libs/filesystem/doc/v3.html | 19 ++++++++++++++-----
   4 files changed, 29 insertions(+), 15 deletions(-)

Modified: trunk/libs/filesystem/v3/boost/filesystem/operations.hpp
==============================================================================
--- trunk/libs/filesystem/v3/boost/filesystem/operations.hpp (original)
+++ trunk/libs/filesystem/v3/boost/filesystem/operations.hpp 2010-06-04 16:24:40 EDT (Fri, 04 Jun 2010)
@@ -472,6 +472,9 @@
   void replace_leaf(const boost::filesystem::path& p,
     file_status st, file_status symlink_st)
       { replace_filename(p, st, symlink_st); }
+ std::string filename() const { return path().filename().string(); }
+ std::string leaf() const { return path().filename().string(); }
+ std::string string() const { return path().string(); }
 # endif
 
   const boost::filesystem::path& path() const {return m_path;}

Modified: trunk/libs/filesystem/v3/boost/filesystem/path.hpp
==============================================================================
--- trunk/libs/filesystem/v3/boost/filesystem/path.hpp (original)
+++ trunk/libs/filesystem/v3/boost/filesystem/path.hpp 2010-06-04 16:24:40 EDT (Fri, 04 Jun 2010)
@@ -350,10 +350,12 @@
     const std::string directory_string() const { return string(); }
     const std::string native_file_string() const { return string(); }
     const std::string native_directory_string() const { return string(); }
- const string_type external_file_string() const { return native(); }
- const string_type external_directory_string() const { return native(); }
+ // for functions that returned string_type, return std::string since we are
+ // emulating the old path rather than the old wpath.
+ const std::string external_file_string() const { return string(); }
+ const std::string external_directory_string() const { return string(); }
 
- path leaf() const { return filename(); }
+ std::string leaf() const { return filename().string(); }
     path branch_path() const { return parent_path(); }
     bool has_leaf() const { return !m_pathname.empty(); }
     bool has_branch_path() const { return !parent_path().empty(); }

Modified: trunk/libs/filesystem/v3/libs/filesystem/doc/deprecated.html
==============================================================================
--- trunk/libs/filesystem/v3/libs/filesystem/doc/deprecated.html (original)
+++ trunk/libs/filesystem/v3/libs/filesystem/doc/deprecated.html 2010-06-04 16:24:40 EDT (Fri, 04 Jun 2010)
@@ -268,33 +268,33 @@
   </tr>
   <tr>
     <td style="font-size: 10pt" valign="top">
- <code>basic_directory_status</code></td>
+ <code>class directory_entry</code></td>
     <td style="font-size: 10pt" valign="top">
     <code>filename()</code></td>
     <td style="font-size: 10pt" valign="top">
- &nbsp;</td>
+ &#10004;</td>
     <td style="font-size: 10pt" valign="top">
     <i>Function removed, use </i><code>path().filename()</code><i> instead.</i></td>
   </tr>
   <tr>
     <td style="font-size: 10pt" valign="top">
- <code>basic_directory_status</code></td>
+ <code>class directory_entry</code></td>
     <td style="font-size: 10pt" valign="top">
     <code>leaf()</code></td>
     <td style="font-size: 10pt" valign="top">
- &nbsp;</td>
+ &#10004;</td>
     <td style="font-size: 10pt" valign="top">
     <i>Function removed, use </i><code>path().filename()</code><i> instead.</i></td>
   </tr>
   <tr>
     <td style="font-size: 10pt" valign="top">
- <code>basic_directory_status</code></td>
+ <code>class directory_entry</code></td>
     <td style="font-size: 10pt" valign="top">
     <code>string()</code></td>
     <td style="font-size: 10pt" valign="top">
- &nbsp;</td>
+ &#10004;</td>
     <td style="font-size: 10pt" valign="top">
- <i>Function removed, use </i><code>path().filename()</code><i> instead.</i></td>
+ <i>Function removed, use </i><code>path().string()</code><i> instead.</i></td>
   </tr>
   <tr>
     <td style="font-size: 10pt" valign="top">

Modified: trunk/libs/filesystem/v3/libs/filesystem/doc/v3.html
==============================================================================
--- trunk/libs/filesystem/v3/libs/filesystem/doc/v3.html (original)
+++ trunk/libs/filesystem/v3/libs/filesystem/doc/v3.html 2010-06-04 16:24:40 EDT (Fri, 04 Jun 2010)
@@ -97,18 +97,27 @@
 cycle, and then Version 3 will become the default version.</p>
 <h3>Class <code>path</code></h3>
 <ul>
- <li>Class template <code>basic_path</code> and its specializations are gone.<br>
+ <li>Class template <code>basic_path</code> and its specializations are
+ replaced by a single <code>class path</code>. Thus any code, such as
+ overloaded functions, that depends on <code>path</code> and <code>wpath</code>
+ being two distinct types will fail to compile and must be restructured.
+ Restructuring may be as simple as removing one of the overloads, but also
+ might require more complex redesign.<br>
 &nbsp;</li>
   <li>Certain functions now return <code>path</code> objects rather than <code>
- basic_string</code> objects:<ul>
+ string or wstring</code> objects:<ul>
     <li><code>root_name()</code></li>
     <li><code>root_directory()</code></li>
     <li><code>filename()</code></li>
     <li><code>stem()</code></li>
- <li><code>extension()<br>
-&nbsp;</code></li>
+ <li><code>extension()</code></li>
   </ul>
- </li>
+ <p>Not all uses will fail; if the function is being called in a context that
+ accepts a <code>path</code>, all is well. If the result is being used in a
+ context requiring a <code>std::string</code> or <code>std::wstring</code>,
+ then <code>.string()</code> or <code>.wstring()</code> respectively must be
+ appended to the function call.<br>
+&nbsp;</li>
   <li>&nbsp;<code>path::iterator::value_type</code> and&nbsp; <code>
   path::const_iterator::value_type</code> is <code>path</code> rather than <code>
   basic_string</code>.</li>


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