Skip to content

Commit 9a14c37

Browse files
committed
Added directory_options. Set recursive_dir_iterator to end or pop on errors.
The directory_options enum reflects the same-named enum from C++20. It is now supported by both directory_iterator and recursive_directory_iterator. In particular, both iterators now support skip_permission_denied option. recursive_directory_iterator is now set to end by default on errors, as required by C++20. An additional directory_options::pop_on_error policy is added to allow the iterator recover from an error. When this option is specified and an error occurs, the iterator repeatedly pops the recursion level until the pop completes successfully or the end state is reached. recursive_directory_iterator that have standard counterparts (level, no_push_pending, no_push_request and no_push) are now deprecated and can be removed by defining BOOST_FILESYSTEM_NO_DEPRECATED. These members will be removed in a future release. Docs and tests updated accordingly. Also, in docs reconstructed release history for the past releases from Boost release notes. Fixes #112 Fixes #113
1 parent c758552 commit 9a14c37

18 files changed

+2320
-2112
lines changed

doc/deprecated.html

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
</table>
4040

4141
<h2><a name="Deprecated-names">Deprecated names</a> and features</h2>
42-
<p style="font-size: 10pt">As the library evolves over time, names sometimes
43-
change or old features are removed to make way for new features. To ease transition, Boost.Filesystem deprecates
44-
the old names and features, but by default continues to provide many of them.
42+
<p style="font-size: 10pt">As the library evolves over time, names sometimes
43+
change or old features are removed to make way for new features. To ease transition, Boost.Filesystem deprecates
44+
the old names and features, but by default continues to provide many of them.
4545
The deprecated names and other workarounds can be suppressed by defining macro <code>
4646
BOOST_FILESYSTEM_NO_DEPRECATED</code>, and this is recommended for all new code.</p>
47-
<p style="font-size: 10pt">In the table, &#10004; indicates a synonym or other
47+
<p style="font-size: 10pt">In the table, &#10004; indicates a synonym or other
4848
workaround is provided unless <code>
4949
BOOST_FILESYSTEM_NO_DEPRECATED</code> is defined.</p>
5050
<table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
@@ -190,7 +190,7 @@ <h2><a name="Deprecated-names">Deprecated names</a> and features</h2>
190190
<td style="font-size: 10pt" valign="top">
191191
&#10004;</td>
192192
<td style="font-size: 10pt" valign="top">
193-
<i>Function removed. Workaround ignores </i><code>name_check</code><i>
193+
<i>Function removed. Workaround ignores </i><code>name_check</code><i>
194194
argument.</i></td>
195195
</tr>
196196
<tr>
@@ -201,7 +201,7 @@ <h2><a name="Deprecated-names">Deprecated names</a> and features</h2>
201201
<td style="font-size: 10pt" valign="top">
202202
&#10004;</td>
203203
<td style="font-size: 10pt" valign="top">
204-
<i>Function removed. Workaround ignores </i><code>name_check</code><i>
204+
<i>Function removed. Workaround ignores </i><code>name_check</code><i>
205205
argument.</i></td>
206206
</tr>
207207
<tr>
@@ -223,8 +223,8 @@ <h2><a name="Deprecated-names">Deprecated names</a> and features</h2>
223223
<td style="font-size: 10pt" valign="top">
224224
&nbsp;</td>
225225
<td style="font-size: 10pt" valign="top">
226-
Class template <code>basic_path</code> is replaced by <code>class path</code>.
227-
No workaround for an explicitly coded <code>basic_path</code> is provided,
226+
Class template <code>basic_path</code> is replaced by <code>class path</code>.
227+
No workaround for an explicitly coded <code>basic_path</code> is provided,
228228
but see the next row - <code>path</code>.</td>
229229
</tr>
230230
<tr>
@@ -323,6 +323,53 @@ <h2><a name="Deprecated-names">Deprecated names</a> and features</h2>
323323
<td style="font-size: 10pt" valign="top">
324324
<i>Function removed, use </i><code>path().string()</code><i> instead.</i></td>
325325
</tr>
326+
<tr>
327+
<td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
328+
<td style="font-size: 10pt" valign="top"><code>level()</code></td>
329+
<td style="font-size: 10pt" valign="top">&#10004;</td>
330+
<td style="font-size: 10pt" valign="top"><code>depth()</code></td>
331+
</tr>
332+
<tr>
333+
<td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
334+
<td style="font-size: 10pt" valign="top"><code>no_push_pending()</code></td>
335+
<td style="font-size: 10pt" valign="top">&#10004;</td>
336+
<td style="font-size: 10pt" valign="top"><code>!recursion_pending()</code></td>
337+
</tr>
338+
<tr>
339+
<td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
340+
<td style="font-size: 10pt" valign="top"><code>no_push()</code></td>
341+
<td style="font-size: 10pt" valign="top">&#10004;</td>
342+
<td style="font-size: 10pt" valign="top"><code>disable_recursion_pending()</code></td>
343+
</tr>
344+
<tr>
345+
<td style="font-size: 10pt" valign="top"><code>directory.hpp</code></td>
346+
<td style="font-size: 10pt" valign="top"><code>enum class symlink_option</code></td>
347+
<td style="font-size: 10pt" valign="top">&#10004;</td>
348+
<td style="font-size: 10pt" valign="top"><i>Removed; use corresponding values of </i><code>enum class directory_options</code><i> instead.</i></td>
349+
</tr>
350+
<tr>
351+
<td style="font-size: 10pt" valign="top">
352+
<code>directory.hpp</code></td>
353+
<td style="font-size: 10pt" valign="top">
354+
<code>wrecursive_directory_iterator</code> typedef</td>
355+
<td style="font-size: 10pt" valign="top">
356+
&#10004;</td>
357+
<td style="font-size: 10pt" valign="top">
358+
<i>Removed; use </i><code>class recursive_directory_iterator</code><i> instead. Workaround provides
359+
</i><code>typedef recursive_directory_iterator wrecursive_directory_iterator</code></td>
360+
</tr>
361+
<tr>
362+
<td style="font-size: 10pt" valign="top">
363+
<code>operations.hpp</code></td>
364+
<td style="font-size: 10pt" valign="top">
365+
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>
366+
<td style="font-size: 10pt" valign="top">
367+
&#10004;</td>
368+
<td style="font-size: 10pt" valign="top">
369+
<i>These components were moved to separate headers </i><code>exception.hpp</code><i>, </i><code>file_status.hpp</code><i> and </i><code>directory.hpp</code><i>.
370+
The workaround is to include the new headers or </i><code>filesystem.hpp</code><i>. The new headers are still included by </i><code>operations.hpp</code><i> if
371+
</i><code>BOOST_FILESYSTEM_NO_DEPRECATED</code><i> is not defined.</i></td>
372+
</tr>
326373
<tr>
327374
<td style="font-size: 10pt" valign="top">
328375
Macro definitions</td>
@@ -367,21 +414,21 @@ <h2><a name="Deprecated-names">Deprecated names</a> and features</h2>
367414

