mirror of
https://github.com/boostorg/filesystem.git
synced 2026-01-19 04:12:09 +00:00
Added BOOST_FILESYSTEM_VERSION 4 and moved breaking path changes to v4.
Boost.Filesystem v4 will contain breaking changes from v3 that are required for better compatibility with C++17 std::filesystem. It will also remove the deprecated features of v3. Updated docs to reflect the differences between v3 and v4. Updated tests to verify both v3 and v4 where the differences are present.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
width="300" height="86" border="0"></a></td>
|
||||
<td align="middle">
|
||||
<font size="7">Filesystem Library<br>
|
||||
Version 3</font>
|
||||
Version 4</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -34,6 +34,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
@@ -147,6 +148,9 @@ concerned with writing code to run on multiple operating systems.</p>
|
||||
<p><b><a href="deprecated.html">Deprecated Features</a></b> - Identifies
|
||||
deprecated features and their replacements.</p>
|
||||
|
||||
<p><b><a href="v4.html">Version 4 Description</a></b> - Summary of changes from
|
||||
Version 3.</p>
|
||||
|
||||
<p><b><a href="v3.html">Version 3 Introduction</a></b> - Aimed at users of prior
|
||||
Boost.Filesystem versions.</p>
|
||||
|
||||
@@ -229,11 +233,12 @@ noexcept</code> never throw exceptions.</p>
|
||||
<li>Header <<a href="../../../boost/filesystem.hpp">boost/filesystem.hpp</a>>
|
||||
provides access to all features of the library, except file streams.<br>
|
||||
</li>
|
||||
<li>Header <<a href="../../../boost/filesystem/fstream.hpp">boost/filesystem<i>/</i>fstream.hpp</a>>
|
||||
<li>Header <<a href="../../../boost/filesystem/fstream.hpp">boost/filesystem/fstream.hpp</a>>
|
||||
inherits the same components as the C++ Standard
|
||||
Library's <i>fstream</i> header, but files are identified by <code>const path&</code>
|
||||
arguments rather that <code>const char*</code> arguments.</li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="Examples">Example programs</a></h2>
|
||||
<p>See the <a href="tutorial.html">tutorial</a> for example programs.</p>
|
||||
<h2><a name="Implementation">Implementation</a></h2>
|
||||
@@ -242,6 +247,7 @@ the POSIX or Windows API's.</p>
|
||||
<p>The library is in regular use on Apple OS X, HP-UX, IBM AIX, Linux,
|
||||
Microsoft Windows, SGI IRIX, and Sun Solaris operating systems using a variety
|
||||
of compilers. It is also used by several smart phone operating systems.</p>
|
||||
|
||||
<h2><a name="Macros">Macros</a></h2>
|
||||
<p>Users may define the following macros if desired. Sensible defaults are
|
||||
provided, so users can ignore these macros unless they have special needs.</p>
|
||||
@@ -251,6 +257,12 @@ provided, so users can ignore these macros unless they have special needs.</p>
|
||||
<td><b><i>Default</i></b></td>
|
||||
<td><b><i>Effect if defined</i></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><code>BOOST_FILESYSTEM_VERSION</code></td>
|
||||
<td valign="top">3</td>
|
||||
<td valign="top">Selects the Boost.Filesystem library version. Can have values of 3 or 4.
|
||||
Defining to 4 also implies <code>BOOST_FILESYSTEM_NO_DEPRECATED</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><code>BOOST_FILESYSTEM_NO_DEPRECATED</code></td>
|
||||
<td valign="top">Not defined.</td>
|
||||
@@ -321,7 +333,7 @@ systems and so will work with the Filesystem Library.</p>
|
||||
This is controlled by the BOOST_ALL_DYN_LINK or BOOST_FILESYSTEM_DYN_LINK
|
||||
macros. See the <a href="http://www.boost.org/development/separate_compilation.html">Separate
|
||||
Compilation</a> page for a description of the techniques used.</p>
|
||||
<h3>Note for <a name="Cgywin">Cygwin</a> users</h3>
|
||||
<h3>Note for <a name="Cygwin">Cygwin</a> users</h3>
|
||||
<p> <a href="http://www.cygwin.com/">Cygwin</a> version 1.7 or later is
|
||||
required because only versions of GCC with wide character strings are supported.</p>
|
||||
|
||||
@@ -333,11 +345,12 @@ syntax.</p>
|
||||
|
||||
<h3>Version 4</h3>
|
||||
|
||||
<p><b>Under development </b>- Add support for the
|
||||
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4099.html">ISO
|
||||
C++ File System Technical Specification</a>. The Filesystem TS is based on
|
||||
<p><b>Under development</b> - Improve compatibility with std::filesystem introduced in C++17
|
||||
(original proposal: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4099.html">ISO
|
||||
C++ File System Technical Specification</a>). The Filesystem TS was based on
|
||||
Boost.Filesystem Version 3, with only a small number of changes. Most user code
|
||||
written for Version 3 should work unchanged with Version 4.</p>
|
||||
written for Version 3 should work unchanged with Version 4. The differences can be seen in a
|
||||
<a href="v4.html">separate section</a>.</p>
|
||||
|
||||
<h3>Version 3</h3>
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
|
||||
@@ -25,6 +25,7 @@ Guide</h1>
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
<img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" width="300" height="86" border="0"></a></td>
|
||||
<td align="middle">
|
||||
<font size="7">Filesystem Library<br>
|
||||
</font>
|
||||
<font size="6">Version 3</font></td>
|
||||
Version 4</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -40,6 +39,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
@@ -271,7 +271,7 @@ limitations of actual operating systems and file systems. If an implementation c
|
||||
reasonable behavior, the implementation shall report an error in an
|
||||
implementation-defined manner.</p>
|
||||
<blockquote>
|
||||
<p>[<i>Note:</i> Such errors might be reported by an #error directive, a <code>
|
||||
<p>[<i>Note:</i> Such errors might be reported by an <code>#error</code> directive, a <code>
|
||||
static_assert</code>, a <code>filesystem_error</code> exception, a special
|
||||
return value, or some other manner. <i>—end note</i>]</p>
|
||||
</blockquote>
|
||||
@@ -696,7 +696,7 @@ nothing else."</p>
|
||||
|
||||
bool lexicographical_compare(path::iterator first1, path::iterator last1,
|
||||
path::iterator first2, path::iterator last2);
|
||||
void swap(path& lhs, path& rhs);
|
||||
void swap(path& lhs, path& rhs) noexcept;
|
||||
std::size_t <a href="#hash_value">hash_value</a>(const path& p);
|
||||
|
||||
bool operator==(const path& lhs, const path& rhs);
|
||||
@@ -1122,7 +1122,7 @@ system or for a particular file system.</p>
|
||||
path& <a href="#path-make_preferred">make_preferred</a>();
|
||||
path& <a href="#path-remove_filename">remove_filename</a>();
|
||||
path& <a href="#path-replace_extension">replace_extension</a>(const path& new_extension = path());
|
||||
void <a href="#path-swap">swap</a>(path& rhs);
|
||||
void <a href="#path-swap">swap</a>(path& rhs) noexcept;
|
||||
|
||||
// lexical operations
|
||||
path <a href="#lexically_normal">lexically_normal</a>() const;
|
||||
@@ -1224,7 +1224,7 @@ library</i> [res.on.objects] would thus apply. <i>—end note</i>]</p>
|
||||
|
||||
<p>Visual C++ at least through version 2012 does not employ C++11-style static
|
||||
initialization locks, so the initialization of <code>path::codecvt()</code> can
|
||||
race, either with itself or <code>path::imbue::()</code> if they are called from
|
||||
race, either with itself or <code>path::imbue()</code> if they are called from
|
||||
a different thread. A workaround is to call:</p>
|
||||
|
||||
<blockquote>
|
||||
@@ -1714,14 +1714,16 @@ std::cout << path("..").parent_path(); // outputs &quo
|
||||
<pre>path <a name="path-filename">filename</a>() const;</pre>
|
||||
|
||||
<blockquote>
|
||||
<p><i>Returns:</i> <code>*this == <a href="#path-root_path">root_path</a>() ? path() : *--end()</code></p>
|
||||
<p><i>Returns:</i> <b>v3:</b> <code>empty() ? path() : *--end()</code><br/>
|
||||
<b>v4:</b> <code>*this == <a href="#path-root_path">root_path</a>() ? path() : *--end()</code></p>
|
||||
<p>[<i>Example:</i></p>
|
||||
<blockquote>
|
||||
|
||||
<pre>std::cout << path("/foo/bar.txt").filename(); // outputs "bar.txt"
|
||||
std::cout << path("/foo/bar").filename(); // outputs "bar"
|
||||
std::cout << path("/foo/bar/").filename(); // outputs "."
|
||||
std::cout << path("/").filename(); // outputs ""
|
||||
std::cout << path("/").filename(); // v3 outputs "/"
|
||||
// v4 outputs ""
|
||||
std::cout << path(".").filename(); // outputs "."
|
||||
std::cout << path("..").filename(); // outputs ".."</pre>
|
||||
|
||||
@@ -1736,14 +1738,15 @@ std::cout << path("..").filename(); // outputs ".
|
||||
|
||||
<blockquote>
|
||||
<p><i>Returns:</i> If <code>p.<a href="path-filename">filename</a>()</code> does not contain dots, consist solely of one
|
||||
or to two dots, or contains exactly one dot as the initial character, returns <code>p.filename()</code>.
|
||||
or to two dots, <i>[Since <b>v4</b>:</i> or contains exactly one dot as the initial character,<i>]</i> returns <code>p.filename()</code>.
|
||||
Otherwise returns the substring of <code>p.filename()</code> starting at its beginning and
|
||||
ending at the last dot (the dot is not included).</p>
|
||||
<p>[<i>Example:</i></p>
|
||||
<blockquote>
|
||||
|
||||
<pre>std::cout << path("/foo/bar.txt").stem() << '\n'; // outputs "bar"
|
||||
std::cout << path(".hidden").stem() << '\n'; // outputs ".hidden"
|
||||
std::cout << path(".hidden").stem() << '\n'; // v3 outputs ""
|
||||
// v4 outputs ".hidden"
|
||||
path p = "foo.bar.baz.tar";
|
||||
for (; !p.extension().empty(); p = p.stem())
|
||||
std::cout << p.extension() << '\n';
|
||||
@@ -2066,14 +2069,13 @@ const string_type external_directory_string() const { return native(); }</pre>
|
||||
relative</a></code> <i>—end note</i>]</p>
|
||||
<p>[<i>Note:</i> If <a href="#normal-form">normalization</a> is needed to ensure consistent matching of elements, wrap
|
||||
<code>p</code>, <code>base</code>, or both in calls <code>
|
||||
<a href="#lex-normal">
|
||||
lexically_normal()</a></code>. <i>—end note</i>]</p>
|
||||
<a href="#lex-normal">lexically_normal</a>()</code>. <i>—end note</i>]</p>
|
||||
</blockquote>
|
||||
<pre>void swap( path& lhs, path& rhs )</pre>
|
||||
<pre>void swap(path& lhs, path& rhs) noexcept;</pre>
|
||||
<blockquote>
|
||||
<p><i>Effects: </i><code>lhs.swap(rhs)</code>.</p>
|
||||
</blockquote>
|
||||
<pre>std::size_t <a name="hash_value">hash_value</a> (const path& p);</pre>
|
||||
<pre>std::size_t <a name="hash_value">hash_value</a>(const path& p);</pre>
|
||||
<blockquote>
|
||||
<p><i>Returns:</i> A hash value for the path <code>p</code>. If
|
||||
for two paths, <code>p1 == p2</code> then <code>hash_value(p1) == hash_value(p2)</code>.</p>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
@@ -40,6 +41,11 @@
|
||||
|
||||
<h2>1.77.0</h2>
|
||||
<ul>
|
||||
<li><b>Introducing Boost.Filesystem v4.</b> This new version of the library removes all deprecated features of v3 and also makes a number of breaking API changes intended to make Boost.Filesystem more compatible with std::filesystem introduced in C++17. The differences are described in the release notes and documentation using <b>v3</b> and <b>v4</b> tags and are also summarised in a <a href="v4.html">separate section</a>. Users can select Boost.Filesystem version by defining <code>BOOST_FILESYSTEM_VERSION</code> macro to either 3 or 4 when compiling their code. There is no need to separately compile Boost.Filesystem for each library version — a single binary supports both v3 and v4. Users should avoid using both v3 and v4 in the same application as this can lead to subtle bugs. Currently, v3 is the default. In a future release v4 will become the default, and eventually v3 will be removed. v4 is functional, but it is still a work in progress and there may be breaking API changes in the future.</li>
|
||||
<li><b>v4:</b> <code>path::filename</code>, <code>path::stem</code> and <code>path::extension</code> no longer consider root name or root directory of the path as a filename if the path only consists of those components. For example, on Windows <code>path("C:").filename()</code> used to return "C:" and <code>path("C:\").filename()</code> used to return "\" and both will return an empty path now. (<a href="https://github.com/boostorg/filesystem/issues/88">#88</a>, <a href="https://github.com/boostorg/filesystem/issues/194">#194</a>)</li>
|
||||
<li><b>v4:</b> <code>path::stem</code> and <code>path::extension</code> no longer treat a filename that starts with a dot and has no other dots as an extension. Filenames starting with a dot are commonly treated as filenames with an empty extension. The leading dot is used to indicate a hidden file on most UNIX-like systems. (<a href="https://github.com/boostorg/filesystem/issues/88">#88</a>)</li>
|
||||
<li><b>New:</b> Improved support for various path prefixes on Windows. Added support for local device prefix ("\\.\") and experimental support for NT path prefix ("\??\"). The prefixes will be included in the root name of a path. Note that using the prefixes with Boost.Filesystem v3 can lead to surprising results (e.g. <code>path("\\\\.\\").stem() == "\\\\"</code>). It is recommended to use the prefixes only with Boost.Filesystem v4.</li>
|
||||
<li>Reworked <code>path::lexically_normal</code> implementation to eliminate some cases of duplicate dot (".") elements in the normalized paths.</li>
|
||||
<li><b>New:</b> Added support for disabling usage of various system APIs at library build time. This can be useful when a certain API is detected as present by the library configuration scripts but must not be used for some reason (for example, when it is known to fail on the target system). See the description of <a href="index.htm#Macros">configuration macros</a> for more details.</li>
|
||||
<li><b>New:</b> Added <code>copy_options::synchronize_data</code> and <code>copy_options::synchronize</code> options for the <code>copy_file</code> operation. These options allow to synchronize the written data and attributes with the permanent storage. These options are expensive in terms of performance, but allow to ensure reliability of the copied data. Note that <code>copy_file</code> performed implicit data synchronization on POSIX systems since Boost.Filesystem 1.74.0. This release adds support for more platforms and disables data synchronization by default while allowing the caller to explicitly request it. (<a href="https://github.com/boostorg/filesystem/issues/186">#186</a>)</li>
|
||||
<li>Added handling of <code>EINTR</code> error code on POSIX systems for some system calls issued internally. In particular, <code>EINTR</code> could have been ignored on <code>close</code>, which on HP-UX would result in a leaked file descriptor.</li>
|
||||
@@ -52,11 +58,7 @@
|
||||
<li>In <code>canonical</code>, added a limit for the maximum number of symlinks that can be resolved during the call. The limit is currently at least 40 symlinks.</li>
|
||||
<li>On Windows, <code>canonical</code> and <code>weakly_canonical</code> will now use <code>path::preferred_separator</code> for the root directory separator in the resulting paths. This fixes "file not found" errors caused by Windows API not handling generic separators in UNC paths and paths that start with the Win32 filesystem prefix ("\\?\"). (<a href="https://github.com/boostorg/filesystem/issues/87">#87</a>, <a href="https://github.com/boostorg/filesystem/issues/187">#187</a>)</li>
|
||||
<li><b>New:</b> Added <code>weakly_canonical</code> overloads taking <code>base</code> path as an argument.</li>
|
||||
<li><b>Breaking change:</b><code>path::filename</code>, <code>path::stem</code> and <code>path::extension</code> no longer consider root name or root directory of the path as a filename if the path only consists of those components. For example, on Windows <code>path("C:").filename()</code> used to return "C:" and <code>path("C:\").filename()</code> used to return "\" and both will return an empty path now. (<a href="https://github.com/boostorg/filesystem/issues/88">#88</a>, <a href="https://github.com/boostorg/filesystem/issues/194">#194</a>)</li>
|
||||
<li><b>Breaking change:</b><code>path::stem</code> and <code>path::extension</code> no longer treat a filename that starts with a dot and has no other dots as an extension. Filenames starting with a dot are commonly treated as filenames with an empty extension. The leading dot is used to indicate a hidden file on most UNIX-like systems. (<a href="https://github.com/boostorg/filesystem/issues/88">#88</a>)</li>
|
||||
<li><b>New:</b> Improved support for various path prefixes on Windows. Added support for local device prefix ("\\.\") and experimental support for NT path prefix ("\??\"). The prefixes will be included in the root name of a path.</li>
|
||||
<li>In <code>read_symlink</code> on Windows, corrected reparse point handling. The operation would return an empty path for some mount points (for example, created by <a href="https://www.box.com/">Box</a> cloud storage driver) and directory junction points that had empty print names. The new implementation now parses substitute name of the reparse point and attempts to reconstruct a Win32 path from it. (<a href="https://github.com/boostorg/filesystem/issues/187">#187</a>)</li>
|
||||
<li>Reworked <code>path::lexically_normal</code> implementation to eliminate some cases of duplicate dot (".") elements in the normalized paths.</li>
|
||||
<li>On Windows, file streams provided in <code>boost/filesystem/fstream.hpp</code> will use wide character paths on libc++ versions 7.0 and higher, when the standard library supports opening files with wide character paths. (<a href="https://github.com/boostorg/filesystem/issues/181">#181</a>)</li>
|
||||
<li>On Windows, creating symlinks should no longer require elevated privileges, if Windows is configured in <a href="https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development">Developer mode</a>.</li>
|
||||
</ul>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
@@ -95,9 +96,8 @@ aids that allow much existing code to compile without change using Version 3.</p
|
||||
|
||||
<h2>Breaking changes</h2>
|
||||
|
||||
<p>To ease the transition, Versions 2 and 3 will both be included in the next
|
||||
several Boost releases. Version 2 will be the default version for one release
|
||||
cycle, and then Version 3 will become the default version.</p>
|
||||
<p>To ease the transition, Versions 2 and 3 both used to be included in the next
|
||||
several Boost releases. Version 2 was removed in Boost 1.50.0.</p>
|
||||
<h3>Class <code>path</code></h3>
|
||||
<ul>
|
||||
<li>Class template <code>basic_path</code> and its specializations are
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
|
||||
61
doc/v4.html
Normal file
61
doc/v4.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Filesystem V4</title>
|
||||
<link href="styles.css" rel="stylesheet">
|
||||
|
||||
<body>
|
||||
|
||||
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
|
||||
<tr>
|
||||
<td width="277">
|
||||
<a href="../../../index.htm">
|
||||
<img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" width="300" height="86" border="0"></a></td>
|
||||
<td align="middle">
|
||||
<font size="7">Filesystem
|
||||
Version 4<br></font></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse"
|
||||
bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
|
||||
<tr>
|
||||
<td><a href="index.htm">Home</a>
|
||||
<a href="tutorial.html">Tutorial</a>
|
||||
<a href="reference.html">Reference</a>
|
||||
<a href="faq.htm">FAQ</a>
|
||||
<a href="release_history.html">Releases</a>
|
||||
<a href="portability_guide.htm">Portability</a>
|
||||
<a href="v4.html">V4</a>
|
||||
<a href="v3.html">V3 Intro</a>
|
||||
<a href="v3_design.html">V3 Design</a>
|
||||
<a href="deprecated.html">Deprecated</a>
|
||||
<a href="issue_reporting.html">Bug Reports </a>
|
||||
</td>
|
||||
</table>
|
||||
|
||||
<h1>Boost Filesystem Version 4</h1>
|
||||
|
||||
<p>Version 4 is a significant revision of the Boost Filesystem library that makes its interface and
|
||||
behavior closer to std::filesystem that was introduced in C++17 and updated in the later standards.
|
||||
It removes the features that were <a href="deprecated.html">deprecated</a> in Version 3 and makes a number of breaking changes.</p>
|
||||
|
||||
<p>Users can select Boost.Filesystem v4 version by defining <code>BOOST_FILESYSTEM_VERSION</code> macro to 4 when compiling their code. There is no need to separately compile Boost.Filesystem for each library version — a single binary supports both v3 and v4. Users should avoid using both v3 and v4 in the same application as this can lead to subtle bugs.</p>
|
||||
|
||||
<h2>Breaking changes</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="reference.html#path-filename"><code>path::filename</code></a> no longer returns root name or root directory if the path contains no
|
||||
other elements. For example, on Windows <code>path("C:").filename()</code> used to return "C:" and <code>path("C:\").filename()</code> used to return "\" and both will return an empty path now. This also affects <code>path::stem</code> and <code>path::extension</code> methods, as those are based on <code>path::filename</code>.</li>
|
||||
<li><a href="reference.html#path-stem"><code>path::stem</code></a> and <a href="reference.html#path-extension"><code>path::extension</code></a> no longer treat a filename that starts with a dot and has no other dots as an extension. Filenames starting with a dot are commonly treated as filenames with an empty extension. The leading dot is used to indicate a hidden file on most UNIX-like systems.</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
<p>© Copyright Andrey Semashev, 2021</p>
|
||||
<p>Distributed under 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>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
// See http://www.boost.org/libs/filesystem for documentation.
|
||||
|
||||
#define BOOST_FILESYSTEM_VERSION 3
|
||||
|
||||
// As an example program, we don't want to use any deprecated features
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
#define BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// boost/filesystem/v3/config.hpp ----------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2003
|
||||
// Copyright Andrey Semashev 2021
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
@@ -9,18 +10,8 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_CONFIG_HPP
|
||||
#define BOOST_FILESYSTEM3_CONFIG_HPP
|
||||
|
||||
#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3
|
||||
#error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_VERSION)
|
||||
#define BOOST_FILESYSTEM_VERSION 3
|
||||
#endif
|
||||
|
||||
#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
|
||||
#ifndef BOOST_FILESYSTEM_CONFIG_HPP
|
||||
#define BOOST_FILESYSTEM_CONFIG_HPP
|
||||
|
||||
// This header implements separate compilation features as described in
|
||||
// http://www.boost.org/more/separate_compilation.html
|
||||
@@ -29,6 +20,28 @@
|
||||
#include <boost/system/api_config.hpp> // for BOOST_POSIX_API or BOOST_WINDOWS_API
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION != 3 && BOOST_FILESYSTEM_VERSION != 4
|
||||
#error Compiling Boost.Filesystem file with BOOST_FILESYSTEM_VERSION defined != 3 or 4
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_FILESYSTEM_SOURCE)
|
||||
#undef BOOST_FILESYSTEM_VERSION
|
||||
#define BOOST_FILESYSTEM_VERSION 4
|
||||
#elif !defined(BOOST_FILESYSTEM_VERSION)
|
||||
#define BOOST_FILESYSTEM_VERSION 3
|
||||
#endif
|
||||
|
||||
#define BOOST_FILESYSTEM_VERSIONED_SYM(sym) BOOST_JOIN(sym, BOOST_JOIN(_v, BOOST_FILESYSTEM_VERSION))
|
||||
|
||||
#if BOOST_FILESYSTEM_VERSION == 4
|
||||
#undef BOOST_FILESYSTEM_DEPRECATED
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
#define BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
|
||||
|
||||
// BOOST_FILESYSTEM_DEPRECATED needed for source compiles -----------------------------//
|
||||
|
||||
#ifdef BOOST_FILESYSTEM_SOURCE
|
||||
@@ -109,4 +122,4 @@
|
||||
#include <boost/config/auto_link.hpp>
|
||||
#endif // auto-linking disabled
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_CONFIG_HPP
|
||||
#endif // BOOST_FILESYSTEM_CONFIG_HPP
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
// 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)
|
||||
@@ -10,8 +11,8 @@
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_CONVENIENCE_HPP
|
||||
#define BOOST_FILESYSTEM3_CONVENIENCE_HPP
|
||||
#ifndef BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
#define BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
@@ -48,4 +49,4 @@ inline path change_extension(const path& p, const path& new_extension)
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_CONVENIENCE_HPP
|
||||
#endif // BOOST_FILESYSTEM_CONVENIENCE_HPP
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_DIRECTORY_HPP
|
||||
#define BOOST_FILESYSTEM3_DIRECTORY_HPP
|
||||
#ifndef BOOST_FILESYSTEM_DIRECTORY_HPP
|
||||
#define BOOST_FILESYSTEM_DIRECTORY_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
@@ -739,4 +739,4 @@ struct range_const_iterator< boost::filesystem::recursive_directory_iterator, vo
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_DIRECTORY_HPP
|
||||
#endif // BOOST_FILESYSTEM_DIRECTORY_HPP
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
// Library home page: http://www.boost.org/libs/filesystem
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_EXCEPTION_HPP
|
||||
#define BOOST_FILESYSTEM3_EXCEPTION_HPP
|
||||
#ifndef BOOST_FILESYSTEM_EXCEPTION_HPP
|
||||
#define BOOST_FILESYSTEM_EXCEPTION_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
@@ -89,4 +89,4 @@ private:
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_EXCEPTION_HPP
|
||||
#endif // BOOST_FILESYSTEM_EXCEPTION_HPP
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_FILE_STATUS_HPP
|
||||
#define BOOST_FILESYSTEM3_FILE_STATUS_HPP
|
||||
#ifndef BOOST_FILESYSTEM_FILE_STATUS_HPP
|
||||
#define BOOST_FILESYSTEM_FILE_STATUS_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/detail/bitmask.hpp>
|
||||
@@ -242,4 +242,4 @@ inline bool is_regular(file_status f) BOOST_NOEXCEPT
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp> // pops abi_prefix.hpp pragmas
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_FILE_STATUS_HPP
|
||||
#endif // BOOST_FILESYSTEM_FILE_STATUS_HPP
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// boost/filesystem/fstream.hpp ------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2002
|
||||
// Copyright Andrey Semashev 2021
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
@@ -9,8 +10,8 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_FSTREAM_HPP
|
||||
#define BOOST_FILESYSTEM3_FSTREAM_HPP
|
||||
#ifndef BOOST_FILESYSTEM_FSTREAM_HPP
|
||||
#define BOOST_FILESYSTEM_FSTREAM_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
@@ -202,4 +203,4 @@ typedef basic_fstream< wchar_t > wfstream;
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_FSTREAM_HPP
|
||||
#endif // BOOST_FILESYSTEM_FSTREAM_HPP
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Copyright Jan Langer 2002
|
||||
// Copyright Dietmar Kuehl 2001
|
||||
// Copyright Vladimir Prus 2002
|
||||
// Copyright Andrey Semashev 2020
|
||||
// Copyright Andrey Semashev 2020-2021
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_OPERATIONS_HPP
|
||||
#define BOOST_FILESYSTEM3_OPERATIONS_HPP
|
||||
#ifndef BOOST_FILESYSTEM_OPERATIONS_HPP
|
||||
#define BOOST_FILESYSTEM_OPERATIONS_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
@@ -716,4 +716,4 @@ BOOST_FILESYSTEM_DECL bool possible_large_file_size_support();
|
||||
|
||||
#include <boost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_OPERATIONS_HPP
|
||||
#endif // BOOST_FILESYSTEM_OPERATIONS_HPP
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// filesystem path.hpp ---------------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2002-2005, 2009
|
||||
// Copyright Vladimir Prus 2002
|
||||
// Copyright Beman Dawes 2002-2005, 2009
|
||||
// Copyright Andrey Semashev 2021
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
@@ -579,9 +580,9 @@ public:
|
||||
|
||||
path parent_path() const { return path(m_pathname.c_str(), m_pathname.c_str() + find_parent_path_size()); }
|
||||
|
||||
BOOST_FILESYSTEM_DECL path filename() const; // returns 0 or 1 element path
|
||||
BOOST_FILESYSTEM_DECL path stem() const; // returns 0 or 1 element path
|
||||
BOOST_FILESYSTEM_DECL path extension() const; // returns 0 or 1 element path
|
||||
BOOST_FORCEINLINE path filename() const { return BOOST_FILESYSTEM_VERSIONED_SYM(filename)(); } // returns 0 or 1 element path
|
||||
BOOST_FORCEINLINE path stem() const { return BOOST_FILESYSTEM_VERSIONED_SYM(stem)(); } // returns 0 or 1 element path
|
||||
BOOST_FORCEINLINE path extension() const { return BOOST_FILESYSTEM_VERSIONED_SYM(extension)(); } // returns 0 or 1 element path
|
||||
|
||||
// ----- query -----
|
||||
|
||||
@@ -593,7 +594,7 @@ public:
|
||||
bool has_root_directory() const { return find_root_directory().size > 0; }
|
||||
bool has_relative_path() const { return find_relative_path().size > 0; }
|
||||
bool has_parent_path() const { return find_parent_path_size() > 0; }
|
||||
BOOST_FILESYSTEM_DECL bool has_filename() const;
|
||||
BOOST_FORCEINLINE bool has_filename() const { return BOOST_FILESYSTEM_VERSIONED_SYM(has_filename)(); }
|
||||
bool has_stem() const { return !stem().empty(); }
|
||||
bool has_extension() const { return !extension().empty(); }
|
||||
bool is_relative() const { return !is_absolute(); }
|
||||
@@ -669,6 +670,15 @@ public:
|
||||
// class path private members //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
private:
|
||||
bool has_filename_v3() const { return !m_pathname.empty(); }
|
||||
BOOST_FILESYSTEM_DECL bool has_filename_v4() const;
|
||||
BOOST_FILESYSTEM_DECL path filename_v3() const;
|
||||
BOOST_FILESYSTEM_DECL path filename_v4() const;
|
||||
BOOST_FILESYSTEM_DECL path stem_v3() const;
|
||||
BOOST_FILESYSTEM_DECL path stem_v4() const;
|
||||
BOOST_FILESYSTEM_DECL path extension_v3() const;
|
||||
BOOST_FILESYSTEM_DECL path extension_v4() const;
|
||||
|
||||
// Returns: If separator is to be appended, m_pathname.size() before append. Otherwise 0.
|
||||
// Note: An append is never performed if size()==0, so a returned 0 is unambiguous.
|
||||
BOOST_FILESYSTEM_DECL string_type::size_type append_separator_if_needed();
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_SRC_ERROR_HANDLING_HPP_
|
||||
#define BOOST_FILESYSTEM3_SRC_ERROR_HANDLING_HPP_
|
||||
#ifndef BOOST_FILESYSTEM_SRC_ERROR_HANDLING_HPP_
|
||||
#define BOOST_FILESYSTEM_SRC_ERROR_HANDLING_HPP_
|
||||
|
||||
#include <cerrno>
|
||||
#include <boost/system/error_code.hpp>
|
||||
@@ -106,4 +106,4 @@ inline bool error(err_t error_num, path const& p1, path const& p2, system::error
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_SRC_ERROR_HANDLING_HPP_
|
||||
#endif // BOOST_FILESYSTEM_SRC_ERROR_HANDLING_HPP_
|
||||
|
||||
65
src/path.cpp
65
src/path.cpp
@@ -1,6 +1,7 @@
|
||||
// filesystem path.cpp ------------------------------------------------------------- //
|
||||
|
||||
// Copyright Beman Dawes 2008
|
||||
// Copyright Andrey Semashev 2021
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
@@ -352,7 +353,37 @@ BOOST_FILESYSTEM_DECL string_type::size_type path::find_parent_path_size() const
|
||||
return end_pos;
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL path path::filename() const
|
||||
BOOST_FILESYSTEM_DECL path path::filename_v3() const
|
||||
{
|
||||
const size_type size = m_pathname.size();
|
||||
size_type root_name_size = 0;
|
||||
size_type root_dir_pos = find_root_directory_start(m_pathname, size, root_name_size);
|
||||
size_type filename_size, pos;
|
||||
if (root_dir_pos < size && detail::is_directory_separator(m_pathname[size - 1]) && is_root_separator(m_pathname, root_dir_pos, size - 1))
|
||||
{
|
||||
// Return root directory
|
||||
pos = root_dir_pos;
|
||||
filename_size = 1u;
|
||||
}
|
||||
else if (root_name_size == size)
|
||||
{
|
||||
// Return root name
|
||||
pos = 0u;
|
||||
filename_size = root_name_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
filename_size = find_filename_size(m_pathname, root_name_size, size);
|
||||
pos = size - filename_size;
|
||||
if (filename_size == 0u && pos > root_name_size && detail::is_directory_separator(m_pathname[pos - 1]) && !is_root_separator(m_pathname, root_dir_pos, pos - 1))
|
||||
return detail::dot_path();
|
||||
}
|
||||
|
||||
const value_type* p = m_pathname.c_str() + pos;
|
||||
return path(p, p + filename_size);
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL path path::filename_v4() const
|
||||
{
|
||||
const size_type size = m_pathname.size();
|
||||
size_type root_name_size = 0;
|
||||
@@ -361,10 +392,11 @@ BOOST_FILESYSTEM_DECL path path::filename() const
|
||||
size_type pos = size - filename_size;
|
||||
if (filename_size == 0u && pos > root_name_size && detail::is_directory_separator(m_pathname[pos - 1]) && !is_root_separator(m_pathname, root_dir_pos, pos - 1))
|
||||
return detail::dot_path();
|
||||
return path(m_pathname.c_str() + pos, m_pathname.c_str() + size);
|
||||
const value_type* p = m_pathname.c_str() + pos;
|
||||
return path(p, p + filename_size);
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL bool path::has_filename() const
|
||||
BOOST_FILESYSTEM_DECL bool path::has_filename_v4() const
|
||||
{
|
||||
const size_type size = m_pathname.size();
|
||||
size_type root_name_size = 0;
|
||||
@@ -376,9 +408,21 @@ BOOST_FILESYSTEM_DECL bool path::has_filename() const
|
||||
return pos > root_name_size && detail::is_directory_separator(m_pathname[pos - 1]) && !is_root_separator(m_pathname, root_dir_pos, pos - 1);
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL path path::stem() const
|
||||
BOOST_FILESYSTEM_DECL path path::stem_v3() const
|
||||
{
|
||||
path name(filename());
|
||||
path name(filename_v3());
|
||||
if (name != detail::dot_path() && name != detail::dot_dot_path())
|
||||
{
|
||||
size_type pos = name.m_pathname.rfind(dot);
|
||||
if (pos != string_type::npos)
|
||||
name.m_pathname.erase(name.m_pathname.begin() + pos, name.m_pathname.end());
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL path path::stem_v4() const
|
||||
{
|
||||
path name(filename_v4());
|
||||
if (name != detail::dot_path() && name != detail::dot_dot_path())
|
||||
{
|
||||
size_type pos = name.m_pathname.rfind(dot);
|
||||
@@ -388,7 +432,16 @@ BOOST_FILESYSTEM_DECL path path::stem() const
|
||||
return name;
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL path path::extension() const
|
||||
BOOST_FILESYSTEM_DECL path path::extension_v3() const
|
||||
{
|
||||
path name(filename_v3());
|
||||
if (name == detail::dot_path() || name == detail::dot_dot_path())
|
||||
return path();
|
||||
size_type pos(name.m_pathname.rfind(dot));
|
||||
return pos == string_type::npos ? path() : path(name.m_pathname.c_str() + pos);
|
||||
}
|
||||
|
||||
BOOST_FILESYSTEM_DECL path path::extension_v4() const
|
||||
{
|
||||
path ext;
|
||||
const size_type size = m_pathname.size();
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
// Library home page: http://www.boost.org/libs/filesystem
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_WINDOWS_FILE_CODECVT_HPP
|
||||
#define BOOST_FILESYSTEM3_WINDOWS_FILE_CODECVT_HPP
|
||||
#ifndef BOOST_FILESYSTEM_WINDOWS_FILE_CODECVT_HPP
|
||||
#define BOOST_FILESYSTEM_WINDOWS_FILE_CODECVT_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
|
||||
@@ -65,4 +65,4 @@ protected:
|
||||
|
||||
#endif // BOOST_WINDOWS_API
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_WINDOWS_FILE_CODECVT_HPP
|
||||
#endif // BOOST_FILESYSTEM_WINDOWS_FILE_CODECVT_HPP
|
||||
|
||||
@@ -54,34 +54,36 @@ if [ os.environ UBSAN ]
|
||||
|
||||
run config_info.cpp : : : <link>shared <test-info>always_show_run_output ;
|
||||
run config_info.cpp : : : <link>static <test-info>always_show_run_output : config_info_static ;
|
||||
run convenience_test.cpp ;
|
||||
run convenience_test.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
compile macro_default_test.cpp ;
|
||||
run odr1_test.cpp odr2_test.cpp ;
|
||||
run deprecated_test.cpp ;
|
||||
run fstream_test.cpp : : : $(VIS) ;
|
||||
run large_file_support_test.cpp ;
|
||||
run locale_info.cpp : : : <test-info>always_show_run_output ;
|
||||
run operations_test.cpp : : : <link>shared <test-info>always_show_run_output ;
|
||||
run operations_test.cpp : : : <link>static : operations_test_static ;
|
||||
run operations_unit_test.cpp : $(HERE) : : <link>shared <test-info>always_show_run_output ;
|
||||
run copy_test.cpp ;
|
||||
run path_test.cpp : : : <link>shared ;
|
||||
run path_test.cpp : : : <link>static : path_test_static ;
|
||||
run path_unit_test.cpp : : : <link>shared $(VIS) ;
|
||||
run path_unit_test.cpp : : : <link>static $(VIS) : path_unit_test_static ;
|
||||
run relative_test.cpp ;
|
||||
run ../example/simple_ls.cpp ;
|
||||
run ../example/file_status.cpp ;
|
||||
run foreach_test.cpp ;
|
||||
run deprecated_test.cpp : : : <define>BOOST_FILESYSTEM_VERSION=3 ;
|
||||
run fstream_test.cpp : : : $(VIS) <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run large_file_support_test.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run locale_info.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 <test-info>always_show_run_output ;
|
||||
run operations_test.cpp : : : <link>shared <define>BOOST_FILESYSTEM_VERSION=4 <test-info>always_show_run_output ;
|
||||
run operations_test.cpp : : : <link>static <define>BOOST_FILESYSTEM_VERSION=4 : operations_test_static ;
|
||||
run operations_unit_test.cpp : $(HERE) : : <link>shared <define>BOOST_FILESYSTEM_VERSION=4 <test-info>always_show_run_output ;
|
||||
run copy_test.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run path_test.cpp : : : <link>shared <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run path_test.cpp : : : <link>static <define>BOOST_FILESYSTEM_VERSION=4 : path_test_static ;
|
||||
run path_test.cpp : : : <link>shared <define>BOOST_FILESYSTEM_VERSION=3 : path_test_v3 ;
|
||||
run path_unit_test.cpp : : : <link>shared $(VIS) <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run path_unit_test.cpp : : : <link>static $(VIS) <define>BOOST_FILESYSTEM_VERSION=4 : path_unit_test_static ;
|
||||
run path_unit_test.cpp : : : <link>shared $(VIS) <define>BOOST_FILESYSTEM_VERSION=3 : path_unit_test_v3 ;
|
||||
run relative_test.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run ../example/simple_ls.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run ../example/file_status.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run foreach_test.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
|
||||
# `quick` target (for CI)
|
||||
run quick.cpp ;
|
||||
run quick.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
|
||||
# Tests for specific issues
|
||||
run issues/70-71-copy.cpp ;
|
||||
run issues/70-71-copy.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
|
||||
run issues/99_canonical_with_junction_point.cpp ;
|
||||
run issues/reparse_tag_file_placeholder.cpp ;
|
||||
run issues/99_canonical_with_junction_point.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
run issues/reparse_tag_file_placeholder.cpp : : : <define>BOOST_FILESYSTEM_VERSION=4 ;
|
||||
|
||||
if [ os.environ BOOST_FILESYSTEM_TEST_WITH_EXAMPLES ]
|
||||
{
|
||||
|
||||
@@ -816,14 +816,22 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(path("/foo/bar.txt").filename() == "bar.txt");
|
||||
BOOST_TEST(path("/foo/bar").filename() == "bar");
|
||||
BOOST_TEST(path("/foo/bar/").filename() == ".");
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(path("/").filename() == "/");
|
||||
#else
|
||||
BOOST_TEST(path("/").filename() == "");
|
||||
#endif
|
||||
BOOST_TEST(path(".").filename() == ".");
|
||||
BOOST_TEST(path("..").filename() == "..");
|
||||
|
||||
// stem() tests not otherwise covered
|
||||
BOOST_TEST(path(".").stem() == ".");
|
||||
BOOST_TEST(path("..").stem() == "..");
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(path(".a").stem() == "");
|
||||
#else
|
||||
BOOST_TEST(path(".a").stem() == ".a");
|
||||
#endif
|
||||
BOOST_TEST(path("b").stem() == "b");
|
||||
BOOST_TEST(path("a/b.txt").stem() == "b");
|
||||
BOOST_TEST(path("a/b.").stem() == "b");
|
||||
@@ -833,7 +841,11 @@ void query_and_decomposition_tests()
|
||||
// extension() tests not otherwise covered
|
||||
BOOST_TEST(path(".").extension() == "");
|
||||
BOOST_TEST(path("..").extension() == "");
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(path(".a").extension() == ".a");
|
||||
#else
|
||||
BOOST_TEST(path(".a").extension() == "");
|
||||
#endif
|
||||
BOOST_TEST(path("a/b").extension() == "");
|
||||
BOOST_TEST(path("a.b/c").extension() == "");
|
||||
BOOST_TEST(path("a/b.txt").extension() == ".txt");
|
||||
@@ -870,8 +882,13 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.relative_path().string() == "");
|
||||
BOOST_TEST(p.parent_path().string() == "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.filename() == "/");
|
||||
BOOST_TEST(p.stem() == "/");
|
||||
#else
|
||||
BOOST_TEST(p.filename() == "");
|
||||
BOOST_TEST(p.stem() == "");
|
||||
#endif
|
||||
BOOST_TEST(p.extension() == "");
|
||||
BOOST_TEST(p.root_name() == "");
|
||||
BOOST_TEST(p.root_directory() == "/");
|
||||
@@ -880,8 +897,13 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(!p.has_root_name());
|
||||
BOOST_TEST(p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
BOOST_TEST(p.has_stem());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
BOOST_TEST(!p.has_stem());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_extension());
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
if (platform == "POSIX")
|
||||
@@ -893,8 +915,13 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "//");
|
||||
PATH_TEST_EQ(p.stem(), "//");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
PATH_TEST_EQ(p.stem(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.extension(), "");
|
||||
PATH_TEST_EQ(p.root_name(), "//");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
@@ -903,8 +930,13 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
BOOST_TEST(p.has_stem());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
BOOST_TEST(!p.has_stem());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_extension());
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
@@ -913,8 +945,13 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "/");
|
||||
PATH_TEST_EQ(p.stem(), "/");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
PATH_TEST_EQ(p.stem(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.extension(), "");
|
||||
PATH_TEST_EQ(p.root_name(), "");
|
||||
PATH_TEST_EQ(p.root_directory(), "/");
|
||||
@@ -923,8 +960,13 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(!p.has_root_name());
|
||||
BOOST_TEST(p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
BOOST_TEST(p.has_stem());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
BOOST_TEST(!p.has_stem());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_extension());
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
if (platform == "POSIX")
|
||||
@@ -1139,7 +1181,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "//net");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "//net");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
PATH_TEST_EQ(p.root_path().string(), "//net");
|
||||
@@ -1147,7 +1193,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
|
||||
@@ -1155,7 +1205,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.relative_path().string() == "");
|
||||
BOOST_TEST(p.parent_path().string() == "//net");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.filename() == "/");
|
||||
#else
|
||||
BOOST_TEST(p.filename() == "");
|
||||
#endif
|
||||
BOOST_TEST(p.root_name() == "//net");
|
||||
BOOST_TEST(p.root_directory() == "/");
|
||||
BOOST_TEST(p.root_path().string() == "//net/");
|
||||
@@ -1163,7 +1217,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(p.has_parent_path());
|
||||
BOOST_TEST(p.is_absolute());
|
||||
|
||||
@@ -1215,8 +1273,13 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\\\?\\");
|
||||
PATH_TEST_EQ(p.stem(), "\\\\?\\");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
PATH_TEST_EQ(p.stem(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.extension(), "");
|
||||
PATH_TEST_EQ(p.root_name(), "\\\\?\\");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
@@ -1225,8 +1288,13 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
BOOST_TEST(p.has_stem());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
BOOST_TEST(!p.has_stem());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_extension());
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
@@ -1235,9 +1303,15 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\\\.\\");
|
||||
PATH_TEST_EQ(p.stem(), "\\\\");
|
||||
PATH_TEST_EQ(p.extension(), ".\\");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
PATH_TEST_EQ(p.stem(), "");
|
||||
PATH_TEST_EQ(p.extension(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "\\\\.\\");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
PATH_TEST_EQ(p.root_path().string(), "\\\\.\\");
|
||||
@@ -1245,9 +1319,15 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
BOOST_TEST(p.has_stem());
|
||||
BOOST_TEST(p.has_extension());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
BOOST_TEST(!p.has_stem());
|
||||
BOOST_TEST(!p.has_extension());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
|
||||
@@ -1255,8 +1335,13 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\??\\");
|
||||
PATH_TEST_EQ(p.stem(), "\\??\\");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
PATH_TEST_EQ(p.stem(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.extension(), "");
|
||||
PATH_TEST_EQ(p.root_name(), "\\??\\");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
@@ -1265,8 +1350,13 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
BOOST_TEST(p.has_stem());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
BOOST_TEST(!p.has_stem());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_extension());
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
@@ -1275,7 +1365,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "c:");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
PATH_TEST_EQ(p.root_path().string(), "c:");
|
||||
@@ -1283,7 +1377,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
|
||||
@@ -1291,7 +1389,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\\\?\\c:");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "\\\\?\\c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
PATH_TEST_EQ(p.root_path().string(), "\\\\?\\c:");
|
||||
@@ -1299,7 +1401,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
|
||||
@@ -1307,7 +1413,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\\\.\\c:");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "\\\\.\\c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
PATH_TEST_EQ(p.root_path().string(), "\\\\.\\c:");
|
||||
@@ -1315,7 +1425,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
|
||||
@@ -1323,7 +1437,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\??\\c:");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "\\??\\c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
PATH_TEST_EQ(p.root_path().string(), "\\??\\c:");
|
||||
@@ -1331,7 +1449,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
|
||||
@@ -1403,7 +1525,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "c:");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "/");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "/");
|
||||
PATH_TEST_EQ(p.root_path().string(), "c:/");
|
||||
@@ -1411,7 +1537,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(p.has_parent_path());
|
||||
BOOST_TEST(p.is_absolute());
|
||||
|
||||
@@ -1419,7 +1549,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "\\\\?\\c:");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\\\?\\c:\\");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "\\\\?\\c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "\\");
|
||||
PATH_TEST_EQ(p.root_path().string(), "\\\\?\\c:\\");
|
||||
@@ -1427,7 +1561,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(p.has_parent_path());
|
||||
BOOST_TEST(p.is_absolute());
|
||||
|
||||
@@ -1435,7 +1573,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "\\\\.\\c:");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\\\.\\c:\\");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "\\\\.\\c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "\\");
|
||||
PATH_TEST_EQ(p.root_path().string(), "\\\\.\\c:\\");
|
||||
@@ -1443,7 +1585,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(p.has_parent_path());
|
||||
BOOST_TEST(p.is_absolute());
|
||||
|
||||
@@ -1451,7 +1597,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "\\??\\c:");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "\\??\\c:\\");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "\\??\\c:");
|
||||
PATH_TEST_EQ(p.root_directory(), "\\");
|
||||
PATH_TEST_EQ(p.root_path().string(), "\\??\\c:\\");
|
||||
@@ -1459,7 +1609,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(p.has_parent_path());
|
||||
BOOST_TEST(p.is_absolute());
|
||||
|
||||
@@ -1579,7 +1733,11 @@ void query_and_decomposition_tests()
|
||||
PATH_TEST_EQ(p.relative_path().string(), "");
|
||||
PATH_TEST_EQ(p.parent_path().string(), "");
|
||||
PATH_TEST_EQ(q.remove_filename().string(), p.parent_path().string());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
PATH_TEST_EQ(p.filename(), "prn:");
|
||||
#else
|
||||
PATH_TEST_EQ(p.filename(), "");
|
||||
#endif
|
||||
PATH_TEST_EQ(p.root_name(), "prn:");
|
||||
PATH_TEST_EQ(p.root_directory(), "");
|
||||
PATH_TEST_EQ(p.root_path().string(), "prn:");
|
||||
@@ -1587,7 +1745,11 @@ void query_and_decomposition_tests()
|
||||
BOOST_TEST(p.has_root_name());
|
||||
BOOST_TEST(!p.has_root_directory());
|
||||
BOOST_TEST(!p.has_relative_path());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
BOOST_TEST(p.has_filename());
|
||||
#else
|
||||
BOOST_TEST(!p.has_filename());
|
||||
#endif
|
||||
BOOST_TEST(!p.has_parent_path());
|
||||
BOOST_TEST(!p.is_absolute());
|
||||
|
||||
|
||||
@@ -624,12 +624,20 @@ void test_other_non_members()
|
||||
// edge cases
|
||||
CHECK(path("foo/").filename() == path("."));
|
||||
CHECK(path("foo/").filename_is_dot());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
CHECK(path("/").filename() == path("/"));
|
||||
#else
|
||||
CHECK(path("/").filename() == path(""));
|
||||
#endif
|
||||
CHECK(!path("/").filename_is_dot());
|
||||
#ifdef BOOST_WINDOWS_API
|
||||
CHECK(path("c:.").filename() == path("."));
|
||||
CHECK(path("c:.").filename_is_dot());
|
||||
#if BOOST_FILESYSTEM_VERSION == 3
|
||||
CHECK(path("c:/").filename() == path("/"));
|
||||
#else
|
||||
CHECK(path("c:/").filename() == path(""));
|
||||
#endif
|
||||
CHECK(!path("c:\\").filename_is_dot());
|
||||
#else
|
||||
CHECK(path("c:.").filename() == path("c:."));
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
// Library home page: http://www.boost.org/libs/filesystem
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_TEST_CODECVT_HPP
|
||||
#define BOOST_FILESYSTEM3_TEST_CODECVT_HPP
|
||||
#ifndef BOOST_FILESYSTEM_TEST_CODECVT_HPP
|
||||
#define BOOST_FILESYSTEM_TEST_CODECVT_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <locale>
|
||||
@@ -69,4 +69,4 @@ protected:
|
||||
virtual int do_max_length() const throw() { return 0; }
|
||||
};
|
||||
|
||||
#endif // BOOST_FILESYSTEM3_TEST_CODECVT_HPP
|
||||
#endif // BOOST_FILESYSTEM_TEST_CODECVT_HPP
|
||||
|
||||
Reference in New Issue
Block a user