mirror of
https://github.com/boostorg/filesystem.git
synced 2026-01-19 04:12:09 +00:00
Removed deprecated APIs.
Removed APIs that were marked as deprecated a long time ago. Disabled by default support for path construction, assignment and appending from container types. Users can still enable this functionality by defining BOOST_FILESYSTEM_DEPRECATED. Updated docs, tests and examples accordingly.
This commit is contained in:
@@ -63,162 +63,6 @@ can be suppressed by defining <code>BOOST_FILESYSTEM_ALLOW_DEPRECATED</code> mac
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<p style="font-size: 10pt"><b><i>New name</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">✔</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>canonize()</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>class path</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>default_name_check()</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>class path</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>default_name_check(name_check)</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>class path</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>default_name_check_writable()</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed</i></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">✔</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">✔</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">✔</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">✔</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">✔</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">✔</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">✔</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">✔</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">
|
||||
✔</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">
|
||||
✔</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">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>class path</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>path(const string_type& str, name_check)</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed. Workaround ignores </i><code>name_check</code><i>
|
||||
argument.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>class path</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>path(const string_type::value_type* s, name_check)</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed. Workaround ignores </i><code>name_check</code><i>
|
||||
argument.</i></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">
|
||||
✔</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>class path</code></td>
|
||||
@@ -252,17 +96,6 @@ can be suppressed by defining <code>BOOST_FILESYSTEM_ALLOW_DEPRECATED</code> mac
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>class path</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<std::wstring, wpath_traits> wpath</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Removed; use </i><code>class path</code><i> instead. Workaround provides
|
||||
</i><code>typedef path wpath</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>operations.hpp</code></td>
|
||||
@@ -273,178 +106,6 @@ can be suppressed by defining <code>BOOST_FILESYSTEM_ALLOW_DEPRECATED</code> mac
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed</i></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 <class Path><br>
|
||||
Path complete(const Path& p,<br>
|
||||
const Path& base=<br>
|
||||
initial_path<Path>())</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<p dir="ltr"><code>path absolute(const path& p, const path& base=<br>
|
||||
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">
|
||||
✔</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& ph)</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed</i></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& from, const path& to)</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed, use <code>create_directory(const path& to, const path& from)</code> instead (note the reversed order of arguments)</i></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">
|
||||
✔</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>class directory_entry</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>leaf()</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</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>class directory_entry</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>string()</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Function removed, use </i><code>path().string()</code><i> instead.</i></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">✔</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">✔</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">✔</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">✔</td>
|
||||
<td style="font-size: 10pt" valign="top"><i>Removed; use corresponding values of </i><code>enum class directory_options</code><i> instead.</i></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">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>Removed; use </i><code>class recursive_directory_iterator</code><i> instead. Workaround provides
|
||||
</i><code>typedef recursive_directory_iterator wrecursive_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">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<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>.
|
||||
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
|
||||
</i><code>BOOST_FILESYSTEM_NO_DEPRECATED</code><i> is not defined.</i></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 contains implementation details of class <code>path</code>.</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
✔</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>The header is deprecated and should not be used in user's code. Unavailable if </i><code>BOOST_FILESYSTEM_NO_DEPRECATED</code><i> is defined and will be permanently removed in a future release.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
Macro definitions</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>BOOST_WINDOW_API</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>No longer supported; API selection is always automatic.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
Macro definitions</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>BOOST_POSIX_API</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>No longer supported; API selection is always automatic.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
Macro definitions</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>BOOST_WINDOW_PATH</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>No longer supported; native path format selection is always automatic.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
Macro definitions</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<code>BOOST_POSIX_PATH</code></td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
</td>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
<i>No longer supported; native path format selection is always automatic.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-size: 10pt" valign="top">
|
||||
Build system</td>
|
||||
@@ -471,7 +132,7 @@ function can trivially be provided by a user.</p>
|
||||
<hr>
|
||||
|
||||
<p>© Copyright Beman Dawes, 2002-2005, 2010</p>
|
||||
<p>© Copyright Andrey Semashev, 2019-2021</p>
|
||||
<p>© Copyright Andrey Semashev, 2019-2024</p>
|
||||
<p> Use, modification, and distribution are subject to the Boost Software
|
||||
License, Version 1.0. See <a href="http://www.boost.org/LICENSE_1_0.txt">
|
||||
www.boost.org/LICENSE_1_0.txt</a></p>
|
||||
|
||||
@@ -718,14 +718,6 @@ nothing else."</p>
|
||||
create_hard_links
|
||||
};
|
||||
|
||||
// Deprecated, use <a href="#copy_options">copy_options</a> instead
|
||||
enum class <a name="copy_option">copy_option</a>
|
||||
{
|
||||
none = copy_options::none,
|
||||
fail_if_exists = none,
|
||||
overwrite_if_exists = copy_options::overwrite_existing
|
||||
};
|
||||
|
||||
enum class <a name="directory_options">directory_options</a>
|
||||
{
|
||||
none = 0u,
|
||||
@@ -734,14 +726,6 @@ nothing else."</p>
|
||||
pop_on_error
|
||||
};
|
||||
|
||||
// Deprecated, use <a href="#directory_options">directory_options</a> instead
|
||||
enum class <a name="symlink_option">symlink_option</a>
|
||||
{
|
||||
none = directory_options::none,
|
||||
no_recurse = none,
|
||||
recurse = directory_options::follow_directory_symlink
|
||||
};
|
||||
|
||||
// <a href="#Operational-functions">operational functions</a>
|
||||
|
||||
path <a href="#absolute">absolute</a>(const path& p, const path& base=current_path());
|
||||
@@ -762,11 +746,6 @@ nothing else."</p>
|
||||
void <a href="#copy">copy</a>(const path& from, const path& to,
|
||||
<a href="#copy_options">copy_options</a> options, system::error_code& ec);
|
||||
|
||||
// Deprecated, use <a href="#create_directory">create_directory</a> instead
|
||||
void <a href="#copy_directory">copy_directory</a>(const path& from, const path& to);
|
||||
void <a href="#copy_directory">copy_directory</a>(const path& from, const path& to,
|
||||
system::error_code& ec);
|
||||
|
||||
bool <a href="#copy_file">copy_file</a>(const path& from, const path& to);
|
||||
bool <a href="#copy_file">copy_file</a>(const path& from, const path& to,
|
||||
system::error_code& ec);
|
||||
@@ -774,11 +753,6 @@ nothing else."</p>
|
||||
<a href="#copy_options">copy_options</a> options);
|
||||
bool <a href="#copy_file">copy_file</a>(const path& from, const path& to,
|
||||
<a href="#copy_options">copy_options</a> options, system::error_code& ec);
|
||||
// Deprecated, use overloads taking <a href="#copy_options">copy_options</a> instead
|
||||
bool <a href="#copy_file">copy_file</a>(const path& from, const path& to,
|
||||
<a href="#copy_option">copy_option</a> options);
|
||||
bool <a href="#copy_file">copy_file</a>(const path& from, const path& to,
|
||||
<a href="#copy_option">copy_option</a> options, system::error_code& ec);
|
||||
|
||||
void <a href="#copy_symlink">copy_symlink</a>(const path& existing_symlink,
|
||||
const path& new_symlink);
|
||||
@@ -1921,27 +1895,6 @@ out-live the iterator itself. <i>—end note</i>] </p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
<h3> <a name="path-deprecated-functions"><code>path</code> deprecated functions</a></h3>
|
||||
<p> Several member functions from previous versions of <code>class path</code> have been deprecated, either because they have been renamed or because the
|
||||
functionality is no longer desirable or has become obsolete.</p>
|
||||
<p> Deprecated functions available by default; will be suppressed if <code>BOOST_FILESYSTEM_NO_DEPRECATED</code> is defined:</p>
|
||||
<blockquote>
|
||||
<pre>path& remove_leaf() { return remove_filename(); }
|
||||
path leaf() const { return filename(); }
|
||||
path branch_path() const { return parent_path(); }
|
||||
bool has_leaf() const { return !m_path.empty(); }
|
||||
bool has_branch_path() const { return !parent_path().empty(); }</pre>
|
||||
</blockquote>
|
||||
<p> Deprecated functions not available by default; will be supplied if <code>BOOST_FILESYSTEM_DEPRECATED</code> is defined:</p>
|
||||
<blockquote>
|
||||
<pre>const std::string file_string() const { return native_string(); }
|
||||
const std::string directory_string() const { return native_string(); }
|
||||
const std::string native_file_string() const { return native_string(); }
|
||||
const std::string native_directory_string() const { return native_string(); }
|
||||
const string_type external_file_string() const { return native(); }
|
||||
const string_type external_directory_string() const { return native(); }</pre>
|
||||
</blockquote>
|
||||
|
||||
<h3> <a name="path-non-member-functions"> <code><font size="4">path</font></code> non-member functions</a>
|
||||
[path.non-member]</h3>
|
||||
|
||||
@@ -2947,11 +2900,6 @@ its sub-directories.</p>
|
||||
<a href="#directory_options">directory_options</a> opts = directory_options::none);
|
||||
recursive_directory_iterator(const path& p,
|
||||
<a href="#directory_options">directory_options</a> opts, system::error_code& ec);
|
||||
// deprecated constructors, use overloads accepting directory_options instead
|
||||
explicit recursive_directory_iterator(const path& p,
|
||||
<a href="#symlink_option">symlink_option</a> opts = symlink_option::none);
|
||||
recursive_directory_iterator(const path& p,
|
||||
<a href="#symlink_option">symlink_option</a> opts, system::error_code& ec);
|
||||
recursive_directory_iterator(const path& p, system::error_code& ec);
|
||||
~recursive_directory_iterator();
|
||||
|
||||
@@ -2959,10 +2907,6 @@ its sub-directories.</p>
|
||||
int depth() const noexcept;
|
||||
bool recursion_pending() const noexcept;
|
||||
|
||||
// deprecated observers
|
||||
int level() const noexcept;
|
||||
bool no_push_pending() const noexcept;
|
||||
|
||||
// modifiers
|
||||
recursive_directory_iterator& operator=(const recursive_directory_iterator&);
|
||||
|
||||
@@ -2973,9 +2917,6 @@ its sub-directories.</p>
|
||||
void pop(system::error_code& ec);
|
||||
void disable_recursion_pending(bool value = true) noexcept;
|
||||
|
||||
// deprecated modifiers
|
||||
void no_push(bool value = true);
|
||||
|
||||
// other members as required by
|
||||
// C++ Std, Input iterators [input.iterators]
|
||||
|
||||
@@ -3011,9 +2952,7 @@ as a <code>directory_iterator</code> unless otherwise specified.</p>
|
||||
|
||||
<pre>explicit recursive_directory_iterator(const path& p, <a href="#directory_options">directory_options</a> opts = directory_options::none);
|
||||
recursive_directory_iterator(const path& p, <a href="#directory_options">directory_options</a> opts, system::error_code& ec);
|
||||
explicit recursive_directory_iterator(const path& p, <a href="#symlink_option">symlink_option</a> opts = symlink_option::none);
|
||||
recursive_directory_iterator(const path& p, <a href="#symlink_option">symlink_option</a> opts, system::error_code& ec);
|
||||
recursive_<code>directory_iterator(</code>const path& p, system::error_code& ec<code>);</code></pre>
|
||||
recursive_directory_iterator(const path& p, system::error_code& ec);</pre>
|
||||
<blockquote>
|
||||
|
||||
<p><i>Effects:</i> Constructs an iterator representing the first
|
||||
@@ -3029,8 +2968,7 @@ For the signature without the <code>opts</code> argument, <code>opts</code> is a
|
||||
<p>[<i>Note:</i> By default, <code>recursive_directory_iterator</code> does not
|
||||
follow directory symlinks. To follow directory symlinks, specify <code>directory_options::follow_directory_symlink</code> in <code>opts</code>. <i>—end note</i>]</p>
|
||||
</blockquote>
|
||||
<pre>int depth() const noexcept;
|
||||
int level() const noexcept;</pre>
|
||||
<pre>int depth() const noexcept;</pre>
|
||||
<blockquote>
|
||||
<p><i>Requires:</i> <code>*this != recursive_directory_iterator()</code>.</p>
|
||||
<p><i>Returns:</i> <code>m_depth</code>.</p>
|
||||
@@ -3040,12 +2978,7 @@ int level() const noexcept;</pre>
|
||||
<p><i>Requires:</i> <code>*this != recursive_directory_iterator()</code>.</p>
|
||||
<p><i>Returns:</i> <code>m_recursion_pending</code>.</p>
|
||||
</blockquote>
|
||||
<pre>bool no_push_pending() const noexcept;</pre>
|
||||
<blockquote>
|
||||
<p><i>Requires:</i> <code>*this != recursive_directory_iterator()</code>.</p>
|
||||
<p><i>Returns:</i> <code>!recursion_pending()</code>.</p>
|
||||
</blockquote>
|
||||
<pre><code>recursive_directory_iterator</code>& <a name="recursive_directory_iterator-increment">operator++</a>();
|
||||
<pre>recursive_directory_iterator& <a name="recursive_directory_iterator-increment">operator++</a>();
|
||||
recursive_directory_iterator& increment(system::error_code& ec);</pre>
|
||||
<blockquote>
|
||||
|
||||
@@ -3101,8 +3034,7 @@ void pop(system::error_code& ec);</pre>
|
||||
</ul>
|
||||
</p>
|
||||
</blockquote>
|
||||
<pre>void disable_recursion_pending(bool value = true) noexcept;
|
||||
void no_push(bool value = true) noexcept;</pre>
|
||||
<pre>void disable_recursion_pending(bool value = true) noexcept;</pre>
|
||||
<blockquote>
|
||||
<p><i>Requires:</i> <code>*this != recursive_directory_iterator()</code>.</p>
|
||||
<p><i>Postcondition:</i> <code>recursion_pending() == !value</code>.</p>
|
||||
@@ -3255,25 +3187,6 @@ void copy(const path& from, const path& to, <a href="#copy_options">copy
|
||||
Otherwise, for all unsupported file types of <code>f</code> report error.</p>
|
||||
|
||||
<p><i>Throws:</i> As specified in <a href="#Error-reporting">Error reporting</a>.</p>
|
||||
|
||||
</blockquote>
|
||||
<pre>void <a name="copy_directory">copy_directory</a>(const path& from, const path& to);
|
||||
void copy_directory(const path& from, const path& to, system::error_code& ec);</pre>
|
||||
<blockquote>
|
||||
<p><i>Effects: </i>Creates directory <code>to</code>, with
|
||||
attributes copied from directory <code>from</code>. The set of attributes
|
||||
copied is operating system dependent.</p>
|
||||
|
||||
<p>[<i>Note:</i> For ISO 9945/POSIX based operating systems the
|
||||
attributes are those copied by native API <code>stat(from.c_str(), &from_stat)</code>
|
||||
followed by <code>mkdir(to.c_str(),from_stat.st_mode)</code>. For
|
||||
Windows based operating systems the attributes are those copied by native
|
||||
API <code>CreateDirectoryExW(from.c_str(), to.c_str(), 0)</code>. <i>
|
||||
—end note</i>]</td>
|
||||
|
||||
<p><i>Throws:</i> As specified in <a href="#Error-reporting">Error reporting</a>.</p>
|
||||
|
||||
<p>[<i>Note:</i> This operation is deprecated, use <a href="#create_directory">create_directory</a> instead. —end note]</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>bool copy_file(const path& from, const path& to);
|
||||
@@ -3285,9 +3198,7 @@ bool copy_file(const path& from, const path& to, system::error_code&
|
||||
|
||||
</blockquote>
|
||||
<pre>bool <a name="copy_file">copy_file</a>(const path& from, const path& to, <a href="#copy_options">copy_options</a> options);
|
||||
bool copy_file(const path& from, const path& to, <a href="#copy_options">copy_options</a> options, system::error_code& ec);
|
||||
bool copy_file(const path& from, const path& to, <a href="#copy_option">copy_option</a> options);
|
||||
bool copy_file(const path& from, const path& to, <a href="#copy_option">copy_option</a> options, system::error_code& ec);</pre>
|
||||
bool copy_file(const path& from, const path& to, <a href="#copy_options">copy_options</a> options, system::error_code& ec);</pre>
|
||||
<blockquote>
|
||||
<p><i>Precondition:</i> <code>options</code> must contain at most one option from each of the following groups:
|
||||
<ul>
|
||||
@@ -3317,7 +3228,6 @@ bool copy_file(const path& from, const path& to, <a href="#copy_option">
|
||||
</p>
|
||||
<p><i>Returns:</i> <code>true</code> if the file was copied without error, otherwise <code>false</code>.</p>
|
||||
<p><i>Throws:</i> As specified in <a href="#Error-reporting">Error reporting</a>.</p>
|
||||
<p>[<i>Note:</i> The overloads taking <a href="#copy_option"><code>copy_option</code></a> are deprecated. Their effect is equivalent to the corresponding overloads taking <a href="#copy_options"><code>copy_options</code></a> after casting the <code>options</code> argument to <a href="#copy_options"><code>copy_options</code></a>.]</p>
|
||||
<p>[<i>Note:</i> When <code>copy_options::update_existing</code> is specified, checking the write times of <code>from</code> and <code>to</code> may not be atomic with the copy operation. Another process may create or modify the file identified by <code>to</code> after the file modification times have been checked but before copying starts. In this case the target file will be overwritten.]</p>
|
||||
<p>[<i>Note:</i> The <code>copy_options::synchronize_data</code> and <code>copy_options::synchronize</code> options may have a significant performance impact. The <code>copy_options::synchronize_data</code> option may be less expensive than <code>copy_options::synchronize</code>. However, without these options, upon returning from <code>copy_file</code> it is not guaranteed that the copied file is completely written and preserved in case of a system failure. Any delayed write operations may fail after the function returns, at the point of physically writing the data to the underlying media, and this error will not be reported to the caller.]</p>
|
||||
<p>[<i>Note:</i> The <code>copy_options::ignore_attribute_errors</code> option can be used when the caller does not require file attributes to be copied. The implementation is permitted to make an attempt to copy the file attributes, but still succeed the file copying operation if that attempt fails. This option may be useful with file systems that do not fully support operations of file attributes.]</p>
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
<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>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>Support for <code>path</code> construction, assignment and appending from container types (e.g. <code>std::vector<char></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>
|
||||
|
||||
<h2>1.84.0</h2>
|
||||
|
||||
@@ -806,7 +806,7 @@ more flexible because class <code>path</code> itself is far more flexible:</p>
|
||||
<li>Class <code>path</code> supports multiple character types and encodings, including Unicode, to
|
||||
ease internationalization.</li>
|
||||
<li>Class <code>path</code> supports multiple source types, such as iterators for null terminated
|
||||
sequences, iterator ranges, containers (including <code>std::basic_string</code>),
|
||||
sequences, iterator ranges, string class types (including <code>std::basic_string</code> and <code>std::basic_string_view</code>),
|
||||
and <code><a href="reference.html#Class-directory_entry">directory_entry</a></code>'s,
|
||||
so functions taking paths don't need to provide several overloads.</li>
|
||||
<li>Class <code>path</code> supports both native and generic pathname formats, so programs can be
|
||||
@@ -862,8 +862,8 @@ int main()
|
||||
{ fs::ofstream f(L"smile\u263A"); }
|
||||
{ fs::ofstream f(narrow_string); }
|
||||
{ fs::ofstream f(wide_string); }
|
||||
{ fs::ofstream f(narrow_list); }
|
||||
{ fs::ofstream f(wide_list); }
|
||||
{ fs::ofstream f(fs::path(narrow_list.begin(), narrow_list.end())); }
|
||||
{ fs::ofstream f(fs::path(wide_list.begin(), wide_list.end())); }
|
||||
narrow_list.pop_back();
|
||||
narrow_list.push_back('4');
|
||||
wide_list.pop_back();
|
||||
|
||||
@@ -47,10 +47,10 @@ int main()
|
||||
fs::ofstream f(wide_string);
|
||||
}
|
||||
{
|
||||
fs::ofstream f(narrow_list);
|
||||
fs::ofstream f(fs::path(narrow_list.begin(), narrow_list.end()));
|
||||
}
|
||||
{
|
||||
fs::ofstream f(wide_list);
|
||||
fs::ofstream f(fs::path(wide_list.begin(), wide_list.end()));
|
||||
}
|
||||
narrow_list.pop_back();
|
||||
narrow_list.push_back('4');
|
||||
|
||||
@@ -18,6 +18,5 @@
|
||||
#include <boost/filesystem/directory.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/file_status.hpp>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM_FILESYSTEM_HPP
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
// boost/filesystem/convenience.hpp ----------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes, 2002-2005
|
||||
// Copyright Vladimir Prus, 2002
|
||||
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See library home page at http://www.boost.org/libs/filesystem
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
#define BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
#include <boost/filesystem/detail/header.hpp> // must be the last #include
|
||||
|
||||
namespace boost {
|
||||
namespace filesystem {
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::extension() instead")
|
||||
inline std::string extension(const path& p)
|
||||
{
|
||||
return p.extension().string();
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::stem() instead")
|
||||
inline std::string basename(const path& p)
|
||||
{
|
||||
return p.stem().string();
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::replace_extension() instead")
|
||||
inline path change_extension(const path& p, const path& new_extension)
|
||||
{
|
||||
path new_p(p);
|
||||
new_p.replace_extension(new_extension);
|
||||
return new_p;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <boost/type_traits/disjunction.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
#if defined(BOOST_FILESYSTEM_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#endif
|
||||
@@ -256,7 +256,7 @@ struct path_source_traits< boost::basic_string_view< wchar_t, std::char_traits<
|
||||
static BOOST_CONSTEXPR_OR_CONST bool is_native = false;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
#if defined(BOOST_FILESYSTEM_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
template< >
|
||||
struct
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Boost.Filesystem path construction/assignment/appending from containers is deprecated, use strings or iterators instead.")
|
||||
@@ -298,7 +298,7 @@ path_source_traits< std::list< wchar_t > >
|
||||
typedef wchar_t char_type;
|
||||
static BOOST_CONSTEXPR_OR_CONST bool is_native = false;
|
||||
};
|
||||
#endif // !defined(BOOST_FILESYSTEM_NO_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
#endif // defined(BOOST_FILESYSTEM_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
|
||||
template< >
|
||||
struct path_source_traits< directory_entry >
|
||||
@@ -437,7 +437,7 @@ BOOST_FORCEINLINE typename Callback::result_type dispatch(Source const& source,
|
||||
return cb(src.data(), src.data() + src.size(), cvt);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
#if defined(BOOST_FILESYSTEM_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
|
||||
template< typename Callback >
|
||||
BOOST_FORCEINLINE typename Callback::result_type dispatch(std::vector< char > const& source, Callback cb, const codecvt_type* cvt, range_type_tag)
|
||||
@@ -463,7 +463,7 @@ BOOST_FORCEINLINE typename Callback::result_type dispatch(std::vector< wchar_t >
|
||||
return cb(data, data_end, cvt);
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_FILESYSTEM_NO_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
#endif // defined(BOOST_FILESYSTEM_DEPRECATED) && BOOST_FILESYSTEM_VERSION < 4
|
||||
|
||||
// Defined in directory.hpp to avoid circular header dependencies
|
||||
template< typename Callback >
|
||||
|
||||
@@ -591,14 +591,6 @@ inline bool is_other(directory_entry const& e, system::error_code& ec) noexcept
|
||||
return e.is_other(ec);
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use is_regular_file() instead")
|
||||
inline bool is_regular(directory_entry const& e)
|
||||
{
|
||||
return filesystem::is_regular_file(e);
|
||||
}
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// directory_iterator helpers //
|
||||
@@ -816,19 +808,6 @@ namespace filesystem {
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
// Deprecated enum, use directory_options instead
|
||||
enum class symlink_option : unsigned int
|
||||
{
|
||||
none = static_cast< unsigned int >(directory_options::none),
|
||||
no_recurse = none, // don't follow directory symlinks (default behavior)
|
||||
recurse = static_cast< unsigned int >(directory_options::follow_directory_symlink), // follow directory symlinks
|
||||
_detail_no_push = static_cast< unsigned int >(directory_options::_detail_no_push) // internal use only
|
||||
};
|
||||
|
||||
BOOST_BITMASK(symlink_option)
|
||||
#endif // BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
|
||||
class recursive_directory_iterator;
|
||||
|
||||
namespace detail {
|
||||
@@ -892,21 +871,6 @@ public:
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(opts), &ec);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
// Deprecated constructors
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use directory_options instead of symlink_option")
|
||||
recursive_directory_iterator(path const& dir_path, symlink_option opts)
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(opts), nullptr);
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use directory_options instead of symlink_option")
|
||||
recursive_directory_iterator(path const& dir_path, symlink_option opts, system::error_code& ec) noexcept
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(opts), &ec);
|
||||
}
|
||||
#endif // BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
|
||||
recursive_directory_iterator(recursive_directory_iterator const&) = default;
|
||||
recursive_directory_iterator& operator=(recursive_directory_iterator const&) = default;
|
||||
|
||||
@@ -939,16 +903,6 @@ public:
|
||||
return (m_imp->m_options & static_cast< unsigned int >(directory_options::_detail_no_push)) == 0u;
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use recursive_directory_iterator::depth() instead")
|
||||
int level() const noexcept
|
||||
{
|
||||
return depth();
|
||||
}
|
||||
bool no_push_pending() const noexcept { return !recursion_pending(); }
|
||||
bool no_push_request() const noexcept { return !recursion_pending(); }
|
||||
#endif
|
||||
|
||||
void pop()
|
||||
{
|
||||
detail::recursive_directory_iterator_pop(*this, nullptr);
|
||||
@@ -968,14 +922,6 @@ public:
|
||||
m_imp->m_options &= ~static_cast< unsigned int >(directory_options::_detail_no_push);
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use recursive_directory_iterator::disable_recursion_pending() instead")
|
||||
void no_push(bool value = true) noexcept
|
||||
{
|
||||
disable_recursion_pending(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
file_status status() const
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "status() on end recursive_directory_iterator");
|
||||
@@ -1019,11 +965,6 @@ private:
|
||||
boost::intrusive_ptr< detail::recur_dir_itr_imp > m_imp;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use recursive_directory_iterator instead")
|
||||
typedef recursive_directory_iterator wrecursive_directory_iterator;
|
||||
#endif
|
||||
|
||||
// enable recursive directory iterator C++11 range-base for statement use ----------//
|
||||
|
||||
// begin() and end() are only used by a range-based for statement in the context of
|
||||
|
||||
@@ -33,9 +33,6 @@ namespace filesystem {
|
||||
enum file_type
|
||||
{
|
||||
status_error,
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
status_unknown = status_error,
|
||||
#endif
|
||||
file_not_found,
|
||||
regular_file,
|
||||
directory_file,
|
||||
@@ -247,14 +244,6 @@ inline BOOST_CONSTEXPR bool is_other(file_status f) noexcept
|
||||
return filesystem::exists(f) && !filesystem::is_regular_file(f) && !filesystem::is_directory(f) && !filesystem::is_symlink(f);
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use is_regular_file() instead")
|
||||
inline bool is_regular(file_status f) noexcept
|
||||
{
|
||||
return filesystem::is_regular_file(f);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -20,12 +20,6 @@
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/file_status.hpp>
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
// These includes are left for backward compatibility and should be included directly by users, as needed
|
||||
#include <boost/filesystem/exception.hpp>
|
||||
#include <boost/filesystem/directory.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/detail/bitmask.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
@@ -71,16 +65,6 @@ enum class copy_options : unsigned int
|
||||
|
||||
BOOST_BITMASK(copy_options)
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
// Deprecated enum, use copy_options instead
|
||||
enum class copy_option : unsigned int
|
||||
{
|
||||
none = static_cast< unsigned int >(copy_options::none),
|
||||
fail_if_exists = none,
|
||||
overwrite_if_exists = static_cast< unsigned int >(copy_options::overwrite_existing)
|
||||
};
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// implementation details //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
@@ -105,10 +89,6 @@ BOOST_FILESYSTEM_DECL
|
||||
path canonical_v4(path const& p, path const& base, system::error_code* ec = nullptr);
|
||||
BOOST_FILESYSTEM_DECL
|
||||
void copy(path const& from, path const& to, unsigned int options, system::error_code* ec = nullptr);
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
BOOST_FILESYSTEM_DECL
|
||||
void copy_directory(path const& from, path const& to, system::error_code* ec = nullptr);
|
||||
#endif
|
||||
BOOST_FILESYSTEM_DECL
|
||||
bool copy_file(path const& from, path const& to, // See ticket #2925
|
||||
unsigned int options, system::error_code* ec = nullptr); // see copy_options for options
|
||||
@@ -297,20 +277,6 @@ inline bool is_other(path const& p, system::error_code& ec) noexcept
|
||||
return filesystem::is_other(detail::status(p, &ec));
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use is_regular_file() instead")
|
||||
inline bool is_regular(path const& p)
|
||||
{
|
||||
return filesystem::is_regular_file(p);
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use is_regular_file() instead")
|
||||
inline bool is_regular(path const& p, system::error_code& ec) noexcept
|
||||
{
|
||||
return filesystem::is_regular_file(p, ec);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline bool is_empty(path const& p)
|
||||
{
|
||||
return detail::is_empty(p);
|
||||
@@ -388,20 +354,6 @@ inline void copy(path const& from, path const& to, copy_options options, system:
|
||||
detail::copy(from, to, static_cast< unsigned int >(options), &ec);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use create_directory() instead")
|
||||
inline void copy_directory(path const& from, path const& to)
|
||||
{
|
||||
detail::copy_directory(from, to);
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use create_directory() instead")
|
||||
inline void copy_directory(path const& from, path const& to, system::error_code& ec) noexcept
|
||||
{
|
||||
detail::copy_directory(from, to, &ec);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline bool copy_file(path const& from, path const& to)
|
||||
{
|
||||
return detail::copy_file(from, to, static_cast< unsigned int >(copy_options::none));
|
||||
@@ -423,20 +375,6 @@ inline bool copy_file(path const& from, path const& to, copy_options options, sy
|
||||
return detail::copy_file(from, to, static_cast< unsigned int >(options), &ec);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use copy_options instead of copy_option")
|
||||
inline bool copy_file(path const& from, path const& to, copy_option options)
|
||||
{
|
||||
return detail::copy_file(from, to, static_cast< unsigned int >(options));
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use copy_options instead of copy_option")
|
||||
inline bool copy_file(path const& from, path const& to, copy_option options, system::error_code& ec) noexcept
|
||||
{
|
||||
return detail::copy_file(from, to, static_cast< unsigned int >(options), &ec);
|
||||
}
|
||||
#endif // !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
|
||||
inline void copy_symlink(path const& existing_symlink, path const& new_symlink)
|
||||
{
|
||||
detail::copy_symlink(existing_symlink, new_symlink);
|
||||
@@ -646,14 +584,6 @@ inline space_info space(path const& p, system::error_code& ec) noexcept
|
||||
return detail::space(p, &ec);
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use is_symlink(symlink_status(path)) instead")
|
||||
inline bool symbolic_link_exists(path const& p)
|
||||
{
|
||||
return is_symlink(filesystem::symlink_status(p));
|
||||
}
|
||||
#endif
|
||||
|
||||
inline path system_complete(path const& p)
|
||||
{
|
||||
return detail::system_complete(p);
|
||||
@@ -776,20 +706,6 @@ using BOOST_FILESYSTEM_VERSION_NAMESPACE::canonical;
|
||||
using BOOST_FILESYSTEM_VERSION_NAMESPACE::equivalent;
|
||||
using BOOST_FILESYSTEM_VERSION_NAMESPACE::weakly_canonical;
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use absolute() instead")
|
||||
inline path complete(path const& p)
|
||||
{
|
||||
return absolute(p, initial_path());
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use absolute() instead")
|
||||
inline path complete(path const& p, path const& base)
|
||||
{
|
||||
return absolute(p, base);
|
||||
}
|
||||
#endif
|
||||
|
||||
// test helper -----------------------------------------------------------------------//
|
||||
|
||||
// Not part of the documented interface since false positives are possible;
|
||||
|
||||
@@ -1039,44 +1039,6 @@ public:
|
||||
static BOOST_FILESYSTEM_DECL std::locale imbue(std::locale const& loc);
|
||||
static BOOST_FILESYSTEM_DECL codecvt_type const& codecvt();
|
||||
|
||||
// ----- deprecated functions -----
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
// recently deprecated functions supplied by default
|
||||
path& normalize();
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::remove_filename() instead")
|
||||
path& remove_leaf() { return remove_filename(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::filename() instead")
|
||||
path leaf() const { return filename(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::parent_path() instead")
|
||||
path branch_path() const { return parent_path(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::generic_path() instead")
|
||||
path generic() const { return generic_path(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use !path::empty() instead")
|
||||
bool has_leaf() const { return !m_pathname.empty(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::has_parent_path() instead")
|
||||
bool has_branch_path() const { return has_parent_path(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::is_absolute() instead")
|
||||
bool is_complete() const { return is_absolute(); }
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_FILESYSTEM_DEPRECATED)
|
||||
// deprecated functions with enough signature or semantic changes that they are
|
||||
// not supplied by default
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::string() instead")
|
||||
std::string file_string() const { return string(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::string() instead")
|
||||
std::string directory_string() const { return string(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::string() instead")
|
||||
std::string native_file_string() const { return string(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::string() instead")
|
||||
std::string native_directory_string() const { return string(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::native() instead")
|
||||
string_type external_file_string() const { return native(); }
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::native() instead")
|
||||
string_type external_directory_string() const { return native(); }
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// class path private members //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
@@ -1098,10 +1060,6 @@ BOOST_FILESYSTEM_DECL path const& dot_path();
|
||||
BOOST_FILESYSTEM_DECL path const& dot_dot_path();
|
||||
} // namespace detail
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
typedef path wpath;
|
||||
#endif
|
||||
|
||||
namespace path_detail {
|
||||
|
||||
//------------------------------------------------------------------------------------//
|
||||
@@ -1584,18 +1542,6 @@ inline bool path::filename_is_dot_dot() const
|
||||
// to deal with "c:.." edge case on Windows when ':' acts as a separator
|
||||
}
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
|
||||
BOOST_FILESYSTEM_DETAIL_DEPRECATED("Use path::lexically_normal() instead")
|
||||
BOOST_FORCEINLINE path& path::normalize()
|
||||
{
|
||||
path tmp(lexically_normal());
|
||||
m_pathname.swap(tmp.m_pathname);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
|
||||
// The following functions are defined differently, depending on Boost.Filesystem version in use.
|
||||
// To avoid ODR violation, these functions are not defined when the library itself is built.
|
||||
// This makes sure they are not compiled when the library is built, and the only version there is
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
// filesystem path_traits.hpp --------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2009
|
||||
// Copyright Andrey Semashev 2022
|
||||
|
||||
// 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_PATH_TRAITS_HPP
|
||||
#define BOOST_FILESYSTEM_PATH_TRAITS_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_DEPRECATED) && !defined(BOOST_FILESYSTEM_ALLOW_DEPRECATED)
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED("your own implementation")
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
|
||||
#include <boost/filesystem/detail/path_traits.hpp>
|
||||
#include <boost/filesystem/detail/header.hpp> // must be the last #include
|
||||
|
||||
namespace boost {
|
||||
namespace filesystem {
|
||||
|
||||
namespace path_traits = boost::filesystem::detail::path_traits;
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
|
||||
#endif // BOOST_FILESYSTEM_PATH_TRAITS_HPP
|
||||
@@ -3497,53 +3497,6 @@ bool create_directory(path const& p, const path* existing, error_code* ec)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deprecated, to be removed in a future release
|
||||
BOOST_FILESYSTEM_DECL
|
||||
void copy_directory(path const& from, path const& to, system::error_code* ec)
|
||||
{
|
||||
if (ec)
|
||||
ec->clear();
|
||||
|
||||
#if defined(BOOST_POSIX_API)
|
||||
|
||||
#if defined(BOOST_FILESYSTEM_USE_STATX)
|
||||
int err;
|
||||
struct ::statx from_stat;
|
||||
if (BOOST_UNLIKELY(invoke_statx(AT_FDCWD, from.c_str(), AT_NO_AUTOMOUNT, STATX_TYPE | STATX_MODE, &from_stat) < 0))
|
||||
{
|
||||
fail_errno:
|
||||
err = errno;
|
||||
fail:
|
||||
emit_error(err, from, to, ec, "boost::filesystem::copy_directory");
|
||||
return;
|
||||
}
|
||||
|
||||
if (BOOST_UNLIKELY((from_stat.stx_mask & (STATX_TYPE | STATX_MODE)) != (STATX_TYPE | STATX_MODE)))
|
||||
{
|
||||
err = BOOST_ERROR_NOT_SUPPORTED;
|
||||
goto fail;
|
||||
}
|
||||
#else
|
||||
struct ::stat from_stat;
|
||||
if (BOOST_UNLIKELY(::stat(from.c_str(), &from_stat) < 0))
|
||||
{
|
||||
fail_errno:
|
||||
emit_error(errno, from, to, ec, "boost::filesystem::copy_directory");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (BOOST_UNLIKELY(::mkdir(to.c_str(), get_mode(from_stat)) < 0))
|
||||
goto fail_errno;
|
||||
|
||||
#else // defined(BOOST_POSIX_API)
|
||||
|
||||
if (BOOST_UNLIKELY(!::CreateDirectoryExW(from.c_str(), to.c_str(), 0)))
|
||||
emit_error(BOOST_ERRNO, from, to, ec, "boost::filesystem::copy_directory");
|
||||
|
||||
#endif // defined(BOOST_POSIX_API)
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL
|
||||
void create_directory_symlink(path const& to, path const& from, system::error_code* ec)
|
||||
{
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
#endif
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#include <boost/filesystem/directory.hpp>
|
||||
#include <boost/filesystem/exception.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/detail/lightweight_main.hpp>
|
||||
|
||||
@@ -47,125 +47,6 @@ void check(const fs::path& source, const std::string& expected, int line)
|
||||
<< "\"" << std::endl;
|
||||
}
|
||||
|
||||
void normalize_test()
|
||||
{
|
||||
PATH_CHECK(path("").normalize(), "");
|
||||
PATH_CHECK(path("/").normalize(), "/");
|
||||
PATH_CHECK(path("//").normalize(), "//");
|
||||
PATH_CHECK(path("///").normalize(), "/");
|
||||
PATH_CHECK(path("f").normalize(), "f");
|
||||
PATH_CHECK(path("foo").normalize(), "foo");
|
||||
PATH_CHECK(path("foo/").normalize(), "foo/.");
|
||||
PATH_CHECK(path("f/").normalize(), "f/.");
|
||||
PATH_CHECK(path("/foo").normalize(), "/foo");
|
||||
PATH_CHECK(path("foo/bar").normalize(), "foo/bar");
|
||||
PATH_CHECK(path("..").normalize(), "..");
|
||||
PATH_CHECK(path("../..").normalize(), "../..");
|
||||
PATH_CHECK(path("/..").normalize(), "/..");
|
||||
PATH_CHECK(path("/../..").normalize(), "/../..");
|
||||
PATH_CHECK(path("../foo").normalize(), "../foo");
|
||||
PATH_CHECK(path("foo/..").normalize(), ".");
|
||||
PATH_CHECK(path("foo/../").normalize(), ".");
|
||||
PATH_CHECK((path("foo") / "..").normalize(), ".");
|
||||
PATH_CHECK(path("foo/...").normalize(), "foo/...");
|
||||
PATH_CHECK(path("foo/.../").normalize(), "foo/.../.");
|
||||
PATH_CHECK(path("foo/..bar").normalize(), "foo/..bar");
|
||||
PATH_CHECK(path("../f").normalize(), "../f");
|
||||
PATH_CHECK(path("/../f").normalize(), "/../f");
|
||||
PATH_CHECK(path("f/..").normalize(), ".");
|
||||
PATH_CHECK((path("f") / "..").normalize(), ".");
|
||||
PATH_CHECK(path("foo/../..").normalize(), "..");
|
||||
PATH_CHECK(path("foo/../../").normalize(), "../.");
|
||||
PATH_CHECK(path("foo/../../..").normalize(), "../..");
|
||||
PATH_CHECK(path("foo/../../../").normalize(), "../../.");
|
||||
PATH_CHECK(path("foo/../bar").normalize(), "bar");
|
||||
PATH_CHECK(path("foo/../bar/").normalize(), "bar/.");
|
||||
PATH_CHECK(path("foo/bar/..").normalize(), "foo");
|
||||
PATH_CHECK(path("foo/bar/../").normalize(), "foo/.");
|
||||
PATH_CHECK(path("foo/bar/../..").normalize(), ".");
|
||||
PATH_CHECK(path("foo/bar/../../").normalize(), ".");
|
||||
PATH_CHECK(path("foo/bar/../blah").normalize(), "foo/blah");
|
||||
PATH_CHECK(path("f/../b").normalize(), "b");
|
||||
PATH_CHECK(path("f/b/..").normalize(), "f");
|
||||
PATH_CHECK(path("f/b/../").normalize(), "f/.");
|
||||
PATH_CHECK(path("f/b/../a").normalize(), "f/a");
|
||||
PATH_CHECK(path("foo/bar/blah/../..").normalize(), "foo");
|
||||
PATH_CHECK(path("foo/bar/blah/../../bletch").normalize(), "foo/bletch");
|
||||
PATH_CHECK(path("//net").normalize(), "//net");
|
||||
PATH_CHECK(path("//net/").normalize(), "//net/");
|
||||
PATH_CHECK(path("//..net").normalize(), "//..net");
|
||||
PATH_CHECK(path("//net/..").normalize(), "//net/..");
|
||||
PATH_CHECK(path("//net/foo").normalize(), "//net/foo");
|
||||
PATH_CHECK(path("//net/foo/").normalize(), "//net/foo/.");
|
||||
PATH_CHECK(path("//net/foo/..").normalize(), "//net/");
|
||||
PATH_CHECK(path("//net/foo/../").normalize(), "//net/.");
|
||||
|
||||
PATH_CHECK(path("/net/foo/bar").normalize(), "/net/foo/bar");
|
||||
PATH_CHECK(path("/net/foo/bar/").normalize(), "/net/foo/bar/.");
|
||||
PATH_CHECK(path("/net/foo/..").normalize(), "/net");
|
||||
PATH_CHECK(path("/net/foo/../").normalize(), "/net/.");
|
||||
|
||||
PATH_CHECK(path("//net//foo//bar").normalize(), "//net/foo/bar");
|
||||
PATH_CHECK(path("//net//foo//bar//").normalize(), "//net/foo/bar/.");
|
||||
PATH_CHECK(path("//net//foo//..").normalize(), "//net/");
|
||||
PATH_CHECK(path("//net//foo//..//").normalize(), "//net/.");
|
||||
|
||||
PATH_CHECK(path("///net///foo///bar").normalize(), "/net/foo/bar");
|
||||
PATH_CHECK(path("///net///foo///bar///").normalize(), "/net/foo/bar/.");
|
||||
PATH_CHECK(path("///net///foo///..").normalize(), "/net");
|
||||
PATH_CHECK(path("///net///foo///..///").normalize(), "/net/.");
|
||||
|
||||
if (platform == "Windows")
|
||||
{
|
||||
PATH_CHECK(path("c:..").normalize(), "c:..");
|
||||
PATH_CHECK(path("c:foo/..").normalize(), "c:");
|
||||
|
||||
PATH_CHECK(path("c:foo/../").normalize(), "c:.");
|
||||
|
||||
PATH_CHECK(path("c:/foo/..").normalize(), "c:/");
|
||||
PATH_CHECK(path("c:/foo/../").normalize(), "c:/.");
|
||||
PATH_CHECK(path("c:/..").normalize(), "c:/..");
|
||||
PATH_CHECK(path("c:/../").normalize(), "c:/../.");
|
||||
PATH_CHECK(path("c:/../..").normalize(), "c:/../..");
|
||||
PATH_CHECK(path("c:/../../").normalize(), "c:/../../.");
|
||||
PATH_CHECK(path("c:/../foo").normalize(), "c:/../foo");
|
||||
PATH_CHECK(path("c:/../foo/").normalize(), "c:/../foo/.");
|
||||
PATH_CHECK(path("c:/../../foo").normalize(), "c:/../../foo");
|
||||
PATH_CHECK(path("c:/../../foo/").normalize(), "c:/../../foo/.");
|
||||
PATH_CHECK(path("c:/..foo").normalize(), "c:/..foo");
|
||||
}
|
||||
else // POSIX
|
||||
{
|
||||
PATH_CHECK(path("c:..").normalize(), "c:..");
|
||||
PATH_CHECK(path("c:foo/..").normalize(), ".");
|
||||
PATH_CHECK(path("c:foo/../").normalize(), ".");
|
||||
PATH_CHECK(path("c:/foo/..").normalize(), "c:");
|
||||
PATH_CHECK(path("c:/foo/../").normalize(), "c:/.");
|
||||
PATH_CHECK(path("c:/..").normalize(), ".");
|
||||
PATH_CHECK(path("c:/../").normalize(), ".");
|
||||
PATH_CHECK(path("c:/../..").normalize(), "..");
|
||||
PATH_CHECK(path("c:/../../").normalize(), "../.");
|
||||
PATH_CHECK(path("c:/../foo").normalize(), "foo");
|
||||
PATH_CHECK(path("c:/../foo/").normalize(), "foo/.");
|
||||
PATH_CHECK(path("c:/../../foo").normalize(), "../foo");
|
||||
PATH_CHECK(path("c:/../../foo/").normalize(), "../foo/.");
|
||||
PATH_CHECK(path("c:/..foo").normalize(), "c:/..foo");
|
||||
}
|
||||
}
|
||||
|
||||
// misc_test ------------------------------------------------------------------------//
|
||||
|
||||
void misc_test()
|
||||
{
|
||||
fs::path p;
|
||||
|
||||
fs::initial_path< fs::path >();
|
||||
fs::initial_path< fs::wpath >();
|
||||
|
||||
p.file_string();
|
||||
p.directory_string();
|
||||
}
|
||||
|
||||
// path_container_ctor_test ---------------------------------------------------------//
|
||||
|
||||
void path_container_ctor_test()
|
||||
@@ -188,28 +69,6 @@ void path_container_ctor_test()
|
||||
BOOST_TEST_EQ(xll.native().size(), 7U);
|
||||
}
|
||||
|
||||
|
||||
// path_rename_test -----------------------------------------------------------------//
|
||||
|
||||
void path_rename_test()
|
||||
{
|
||||
fs::path p("foo/bar/blah");
|
||||
|
||||
BOOST_TEST_EQ(path("foo/bar/blah").remove_leaf(), "foo/bar");
|
||||
BOOST_TEST_EQ(p.leaf(), "blah");
|
||||
BOOST_TEST_EQ(p.branch_path(), "foo/bar");
|
||||
BOOST_TEST(p.has_leaf());
|
||||
BOOST_TEST(p.has_branch_path());
|
||||
BOOST_TEST(!p.is_complete());
|
||||
|
||||
if (platform == "Windows")
|
||||
{
|
||||
BOOST_TEST_EQ(path("foo\\bar\\blah").remove_leaf(), "foo\\bar");
|
||||
p = "foo\\bar\\blah";
|
||||
BOOST_TEST_EQ(p.branch_path(), "foo\\bar");
|
||||
}
|
||||
}
|
||||
|
||||
} // unnamed namespace
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
@@ -261,54 +120,12 @@ int cpp_main(int /*argc*/, char* /*argv*/[])
|
||||
de.replace_filename("bar.foo", fs::file_status(), fs::file_status());
|
||||
BOOST_TEST(de.path() == "bar.foo");
|
||||
|
||||
de.replace_leaf("", fs::file_status(), fs::file_status());
|
||||
|
||||
//de.leaf();
|
||||
//de.string();
|
||||
|
||||
fs::path ng(" no-way, Jose");
|
||||
BOOST_TEST(!fs::is_regular(ng)); // verify deprecated name still works
|
||||
BOOST_TEST(!fs::symbolic_link_exists("nosuchfileordirectory"));
|
||||
|
||||
const fs::path temp_dir(fs::current_path() / ".." / fs::unique_path("deprecated_test-%%%%-%%%%-%%%%"));
|
||||
std::cout << "temp_dir is " << temp_dir.string() << std::endl;
|
||||
|
||||
fs::create_directory(temp_dir);
|
||||
|
||||
misc_test();
|
||||
path_container_ctor_test();
|
||||
path_rename_test();
|
||||
normalize_test();
|
||||
|
||||
BOOST_TEST(fs::path("foo/bar").generic() == fs::path("foo/bar"));
|
||||
|
||||
// extension() tests ---------------------------------------------------------//
|
||||
|
||||
BOOST_TEST(fs::extension("a/b") == "");
|
||||
BOOST_TEST(fs::extension("a/b.txt") == ".txt");
|
||||
BOOST_TEST(fs::extension("a/b.") == ".");
|
||||
BOOST_TEST(fs::extension("a.b.c") == ".c");
|
||||
BOOST_TEST(fs::extension("a.b.c.") == ".");
|
||||
BOOST_TEST(fs::extension("") == "");
|
||||
BOOST_TEST(fs::extension("a/") == "");
|
||||
|
||||
// basename() tests ----------------------------------------------------------//
|
||||
|
||||
BOOST_TEST(fs::basename("b") == "b");
|
||||
BOOST_TEST(fs::basename("a/b.txt") == "b");
|
||||
BOOST_TEST(fs::basename("a/b.") == "b");
|
||||
BOOST_TEST(fs::basename("a.b.c") == "a.b");
|
||||
BOOST_TEST(fs::basename("a.b.c.") == "a.b.c");
|
||||
BOOST_TEST(fs::basename("") == "");
|
||||
|
||||
// change_extension tests ---------------------------------------------------//
|
||||
|
||||
BOOST_TEST(fs::change_extension("a.txt", ".tex").string() == "a.tex");
|
||||
BOOST_TEST(fs::change_extension("a.", ".tex").string() == "a.tex");
|
||||
BOOST_TEST(fs::change_extension("a", ".txt").string() == "a.txt");
|
||||
BOOST_TEST(fs::change_extension("a.b.txt", ".tex").string() == "a.b.tex");
|
||||
// see the rationale in html docs for explanation why this works
|
||||
BOOST_TEST(fs::change_extension("", ".png").string() == ".png");
|
||||
|
||||
std::cout << "post-test removal of " << temp_dir << std::endl;
|
||||
BOOST_TEST(fs::remove_all(temp_dir) != 0);
|
||||
|
||||
Reference in New Issue
Block a user