Partly restore documentation of the removed deprecated APIs.

This partly restores documentation removed in
5df060e95ca844fe91b29001b4ae22bdb65635c6 and moves the features from
"deprecated" table to a new "removed" table. This provides users
with suggested replacements for the removed features.
This commit is contained in:
Andrey Semashev 2024-01-18 20:16:04 +03:00
parent 90fe5e8980
commit 5156746cd9
2 changed files with 218 additions and 6 deletions

View File

@ -39,7 +39,7 @@
</td> </td>
</table> </table>
<h2><a name="Deprecated-names">Deprecated names</a> and features</h2> <h2><a name="Deprecated-names">Deprecated names and features</a></h2>
<p style="font-size: 10pt">As the library evolves over time, names sometimes <p style="font-size: 10pt">As the library evolves over time, names sometimes
change or old features are removed to make way for new features. To ease transition, Boost.Filesystem deprecates change or old features are removed to make way for new features. To ease transition, Boost.Filesystem deprecates
the old names and features, but by default continues to provide many of them. the old names and features, but by default continues to provide many of them.
@ -69,7 +69,7 @@ can be suppressed by defining <code>BOOST_FILESYSTEM_ALLOW_DEPRECATED</code> mac
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
<p style="font-size: 10pt">Construction, assignment and appending from container types.</td> <p style="font-size: 10pt">Construction, assignment and appending from container types.</td>
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
&#10004;</td> &nbsp;</td>
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
<p style="font-size: 10pt">Use string types or iterators as the source for path construction, assignment and appending.</td> <p style="font-size: 10pt">Use string types or iterators as the source for path construction, assignment and appending.</td>
</tr> </tr>
@ -104,7 +104,7 @@ can be suppressed by defining <code>BOOST_FILESYSTEM_ALLOW_DEPRECATED</code> mac
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
&#10004;</td> &#10004;</td>
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
<i>Function removed</i></td> Function removed. Cache <code>current_path()</code> early in the application startup.</td>
</tr> </tr>
<tr> <tr>
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
@ -114,10 +114,222 @@ can be suppressed by defining <code>BOOST_FILESYSTEM_ALLOW_DEPRECATED</code> mac
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
&nbsp;</td> &nbsp;</td>
<td style="font-size: 10pt" valign="top"> <td style="font-size: 10pt" valign="top">
<i>No longer supported. When users are linking against static library of Boost.Filesystem, No longer supported. When users are linking against static library of Boost.Filesystem,
they are recommended to explicitly add Boost.Filesystem dependencies to their linker command they are recommended to explicitly add Boost.Filesystem dependencies to their linker command
line. Shared library of Boost.Filesystem is not affected by this as it is already linked with line. Shared library of Boost.Filesystem is not affected by this as it is already linked with
all its dependencies.</i></td> all its dependencies.</td>
</tr>
</table>
<p>Some library features were removed in one of the past releases. The table below lists some of
those features along with suggested replacements.</p>
<table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td style="font-size: 10pt" valign="top">
<b><i>Component or location</i></b></td>
<td style="font-size: 10pt" valign="top">
<p style="font-size: 10pt"><b><i>Removed name</i></b></td>
<td style="font-size: 10pt" valign="top">
<p style="font-size: 10pt"><b><i>Possible replacement</i></b></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>branch_path()</code></td>
<td style="font-size: 10pt" valign="top"><code>parent_path()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>directory_string()</code></td>
<td style="font-size: 10pt" valign="top"><code>string</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>external_directory_string()</code></td>
<td style="font-size: 10pt" valign="top"><code>native()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>external_file_string()</code></td>
<td style="font-size: 10pt" valign="top"><code>native()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>file_string()</code></td>
<td style="font-size: 10pt" valign="top"><code>string()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>has_branch_path()</code></td>
<td style="font-size: 10pt" valign="top"><code>has_parent_path()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>has_leaf()</code></td>
<td style="font-size: 10pt" valign="top"><code>has_filename()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>is_complete()</code></td>
<td style="font-size: 10pt" valign="top"><code>is_absolute()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class path</code></td>
<td style="font-size: 10pt" valign="top"><code>leaf()</code></td>
<td style="font-size: 10pt" valign="top"><code>filename()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>class path</code></td>
<td style="font-size: 10pt" valign="top">
<code>native_directory_string()</code></td>
<td style="font-size: 10pt" valign="top">
<code>string()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>class path</code></td>
<td style="font-size: 10pt" valign="top">
<code>native_file_string()</code></td>
<td style="font-size: 10pt" valign="top">
<code>string()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>class path</code></td>
<td style="font-size: 10pt" valign="top">
<code>normalize()</code></td>
<td style="font-size: 10pt" valign="top">
Replace <code>p.normalize()</code> with <code>p = p.lexically_normal()</code>.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>class path</code></td>
<td style="font-size: 10pt" valign="top">
<p style="font-size: 10pt"><code>remove_leaf()</code></td>
<td style="font-size: 10pt" valign="top">
<p style="font-size: 10pt"><code>remove_filename()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>path.hpp</code></td>
<td style="font-size: 10pt" valign="top">
<code>typedef basic_path&lt;std::wstring, wpath_traits&gt; wpath</code></td>
<td style="font-size: 10pt" valign="top">
<code>class path</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>operations.hpp</code></td>
<td style="font-size: 10pt" valign="top">
<p dir="ltr"><code>template &lt;class Path&gt;<br>
Path complete(const Path&amp; p,<br>
&nbsp;const Path&amp; base=<br>
&nbsp;&nbsp; initial_path&lt;Path&gt;())</code></td>
<td style="font-size: 10pt" valign="top">
<p dir="ltr"><code>path absolute(const path&amp; p, const path&amp; base=<br>
&nbsp; current_path())</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>operations.hpp</code></td>
<td style="font-size: 10pt" valign="top">
<code>is_regular(file_status f)</code></td>
<td style="font-size: 10pt" valign="top">
<p dir="ltr">
<code>is_regular_file(file_status f)</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>operations.hpp</code></td>
<td style="font-size: 10pt" valign="top">
<code>symbolic_link_exists(const path&amp; ph)</code></td>
<td style="font-size: 10pt" valign="top">
Replace <code>symbolic_link_exists(p)</code> with <code>is_symlink(symlink_status(p))</code>.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>operations.hpp</code></td>
<td style="font-size: 10pt" valign="top">
<code>copy_directory(const path&amp; from, const path&amp; to)</code></td>
<td style="font-size: 10pt" valign="top">
<code>create_directory(const path&amp; to, const path&amp; from)</code>. Note the reversed order of arguments.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>class directory_entry</code></td>
<td style="font-size: 10pt" valign="top">
<code>filename()</code></td>
<td style="font-size: 10pt" valign="top">
Replace <code>de.filename()</code> with <code>de.path().filename()</code>.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>class directory_entry</code></td>
<td style="font-size: 10pt" valign="top">
<code>leaf()</code></td>
<td style="font-size: 10pt" valign="top">
Replace <code>de.leaf()</code> with <code>de.path().filename()</code>.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>class directory_entry</code></td>
<td style="font-size: 10pt" valign="top">
<code>string()</code></td>
<td style="font-size: 10pt" valign="top">
Replace <code>de.string()</code> with <code>de.path().string()</code>.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
<td style="font-size: 10pt" valign="top"><code>level()</code></td>
<td style="font-size: 10pt" valign="top"><code>depth()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
<td style="font-size: 10pt" valign="top"><code>no_push_pending()</code></td>
<td style="font-size: 10pt" valign="top"><code>!recursion_pending()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
<td style="font-size: 10pt" valign="top"><code>no_push()</code></td>
<td style="font-size: 10pt" valign="top"><code>disable_recursion_pending()</code></td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top"><code>directory.hpp</code></td>
<td style="font-size: 10pt" valign="top"><code>enum class symlink_option</code></td>
<td style="font-size: 10pt" valign="top">Use corresponding values of <code>enum class directory_options</code> instead.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>directory.hpp</code></td>
<td style="font-size: 10pt" valign="top">
<code>wrecursive_directory_iterator</code> typedef</td>
<td style="font-size: 10pt" valign="top">
<code>class recursive_directory_iterator</code>.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>operations.hpp</code></td>
<td style="font-size: 10pt" valign="top">
The header provides <code>filesystem_error</code>, <code>file_status</code>, <code>directory_entry</code>, <code>directory_iterator</code>, <code>recursive_directory_iterator</code> and associated enums and functions.</td>
<td style="font-size: 10pt" valign="top">
Explicitly include headers <code>exception.hpp</code>, <code>file_status.hpp</code> and/or <code>directory.hpp</code> to introduce the required components.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>path_traits.hpp</code></td>
<td style="font-size: 10pt" valign="top">
The header contained implementation details of class <code>path</code>.</td>
<td style="font-size: 10pt" valign="top">
Remove the include.</td>
</tr>
<tr>
<td style="font-size: 10pt" valign="top">
<code>convenience.hpp</code></td>
<td style="font-size: 10pt" valign="top">
The header contained helper functions that were deprecated and then removed.</td>
<td style="font-size: 10pt" valign="top">
Remove the include.</td>
</tr> </tr>
</table> </table>