368415
<h2>Deprecation rationale</h2>
369416
<h3><code>initial_path</code> function</h3>
370-
<p dir="ltr">Full implementation of <code>initial_path()</code> would require
371-
support from the C++ runtime startup code, and that doesn't seem likely to
372-
happen. Depending on the user to call <code>initial_path()</code> at the
373-
beginning of <code>main()</code> is too error prone.&nbsp; An equivalent
417+
<p dir="ltr">Full implementation of <code>initial_path()</code> would require
418+
support from the C++ runtime startup code, and that doesn't seem likely to
419+
happen. Depending on the user to call <code>initial_path()</code> at the
420+
beginning of <code>main()</code> is too error prone.&nbsp; An equivalent
374421
function can trivially be provided by a user.</p>
375422

376423
<hr>
377424
<p>Revised
378425
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->29 December, 2014<!--webbot bot="Timestamp" endspan i-checksum="38652" --></p>
379426

380427
<p>&copy; Copyright Beman Dawes, 2002-2005, 2010</p>
381-
<p> Use, modification, and distribution are subject to the Boost Software
428+
<p> Use, modification, and distribution are subject to the Boost Software
382429
License, Version 1.0. See <a href="http://www.boost.org/LICENSE_1_0.txt">
383430
www.boost.org/LICENSE_1_0.txt</a></p>
384431

385432
</body>
386433

387-
</html>
434+
</html>

0 commit comments

Comments
 (0)