View File

@ -49,7 +49,7 @@
<li><code>weakly_canonical</code> now produces an absolute path if the input path is relative and contains no elements that exist in the filesystem. (<a href="https://github.com/boostorg/filesystem/issues/300">#300</a>)</li> <li><code>weakly_canonical</code> now produces an absolute path if the input path is relative and contains no elements that exist in the filesystem. (<a href="https://github.com/boostorg/filesystem/issues/300">#300</a>)</li>
<li>Added a new <code>copy_options::ignore_attribute_errors</code> option for <code>copy_file</code> and <code>copy</code> operations. The new option allows to ignore possible errors while copying file attributes. (<a href="https://github.com/boostorg/filesystem/issues/179">#179</a>)</li> <li>Added a new <code>copy_options::ignore_attribute_errors</code> option for <code>copy_file</code> and <code>copy</code> operations. The new option allows to ignore possible errors while copying file attributes. (<a href="https://github.com/boostorg/filesystem/issues/179">#179</a>)</li>
<li>On Linux, <code>copy_file</code> backends based on <code>sendfile</code> and <code>copy_file_range</code> system calls will attempt to preallocate storage for the target file. This may reduce filesystem fragmentation and provide early error indication if there is not enough free space. Not all filesystems support this feature; file copying proceeds if storage preallocation is not supported.</li> <li>On Linux, <code>copy_file</code> backends based on <code>sendfile</code> and <code>copy_file_range</code> system calls will attempt to preallocate storage for the target file. This may reduce filesystem fragmentation and provide early error indication if there is not enough free space. Not all filesystems support this feature; file copying proceeds if storage preallocation is not supported.</li>
<li>Removed APIs that were previously declared deprecated. In particular, <code>path</code> and <code>recursive_directory_iterator</code> member functions, <code>is_regular</code>, <code>copy_directory</code>, <code>symbolic_link_exists</code>, <code>complete</code>, <code>copy_option</code>, <code>symlink_option</code>, as well as <code>boost/filesystem/convenience.hpp</code> and <code>boost/filesystem/path_traits.hpp</code> headers were removed.</li> <li>Removed APIs that were previously declared deprecated. In particular, <code>path</code> and <code>recursive_directory_iterator</code> member functions, <code>is_regular</code>, <code>copy_directory</code>, <code>symbolic_link_exists</code>, <code>complete</code>, <code>copy_option</code>, <code>symlink_option</code>, as well as <code>boost/filesystem/convenience.hpp</code> and <code>boost/filesystem/path_traits.hpp</code> headers were removed. Possible replacements for the removed components are mentioned in <a href="deprecated.html#Deprecated-names">Deprecated names and features</a> section.</li>
<li>Support for <code>path</code> construction, assignment and appending from container types (e.g. <code>std::vector&lt;char&gt;</code>) is now disabled by default. Users can still enable this functionality by defining <code>BOOST_FILESYSTEM_DEPRECATED</code>. This functionality remains deprecated and will be completely removed in a future release.</li> <li>Support for <code>path</code> construction, assignment and appending from container types (e.g. <code>std::vector&lt;char&gt;</code>) is now disabled by default. Users can still enable this functionality by defining <code>BOOST_FILESYSTEM_DEPRECATED</code>. This functionality remains deprecated and will be completely removed in a future release.</li>
</ul> </ul>