diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-08 03:09:47 +0000 |
---|---|---|
committer | <> | 2015-05-05 14:37:32 +0000 |
commit | f2541bb90af059680aa7036f315f052175999355 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /libs/filesystem | |
parent | ed232fdd34968697a68783b3195b1da4226915b5 (diff) | |
download | boost-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'libs/filesystem')
65 files changed, 1307 insertions, 607 deletions
diff --git a/libs/filesystem/bug/Jamfile.v2 b/libs/filesystem/bug/Jamfile.v2 new file mode 100644 index 000000000..d8d6c0db9 --- /dev/null +++ b/libs/filesystem/bug/Jamfile.v2 @@ -0,0 +1,19 @@ +# Boost Filesystem Library Bug report Jamfile + +# Copyright Beman Dawes 2014 +# Distributed under the Boost Software License, Version 1.0. +# See www.boost.org/LICENSE_1_0.txt + +# Library home page: http://www.boost.org/libs/filesystem + +project + : requirements + <library>/boost/filesystem//boost_filesystem + <library>/boost/system//boost_system + <toolset>msvc:<asynch-exceptions>on + ; + +exe bug : bug.cpp : <link>static ; + +# install in ./bin; invoke via "b2", not "b2 install" +install bin : bug ; diff --git a/libs/filesystem/bug/bug.cpp b/libs/filesystem/bug/bug.cpp new file mode 100644 index 000000000..6a1aea91e --- /dev/null +++ b/libs/filesystem/bug/bug.cpp @@ -0,0 +1,19 @@ +// filesystem/bug/bug.cpp + +#include <boost/detail/lightweight_test_report.hpp> +#include <boost/filesystem.hpp> + +namespace fs = boost::filesystem; + +int test_main(int, char*[]) // note name +{ + BOOST_TEST(2 + 2 == 5); // one convertible-to-bool argument + BOOST_TEST_EQ(4 + 4, 9); // two EqualityComparible arguments + BOOST_TEST(fs::exists(".")); // should pass, so nothing reported + + return ::boost::report_errors(); // required +} + +// Copyright Beman Dawes 2014 +// Distributed under the Boost Software License, Version 1.0. +// www.boost.org/LICENSE_1_0.txt diff --git a/libs/filesystem/bug/index.html b/libs/filesystem/bug/index.html new file mode 100644 index 000000000..985b9c0cc --- /dev/null +++ b/libs/filesystem/bug/index.html @@ -0,0 +1,13 @@ +<html> +<head> +<meta http-equiv="refresh" content="0; URL=../doc/issue_reporting.html"> +</head> +<body> +Automatic redirection failed, please go to +<a href="../doc/issue_reporting.html">../doc/issue_reporting.html</a>. +<hr> +<p>© Copyright Beman Dawes, 2014</p> +<p> Distributed under the Boost Software License, Version 1.0. +See http://www.boost.org/LICENSE_1_0.txt</p> +</body> +</html> diff --git a/libs/filesystem/doc/deprecated.html b/libs/filesystem/doc/deprecated.html index ed553447e..9ba05e2a7 100644 --- a/libs/filesystem/doc/deprecated.html +++ b/libs/filesystem/doc/deprecated.html @@ -4,9 +4,9 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem Deprecated Features</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body> @@ -22,17 +22,19 @@ </tr> </table> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> @@ -373,7 +375,7 @@ function can trivially be provided by a user.</p> <hr> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->20 March, 2012<!--webbot bot="Timestamp" endspan i-checksum="28814" --></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->29 December, 2014<!--webbot bot="Timestamp" endspan i-checksum="38652" --></p> <p>© Copyright Beman Dawes, 2002-2005, 2010</p> <p> Use, modification, and distribution are subject to the Boost Software diff --git a/libs/filesystem/doc/design.htm b/libs/filesystem/doc/design.htm index a44b2b23e..07977cac8 100644 --- a/libs/filesystem/doc/design.htm +++ b/libs/filesystem/doc/design.htm @@ -4,9 +4,9 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Boost Filesystem Library Design</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body bgcolor="#FFFFFF"> @@ -340,9 +340,9 @@ Variable Considered Harmful</i>, ACM SIGPLAN Notices, 8, 2, 1973, pp. 23-34</td> <hr> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->20 March, 2012<!--webbot bot="Timestamp" endspan i-checksum="28814" --></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->26 December, 2014<!--webbot bot="Timestamp" endspan i-checksum="38646" --></p> -<p>© Copyright Beman Dawes, 2002</p> +<p>© Copyright Beman Dawes, 2002</p> <p> Use, modification, and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt"> LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"> diff --git a/libs/filesystem/doc/do_list.html b/libs/filesystem/doc/do_list.html index 655880327..b6fc3eb8f 100644 --- a/libs/filesystem/doc/do_list.html +++ b/libs/filesystem/doc/do_list.html @@ -4,7 +4,7 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Do List</title> <style type="text/css"> body { font-family: sans-serif; margin: 1em; } @@ -137,7 +137,7 @@ to return paths with fewer elements.]</pre> </ul> <hr> -<p>© Copyright Beman Dawes, 2010</p> +<p>© Copyright Beman Dawes, 2010</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> diff --git a/libs/filesystem/doc/faq.htm b/libs/filesystem/doc/faq.htm index 85b64dc0e..ec177c23c 100644 --- a/libs/filesystem/doc/faq.htm +++ b/libs/filesystem/doc/faq.htm @@ -4,9 +4,9 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem FAQ</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body> @@ -22,22 +22,23 @@ </tr> </table> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> - </tr> </table> -<h1 dir="ltr"> +<h1> Frequently Asked Questions</h1> <h2>General questions</h2> <p><b>Why not support a concept of specific kinds of file systems, such as posix_file_system or windows_file_system.</b></p> @@ -45,7 +46,7 @@ Frequently Asked Questions</h1> library. Features specific to a particular operating system or file system can always be accessed by using the operating system's API.</p> -<h2 dir="ltr"> +<h2> Class <code><font size="6">path</font></code> questions </h2> <p><b>Why base the generic pathname format on POSIX?</b></p> <p><a href="design.htm#POSIX-01">POSIX</a> is an ISO Standard. It is the basis for the most familiar @@ -140,8 +141,8 @@ functions, while operations performed by the operating system are provided as free functions.</p> <hr> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->20 March, 2012<!--webbot bot="Timestamp" endspan i-checksum="28814" --></p> -<p>© Copyright Beman Dawes, 2002</p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->29 December, 2014<!--webbot bot="Timestamp" endspan i-checksum="38652" --></p> +<p>© Copyright Beman Dawes, 2002</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>
\ No newline at end of file diff --git a/libs/filesystem/doc/index.htm b/libs/filesystem/doc/index.htm index acfad5884..526f26543 100644 --- a/libs/filesystem/doc/index.htm +++ b/libs/filesystem/doc/index.htm @@ -4,18 +4,20 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem Home</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111"> +<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> +<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> Version 3</font> @@ -23,22 +25,24 @@ </tr> </table> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> - </tr> </table> -<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right"> +<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" align="right"> <tr> <td width="100%" bgcolor="#D7EEFF" align="center"> <i><b>Contents</b></i></td> @@ -60,7 +64,7 @@ with acknowledgements</a></td> </tr> </table> - +<p></p> <div align="center"> <center> <table border="1" cellpadding="10" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111"> @@ -316,9 +320,17 @@ syntax.</p> <h2><a name="Change-history">Version history</a></h2> +<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 +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> + <h3>Version 3</h3> -<p>Boost <span style="background-color: #FFFF00">1.??.0 - ???, 2010</span> - Internationalization via single class <code>path</code>. +<p>Boost 1.44.0 - June, 2010 - Internationalization via single class <code>path</code>. More uniform error handling.</p> <p>Peter Dimov suggested use of a single path class rather than a <code>basic_path</code> @@ -451,7 +463,7 @@ version 1.31.0. </p> <hr> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->20 March, 2012<!--webbot bot="Timestamp" endspan i-checksum="28814" --></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->10 January, 2015<!--webbot bot="Timestamp" endspan i-checksum="38885" --></p> <p>© Copyright Beman Dawes, 2002-2005</p> <p> Use, modification, and distribution are subject to the Boost Software diff --git a/libs/filesystem/doc/issue_reporting.html b/libs/filesystem/doc/issue_reporting.html new file mode 100644 index 000000000..44b80b2b6 --- /dev/null +++ b/libs/filesystem/doc/issue_reporting.html @@ -0,0 +1,224 @@ +<html> + +<head> +<meta name="GENERATOR" content="Microsoft FrontPage 5.0"> +<meta name="ProgId" content="FrontPage.Editor.Document"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<title>Filesystem issue reporting</title> +<link href="styles.css" rel="stylesheet"> +</head> + +<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 Bug Reporting</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="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> + +<p>Boost.Filesystem issues such as bug reports or feature requests should be +reported via a <a href="https://svn.boost.org/trac/boost/newticket">Boost Trac ticket</a>.</p> +<p><a href="https://github.com/boostorg/filesystem/pulls">GitHub pull requests</a> +are encouraged, too, although anything beyond really trivial fixes needs a trac +ticket.</p> +<h3>Bug reports</h3> +<p>A timely response to your bug report is much more likely if <b>the problem can +be immediately reproduced without guesswork and regression tests can be easily +created</b>. </p> +<p>You need to provide the following:</p> +<ol> + <li>A simple test program +that:<ul> + <li>Illustrates the problem, and</li> + <li>Automatically yields an unambiguous pass or fail result - returning zero + for pass and non-zero for fail is preferred, and </li> + <li>Can be used as the basis for adding tests to Boost.Filesystem's + regression test suite.</li> + </ul> + </li> + <li>The compiler, standard library, platform, and Boost version you + used to build and run your test program.</li> + <li>A description of how to build and run the test program. + </li> + <li>A copy of the output from the test + program, if any.</li> + <li>An email address for follow-up questions.</li> +</ol> +<p>See <a href="#Rationale">Rationale</a> to find out why the above is needed.</p> +<p>For a mostly automatic framework to provide the above, read on!</p> +<h3>Bug reporting framework</h3> +<p>The directory <code><boost-root>/libs/filesystem/bug></code> provides a bug test program (<code><a href="#bug-cpp">bug.cpp</a></code>) +and a build file (<code>Jamfile.v2</code>). Here is what you need to do:</p> +<ol> + <li>Add one or more test cases to <code><a href="#bug-cpp">bug.cpp</a></code> + using any text or program editor.</li> + <li><a href="#Build-and-test">Build and test</a>.</li> + <li>Attach copies of the <a href="#Test-output">Test output</a> and test + program to the <a href="https://svn.boost.org/trac/boost/newticket">Trac + ticket</a>.</li> +</ol> +<p>That's it! When you complete those steps, you will be done!</p> +<p>The test output supplies all of the basic information about the compiler, std +library, platform, Boost version, and command line, and the test cases you have +added should make it easy for the library maintainer to reproduce the problem. </p> +<h3>Using the framework</h3> +<h4><a name="bug-cpp"><code>bug.cpp</code></a></h4> +<p>Here is <code>bug.cpp</code> as supplied. To report a real bug, use +<code>BOOST_TEST</code> and <code>BOOST_TEST_EQ</code> macros to build your own +test cases. You can delete the three tests already in <code>bug.cpp</code>:</p> +<blockquote> + <pre>#include <boost/detail/lightweight_test_report.hpp> +#include <boost/filesystem.hpp> + +namespace fs = boost::filesystem; + +int test_main(int, char*[]) // note name +{ + BOOST_TEST(2 + 2 == 5); // one convertible-to-bool argument; this one fails! + BOOST_TEST_EQ(4 + 4, 9); // two EqualityComparible arguments; this one fails! + BOOST_TEST(fs::exists(".")); // should pass, so nothing should be reported + + return ::boost::report_errors(); // required +} +</pre> +</blockquote> +<h4><a name="Build-and-test">Build and test</a></h4> + + +<p>POSIX-like systems:</p> + + +<blockquote> + <pre>cd <boost-root>/libs/filesystem/bug +../../../b2 -a +bin/bug</pre> +</blockquote> +<p>Windows:</p> +<blockquote> + <pre>cd <boost-root>\libs\filesystem\bug +..\..\..\b2 -a +bin\bug</pre> +</blockquote> +<h4><a name="Test-output">Test output</a></h4> + + +<p>Running the test on Windows produced this test output:</p> + + +<blockquote> + + +<pre>Microsoft Visual C++ version 14.0 +Dinkumware standard library version 610 +Win32 +Boost version 1.58.0 +Command line: bin\bug +bug.cpp(10): test '2 + 2 == 5' failed in function + 'int __cdecl test_main(int,char *[])' +bug.cpp(11): test '4 + 4 == 9' failed in function + 'int __cdecl test_main(int,char *[])': '8' != '9' +2 errors detected.</pre> +</blockquote> +<p>The test framework runs <code>test_main()</code> from a <code>try</code> +block with a <code>catch</code> block that reports exceptions via <code> +std::exception what()</code>. So the output will differ if an exception is +thrown.</p> +<h2>Background information</h2> +<p>You should now have enough information to file an easy-to-reproduce bug +report. So you can skip reading the rest of this page unless you need to do +something a bit out of the ordinary.</p> +<h3><a name="b2-command-line-options"><code>b2</code> command line</a></h3> +<p><code>b2</code> (formerly <code>bjam</code>) usage: <code>b2 +[options] [properties] [target]</code></p> +<p>Boost.Build b2 has many options, properties, and targets, but you will not +need most of them for bug reporting. Here are a few you might find helpful:</p> +<p><b>Options</b></p> +<blockquote> + <p><code>-a</code> Rebuild everything rather than + just out-of-date targets. Used in the example build above to ensure libraries + are built with the same setup as the test program.</p> +</blockquote> +<p><b>Properties</b></p> +<blockquote> + <p><code>address-model=<i>n n</i></code> is 32 or 64. + Explicitly request either 32-bit or 64-bit code generation. This typically + requires that your compiler is appropriately configured.</p> + <p><code>variant=</code><i>string string </i>is + <code>debug</code> or <code>release</code>.</p> + <p><code>toolset=</code><i>string</i> The C++ + compiler to use. For example, <code>gcc-4.9</code>, <code>clang-3.3</code>, + <code>or msvc-14.0</code>.</p> + <p><code>include=</code><i>string </i> + Additional include paths for C and C++ compilers.</p> + <p><code>cxxflags=</code><i>string </i> + Custom options to pass to the C++ compiler.</p> + <p><code>define=</code><i>string</i> + Additional macro definitions for C and C++ compilers. <i>string</i> should be + either <code class="computeroutput">SYMBOL</code> or + <code class="computeroutput">SYMBOL=VALUE</code></p> +</blockquote> +<h3><a name="Rationale">Rationale</a></h3> +<p>Here is the request list again, with rationale added:</p> +<ol> + <li>A simple test program +that:<ul> + <li dir="ltr"> + <p dir="ltr">Illustrates the problem <b>[Code communicates more clearly than + prose. If it looks like it will it will take some time to figure out exactly what the + problem is, or worse yet, might result in a wild-goose chase, the bug report + gets set aside to be worked on later and then is often forgotten.] </b>and</li> + <li>Automatically yields an unambiguous pass or fail result - returning zero + for pass and non-zero for fail is preferred <b>[Prevents + miscommunications and allows use in automatic regression tests.]</b>, and </li> + <li>Can be used as the basis for adding tests to Boost.Filesystem's + regression test suite <b>[With good test cases fixes come easier and + regressions become less likely]</b>.</li> + </ul> + </li> + <li>The compiler, standard library, platform, and Boost version you + used to build and run your test program. <b>[The implementation includes much + platform dependent code, and also depends on the other factors mentioned. Know + these things upfront brings the bug report into focus without having to ask + for more information. ]</b></li> + <li>A description of how to build and run the test program. <b>[If b2 + (formerly known as bjam) is used as the build engine, this is not a concern, + but otherwise much more information is needed.]</b></li> + <li>A copy of the output from the test + program, if any. <b>[Avoids misinterpreting results.]</b></li> + <li>An email address for follow-up questions.<b> [Trac comments are the + primary means of response, but it is disheartening when a trac question is not + answered and there is no email address attached for followup.]</b></li> +</ol> +<hr> +<p>Revised +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->28 January, 2015<!--webbot bot="Timestamp" endspan i-checksum="38902" --></p> +<p>© Copyright Beman Dawes, 2014</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>
\ No newline at end of file diff --git a/libs/filesystem/doc/portability_guide.htm b/libs/filesystem/doc/portability_guide.htm index 54b5a748c..676c25cb3 100644 --- a/libs/filesystem/doc/portability_guide.htm +++ b/libs/filesystem/doc/portability_guide.htm @@ -4,9 +4,9 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Portability Guide</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body bgcolor="#FFFFFF"> @@ -16,19 +16,20 @@ Name Portability Guide</h1> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> - </tr> </table> <p> @@ -228,9 +229,9 @@ portability yet not overly restrict expressiveness.</p> <hr> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->20 March, 2012<!--webbot bot="Timestamp" endspan i-checksum="28814" --></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->29 December, 2014<!--webbot bot="Timestamp" endspan i-checksum="38652" --></p> -<p>© Copyright Beman Dawes, 2002, 2003</p> +<p>© Copyright Beman Dawes, 2002, 2003</p> <p> Use, modification, and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt"> LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"> diff --git a/libs/filesystem/doc/reference.html b/libs/filesystem/doc/reference.html index 366bacafd..b6ff10f25 100644 --- a/libs/filesystem/doc/reference.html +++ b/libs/filesystem/doc/reference.html @@ -1,5 +1,5 @@ <html> -<!-- © Copyright Beman Dawes, 2002, 2006, 2007, 2009, 2010, 2011 --> +<!-- © Copyright Beman Dawes, 2002, 2006, 2007, 2009, 2010, 2011 --> <!-- Distributed under the Boost Software License, Version 1.0. --> <!-- See http://www.boost.org/LICENSE_1_0.txt --> @@ -9,7 +9,7 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> Filesystem Reference @@ -17,7 +17,7 @@ <style type="text/css"> /* - © Copyright Beman Dawes, 2007 + © Copyright Beman Dawes, 2007 Distributed under the Boost Software License, Version 1.0. See www.boost.org/LICENSE_1_0.txt @@ -60,18 +60,17 @@ del { background-color:#FFA0A0 } <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> - </td> - </tr> </table> <h1>Reference Documentation</h1> @@ -3734,12 +3733,12 @@ multiple string types. His idea became the basis for the version 3 path design.< </table> <hr> > -<p><font size="2">© Copyright Beman Dawes, 2002, 2006, 2007, 2009, 2010, 2011</font></p> +<p><font size="2">© Copyright Beman Dawes, 2002, 2006, 2007, 2009, 2010, 2011</font></p> <p><font size="2">Distributed under the Boost Software License, Version 1.0. See </font> <a href="http://www.boost.org/LICENSE_1_0.txt"><font size="2">www.boost.org/LICENSE_1_0.txt</font></a></p> <p><font size="2">Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->16 July 2012<!--webbot bot="Timestamp" endspan i-checksum="18787" --></font></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->29 December 2014<!--webbot bot="Timestamp" endspan i-checksum="39176" --></font></p> </body></html>
\ No newline at end of file diff --git a/libs/filesystem/doc/release_history.html b/libs/filesystem/doc/release_history.html index c7587fab5..89aebd71d 100644 --- a/libs/filesystem/doc/release_history.html +++ b/libs/filesystem/doc/release_history.html @@ -4,9 +4,9 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem Release History</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body> @@ -22,20 +22,38 @@ </tr> </table> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="../../../index.htm">Boost Home</a> - <a href="index.htm">Library Home</a> <a href="reference.html">Reference</a> + <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="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> - </tr> </table> +<h2>1.58.0</h2> +<ul> + <li>Rewrite Windows implementation of temp_directory_path() to (1) avoid + GetTempPath() failure if path length > 130 (ticket #5300) and (2) provide a + more sensible sequence of directories than provided by GetTempPath(), per + boost list discussion "[filesystem] temp_directory_path() behavior on + Windows". The new sequence is:<ol> + <li><i><code>%TMP%</code></i></li> + <li><i><code>%TEMP%</code></i></li> + <li><code><i>%LOCALAPPDATA%</i>/Temp</code></li> + <li><code><i>%USERPROFILE%</i>/Temp</code></li> + <li><code><i>GetWindowsDirectoryW()</i>/Temp</code></li> + </ol> + </li> +</ul> + <h2>1.57.0</h2> <ul> <li>Rework class <code>path</code> locale and codecvt implementation for increased reliability. @@ -88,7 +106,7 @@ Solaris 10. (Chris Stylianou)</li> <li>Minor fixes and code cleanup.</li> <li>Update IDE projects to Visual Studio 2013.</li> - <li>Remove unused <code>const char colon</code> to clear clang warning. (Jürgen + <li>Remove unused <code>const char colon</code> to clear clang warning. (J?gen Hunold)</li> <li>Add BOOST_NOEXCEPT to <code>class filesystem_error</code>.</li> <li>Change <code>perms::all_all</code> and <code>perms::perms_mask</code> to @@ -259,8 +277,8 @@ </ul> <hr> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->29 October, 2014<!--webbot bot="Timestamp" endspan i-checksum="38757" --></p> -<p>© Copyright Beman Dawes, 2011</p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 February, 2015<!--webbot bot="Timestamp" endspan i-checksum="40532" --></p> +<p>© Copyright Beman Dawes, 2011</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>
\ No newline at end of file diff --git a/libs/filesystem/doc/styles.css b/libs/filesystem/doc/styles.css new file mode 100644 index 000000000..6e6b17060 --- /dev/null +++ b/libs/filesystem/doc/styles.css @@ -0,0 +1,19 @@ +body +{ + font-family: sans-serif; + max-width: 6.5in; + margin: 0px auto; + font-size: 85%; +} + ins {background-color: #CCFFCC;} + del {background-color: #FFCACA;} + pre {background-color: #D7EEFF; font-size: 100%;} + code {font-size: 110%;} + table{font-size: 100%;} + + /* + © Copyright Beman Dawes, 2014 + Distributed under the Boost Software License, Version 1.0. + See www.boost.org/LICENSE_1_0.txt + */ +
\ No newline at end of file diff --git a/libs/filesystem/doc/tickets.html b/libs/filesystem/doc/tickets.html index 79c2d1ada..054acb403 100644 --- a/libs/filesystem/doc/tickets.html +++ b/libs/filesystem/doc/tickets.html @@ -4,7 +4,7 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem Tickets</title> </head> diff --git a/libs/filesystem/doc/tutorial.html b/libs/filesystem/doc/tutorial.html index 0dbebec09..72db485e0 100644 --- a/libs/filesystem/doc/tutorial.html +++ b/libs/filesystem/doc/tutorial.html @@ -4,9 +4,9 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem Tutorial</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body> @@ -22,20 +22,22 @@ </tr> </table> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> - </tr> </table> + <p> <a href="#Introduction">Introduction</a><br> <a href="#Preliminaries">Preliminaries</a><br> @@ -1117,11 +1119,11 @@ It has a documentation. </p> <hr> -<p>© Copyright Beman Dawes 2010</p> +<p>© Copyright Beman Dawes 2010</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> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->20 March 2012<!--webbot bot="Timestamp" endspan i-checksum="27254" --></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->29 December 2014<!--webbot bot="Timestamp" endspan i-checksum="39176" --></p> </body> diff --git a/libs/filesystem/doc/v3.html b/libs/filesystem/doc/v3.html index 3b75140a2..062c56c2e 100644 --- a/libs/filesystem/doc/v3.html +++ b/libs/filesystem/doc/v3.html @@ -3,9 +3,9 @@ <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem V3 Intro</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> <body> @@ -21,19 +21,20 @@ </tr> </table> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> - </tr> </table> <h1>Boost Filesystem Version 3</h1> @@ -140,11 +141,11 @@ cycle, and then Version 3 will become the default version.</p> </ul> <hr> -<p>© Copyright Beman Dawes, 2009</p> +<p>© Copyright Beman Dawes, 2009</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> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->20 March 2012<!--webbot bot="Timestamp" endspan i-checksum="27254" --></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->29 December 2014<!--webbot bot="Timestamp" endspan i-checksum="39176" --></p> </body> diff --git a/libs/filesystem/doc/v3_design.html b/libs/filesystem/doc/v3_design.html index cea4f1225..5f1326daa 100644 --- a/libs/filesystem/doc/v3_design.html +++ b/libs/filesystem/doc/v3_design.html @@ -4,40 +4,44 @@ <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Filesystem V3 Design</title> -<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css"> +<link href="styles.css" rel="stylesheet"> </head> <body> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111"> <tr> <td> <a href="../../../index.htm"> -<img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" border="0" width="300" height="86"></a></td> +<img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" border="0" + width="300" height="86"></a></td> <td align="middle"> <font size="7">Filesystem Version 3<br> Design</font></td> </tr> </table> -<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> +<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" bgcolor="#D7EEFF" width="100%"> <tr> - <td><a href="index.htm">Filesystem Home</a> - <a href="release_history.html">Releases</a> - <a href="reference.html">Reference</a> + <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="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> - </tr> </table> -<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" align="right"> +<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" align="right"> <tr> <td width="100%" bgcolor="#D7EEFF" align="center"> <i><b>Contents</b></i></td> @@ -65,7 +69,8 @@ path type that accommodated multiple character types and encodings would be more flexible. Although I wasn't willing to stop development at that time to explore how this idea might be implemented, or to break from the pattern for Internationalization used the C++ standard library, I've often thought about -Peter's suggestion. With the advent of C++0x <code>char16_t</code> and <code>char32_t</code> character +Peter's suggestion. With the advent of C++0x <code>char16_t</code> and <code>char32_t</code> +character types, the <code>basic_path</code> class template approach becomes even more unwieldy, so it is time to revisit the problem in light of Peter's suggestion.</p> @@ -133,7 +138,8 @@ flexible user code.</p> </ul> <h2><a name="Details">Details</a></h2> -<table border="1" cellpadding="4" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> +<table border="1" cellpadding="4" cellspacing="0" style="border-collapse: collapse" + bordercolor="#111111" width="100%"> <tr> <td width="33%" colspan="3"> <p align="center"><b><i>Encoding </i></b><i><b>Conversions</b></i></td> @@ -175,14 +181,15 @@ been consistently applied to all applicable functions.</p> <h2><a name="Acknowledgements">Acknowledgements</a></h2> <p>Peter Dimov suggested the idea of a single path class that could cope with -multiple character types and encodings. Walter Landry contributed both the design and implementation of the copy_any, +multiple character types and encodings. Walter Landry contributed both the design +and implementation of the copy_any, copy_directory, copy_symlink, and read_symlink functions.</p> <hr> <p>Revised -<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->20 March, 2012<!--webbot bot="Timestamp" endspan i-checksum="28814" --></p> +<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->29 December, 2014<!--webbot bot="Timestamp" endspan i-checksum="38652" --></p> -<p>© Copyright Beman Dawes, 2008</p> +<p>© Copyright Beman Dawes, 2008</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> diff --git a/libs/filesystem/example/Jamfile.v2 b/libs/filesystem/example/Jamfile.v2 index 2d2ea27fc..8a49747f4 100644 --- a/libs/filesystem/example/Jamfile.v2 +++ b/libs/filesystem/example/Jamfile.v2 @@ -23,5 +23,4 @@ exe tut4 : tut4.cpp ; exe tut5 : tut5.cpp ; exe path_info : path_info.cpp ; exe file_status : file_status.cpp ; - -install bin : file_status ; #invoke via "bjam", not "bjam install" +exe file_size : file_size.cpp ; diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp index 6c04ce091..d8e8840c8 100644 --- a/libs/filesystem/src/operations.cpp +++ b/libs/filesystem/src/operations.cpp @@ -71,17 +71,20 @@ using std::wstring; # include <sys/types.h> # include <sys/stat.h> -# if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__ANDROID__) +# if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__ANDROID__) \ + && !defined(__VXWORKS__) # include <sys/statvfs.h> # define BOOST_STATVFS statvfs # define BOOST_STATVFS_F_FRSIZE vfs.f_frsize # else # ifdef __OpenBSD__ -# include <sys/param.h> +# include <sys/param.h> # elif defined(__ANDROID__) -# include <sys/vfs.h> +# include <sys/vfs.h> +# endif +# if !defined(__VXWORKS__) +# include <sys/mount.h> # endif -# include <sys/mount.h> # define BOOST_STATVFS statfs # define BOOST_STATVFS_F_FRSIZE static_cast<boost::uintmax_t>(vfs.f_bsize) # endif @@ -169,6 +172,17 @@ typedef struct _REPARSE_DATA_BUFFER { # define IO_REPARSE_TAG_SYMLINK (0xA000000CL) # endif +inline std::wstring wgetenv(const wchar_t* name) +{ + // use vector since for C++03 basic_string is not required to be contiguous + std::vector<wchar_t> buf(::GetEnvironmentVariableW(name, NULL, 0)); + + // C++03 vector does not have data() so use &buf[0] + return (buf.empty() + || ::GetEnvironmentVariableW(name, &buf[0], static_cast<DWORD>(buf.size())) == 0) + ? std::wstring() : std::wstring(&buf[0]); +} + # endif // BOOST_WINDOWS_API // BOOST_FILESYSTEM_STATUS_CACHE enables file_status cache in @@ -192,6 +206,8 @@ typedef struct _REPARSE_DATA_BUFFER { # if defined(BOOST_POSIX_API) +typedef int err_t; + // POSIX uses a 0 return to indicate success # define BOOST_ERRNO errno # define BOOST_SET_CURRENT_DIRECTORY(P)(::chdir(P)== 0) @@ -211,6 +227,8 @@ typedef struct _REPARSE_DATA_BUFFER { # else // BOOST_WINDOWS_API +typedef DWORD err_t; + // Windows uses a non-0 return to indicate success # define BOOST_ERRNO ::GetLastError() # define BOOST_SET_CURRENT_DIRECTORY(P)(::SetCurrentDirectoryW(P)!= 0) @@ -232,7 +250,7 @@ typedef struct _REPARSE_DATA_BUFFER { //--------------------------------------------------------------------------------------// // // -// helpers (all operating systems) // +// helpers (all operating systems) // // // //--------------------------------------------------------------------------------------// @@ -243,11 +261,22 @@ namespace boost::filesystem::directory_iterator end_dir_itr; + // error handling helpers ----------------------------------------------------------// + + bool error(err_t error_num, error_code* ec, const string& message); + bool error(err_t error_num, const path& p, error_code* ec, const string& message); + bool error(err_t error_num, const path& p1, const path& p2, error_code* ec, + const string& message); + const error_code ok; - bool error(bool was_error, error_code* ec, const string& message) + // error_num is value of errno on POSIX, error code (from ::GetLastError()) on Windows. + // Interface changed 30 Jan 15 to have caller supply error_num as ::SetLastError() + // values were apparently getting cleared before they could be retrieved by error(). + + bool error(err_t error_num, error_code* ec, const string& message) { - if (!was_error) + if (!error_num) { if (ec != 0) ec->clear(); } @@ -255,16 +284,16 @@ namespace { // error if (ec == 0) BOOST_FILESYSTEM_THROW(filesystem_error(message, - error_code(BOOST_ERRNO, system_category()))); + error_code(error_num, system_category()))); else - ec->assign(BOOST_ERRNO, system_category()); + ec->assign(error_num, system_category()); } - return was_error; + return error_num != 0; } - bool error(bool was_error, const path& p, error_code* ec, const string& message) + bool error(err_t error_num, const path& p, error_code* ec, const string& message) { - if (!was_error) + if (!error_num) { if (ec != 0) ec->clear(); } @@ -272,17 +301,17 @@ namespace { // error if (ec == 0) BOOST_FILESYSTEM_THROW(filesystem_error(message, - p, error_code(BOOST_ERRNO, system_category()))); + p, error_code(error_num, system_category()))); else - ec->assign(BOOST_ERRNO, system_category()); + ec->assign(error_num, system_category()); } - return was_error; + return error_num != 0; } - bool error(bool was_error, const path& p1, const path& p2, error_code* ec, + bool error(err_t error_num, const path& p1, const path& p2, error_code* ec, const string& message) { - if (!was_error) + if (!error_num) { if (ec != 0) ec->clear(); } @@ -290,48 +319,14 @@ namespace { // error if (ec == 0) BOOST_FILESYSTEM_THROW(filesystem_error(message, - p1, p2, error_code(BOOST_ERRNO, system_category()))); + p1, p2, error_code(error_num, system_category()))); else - ec->assign(BOOST_ERRNO, system_category()); + ec->assign(error_num, system_category()); } - return was_error; + return error_num != 0; } - bool error(bool was_error, const error_code& result, - const path& p, error_code* ec, const string& message) - // Overwrites ec if there has already been an error - { - if (!was_error) - { - if (ec != 0) ec->clear(); - } - else - { // error - if (ec == 0) - BOOST_FILESYSTEM_THROW(filesystem_error(message, p, result)); - else - *ec = result; - } - return was_error; - } - - bool error(bool was_error, const error_code& result, - const path& p1, const path& p2, error_code* ec, const string& message) - // Overwrites ec if there has already been an error - { - if (!was_error) - { - if (ec != 0) ec->clear(); - } - else - { // error - if (ec == 0) - BOOST_FILESYSTEM_THROW(filesystem_error(message, p1, p2, result)); - else - *ec = result; - } - return was_error; - } + // general helpers -----------------------------------------------------------------// bool is_empty_directory(const path& p) { @@ -360,13 +355,15 @@ namespace # endif ) { - if (error(!remove_directory(p), p, ec, "boost::filesystem::remove")) - return false; + if (error(!remove_directory(p) ? BOOST_ERRNO : 0, p, ec, + "boost::filesystem::remove")) + return false; } else { - if (error(!remove_file(p), p, ec, "boost::filesystem::remove")) - return false; + if (error(!remove_file(p) ? BOOST_ERRNO : 0, p, ec, + "boost::filesystem::remove")) + return false; } return true; } @@ -441,25 +438,33 @@ namespace ssize_t sz, sz_read=1, sz_write; while (sz_read > 0 - && (sz_read = ::read(infile, buf.get(), buf_sz))> 0) + && (sz_read = ::read(infile, buf.get(), buf_sz)) > 0) { // Allow for partial writes - see Advanced Unix Programming (2nd Ed.), // Marc Rochkind, Addison-Wesley, 2004, page 94 sz_write = 0; do { + BOOST_ASSERT(sz_read - sz_write > 0); // #1 + // ticket 4438 claimed possible infinite loop if write returns 0. My analysis + // is that POSIX specifies 0 return only if 3rd arg is 0, and that will never + // happen due to loop entry and coninuation conditions. BOOST_ASSERT #1 above + // and #2 below added to verify that analysis. if ((sz = ::write(outfile, buf.get() + sz_write, - sz_read - sz_write))< 0) + sz_read - sz_write)) < 0) { sz_read = sz; // cause read loop termination - break; // and error to be thrown after closes + break; // and error reported after closes } + BOOST_ASSERT(sz > 0); // #2 sz_write += sz; } while (sz_write < sz_read); } - if (::close(infile)< 0)sz_read = -1; - if (::close(outfile)< 0)sz_read = -1; + if (::close(infile)< 0) + sz_read = -1; + if (::close(outfile)< 0) + sz_read = -1; return sz_read >= 0; } @@ -652,14 +657,13 @@ namespace BOOL resize_file_api(const wchar_t* p, boost::uintmax_t size) { - HANDLE handle = CreateFileW(p, GENERIC_WRITE, 0, 0, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, 0); + handle_wrapper h(CreateFileW(p, GENERIC_WRITE, 0, 0, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, 0)); LARGE_INTEGER sz; sz.QuadPart = size; - return handle != INVALID_HANDLE_VALUE - && ::SetFilePointerEx(handle, sz, 0, FILE_BEGIN) - && ::SetEndOfFile(handle) - && ::CloseHandle(handle); + return h.handle != INVALID_HANDLE_VALUE + && ::SetFilePointerEx(h.handle, sz, 0, FILE_BEGIN) + && ::SetEndOfFile(h.handle); } // Windows kernel32.dll functions that may or may not be present @@ -892,7 +896,7 @@ namespace detail # ifdef BOOST_POSIX_API struct stat from_stat; # endif - error(!BOOST_COPY_DIRECTORY(from.c_str(), to.c_str()), + error(!BOOST_COPY_DIRECTORY(from.c_str(), to.c_str()) ? BOOST_ERRNO : 0, from, to, ec, "boost::filesystem::copy_directory"); } @@ -900,7 +904,7 @@ namespace detail void copy_file(const path& from, const path& to, copy_option option, error_code* ec) { error(!BOOST_COPY_FILE(from.c_str(), to.c_str(), - option == fail_if_exists), + option == fail_if_exists) ? BOOST_ERRNO : 0, from, to, ec, "boost::filesystem::copy_file"); } @@ -909,8 +913,7 @@ namespace detail system::error_code* ec) { # if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600 - error(true, error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), - new_symlink, existing_symlink, ec, + error(BOOST_ERROR_NOT_SUPPORTED, new_symlink, existing_symlink, ec, "boost::filesystem::copy_symlink"); # else // modern Windows or BOOST_POSIX_API @@ -996,20 +999,19 @@ namespace detail { # if defined(BOOST_WINDOWS_API) && _WIN32_WINNT < 0x0600 // SDK earlier than Vista and Server 2008 - error(true, error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), to, from, ec, + error(BOOST_ERROR_NOT_SUPPORTED, to, from, ec, "boost::filesystem::create_directory_symlink"); # else # if defined(BOOST_WINDOWS_API) && _WIN32_WINNT >= 0x0600 // see if actually supported by Windows runtime dll - if (error(!create_symbolic_link_api, - error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), - to, from, ec, + if (error(!create_symbolic_link_api ? BOOST_ERROR_NOT_SUPPORTED : 0, to, from, ec, "boost::filesystem::create_directory_symlink")) return; # endif - error(!BOOST_CREATE_SYMBOLIC_LINK(from.c_str(), to.c_str(), SYMBOLIC_LINK_FLAG_DIRECTORY), + error(!BOOST_CREATE_SYMBOLIC_LINK(from.c_str(), to.c_str(), + SYMBOLIC_LINK_FLAG_DIRECTORY) ? BOOST_ERRNO : 0, to, from, ec, "boost::filesystem::create_directory_symlink"); # endif } @@ -1020,20 +1022,18 @@ namespace detail # if defined(BOOST_WINDOWS_API) && _WIN32_WINNT < 0x0500 // SDK earlier than Win 2K - error(true, error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), to, from, ec, + error(BOOST_ERROR_NOT_SUPPORTED, to, from, ec, "boost::filesystem::create_hard_link"); # else # if defined(BOOST_WINDOWS_API) && _WIN32_WINNT >= 0x0500 // see if actually supported by Windows runtime dll - if (error(!create_hard_link_api, - error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), - to, from, ec, + if (error(!create_hard_link_api ? BOOST_ERROR_NOT_SUPPORTED : 0, to, from, ec, "boost::filesystem::create_hard_link")) return; # endif - error(!BOOST_CREATE_HARD_LINK(from.c_str(), to.c_str()), to, from, ec, + error(!BOOST_CREATE_HARD_LINK(from.c_str(), to.c_str()) ? BOOST_ERRNO : 0, to, from, ec, "boost::filesystem::create_hard_link"); # endif } @@ -1042,20 +1042,18 @@ namespace detail void create_symlink(const path& to, const path& from, error_code* ec) { # if defined(BOOST_WINDOWS_API) && _WIN32_WINNT < 0x0600 // SDK earlier than Vista and Server 2008 - error(true, error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), to, from, ec, + error(BOOST_ERROR_NOT_SUPPORTED, to, from, ec, "boost::filesystem::create_directory_symlink"); # else # if defined(BOOST_WINDOWS_API) && _WIN32_WINNT >= 0x0600 // see if actually supported by Windows runtime dll - if (error(!create_symbolic_link_api, - error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), - to, from, ec, + if (error(!create_symbolic_link_api ? BOOST_ERROR_NOT_SUPPORTED : 0, to, from, ec, "boost::filesystem::create_symlink")) return; # endif - error(!BOOST_CREATE_SYMBOLIC_LINK(from.c_str(), to.c_str(), 0), + error(!BOOST_CREATE_SYMBOLIC_LINK(from.c_str(), to.c_str(), 0) ? BOOST_ERRNO : 0, to, from, ec, "boost::filesystem::create_symlink"); # endif } @@ -1071,7 +1069,7 @@ namespace detail buf(new char[static_cast<std::size_t>(path_max)]); if (::getcwd(buf.get(), static_cast<std::size_t>(path_max))== 0) { - if (error(errno != ERANGE + if (error(errno != ERANGE ? errno : 0 // bug in some versions of the Metrowerks C lib on the Mac: wrong errno set # if defined(__MSL__) && (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && errno != 0 @@ -1092,9 +1090,9 @@ namespace detail # else DWORD sz; - if ((sz = ::GetCurrentDirectoryW(0, NULL))== 0)sz = 1; + if ((sz = ::GetCurrentDirectoryW(0, NULL)) == 0)sz = 1; boost::scoped_array<path::value_type> buf(new path::value_type[sz]); - error(::GetCurrentDirectoryW(sz, buf.get())== 0, ec, + error(::GetCurrentDirectoryW(sz, buf.get()) == 0 ? BOOST_ERRNO : 0, ec, "boost::filesystem::current_path"); return path(buf.get()); # endif @@ -1104,7 +1102,7 @@ namespace detail BOOST_FILESYSTEM_DECL void current_path(const path& p, system::error_code* ec) { - error(!BOOST_SET_CURRENT_DIRECTORY(p.c_str()), + error(!BOOST_SET_CURRENT_DIRECTORY(p.c_str()) ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::current_path"); } @@ -1166,8 +1164,8 @@ namespace detail { // if one is invalid and the other isn't, then they aren't equivalent, // but if both are invalid then it is an error - error(h1.handle == INVALID_HANDLE_VALUE - && h2.handle == INVALID_HANDLE_VALUE, p1, p2, ec, + error((h1.handle == INVALID_HANDLE_VALUE + && h2.handle == INVALID_HANDLE_VALUE) ? BOOST_ERROR_NOT_SUPPORTED : 0, p1, p2, ec, "boost::filesystem::equivalent"); return false; } @@ -1176,11 +1174,11 @@ namespace detail BY_HANDLE_FILE_INFORMATION info1, info2; - if (error(!::GetFileInformationByHandle(h1.handle, &info1), + if (error(!::GetFileInformationByHandle(h1.handle, &info1) ? BOOST_ERRNO : 0, p1, p2, ec, "boost::filesystem::equivalent")) return false; - if (error(!::GetFileInformationByHandle(h2.handle, &info2), + if (error(!::GetFileInformationByHandle(h2.handle, &info2) ? BOOST_ERRNO : 0, p1, p2, ec, "boost::filesystem::equivalent")) return false; @@ -1207,11 +1205,10 @@ namespace detail # ifdef BOOST_POSIX_API struct stat path_stat; - if (error(::stat(p.c_str(), &path_stat)!= 0, + if (error(::stat(p.c_str(), &path_stat)!= 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::file_size")) return static_cast<boost::uintmax_t>(-1); - if (error(!S_ISREG(path_stat.st_mode), - error_code(EPERM, system_category()), + if (error(!S_ISREG(path_stat.st_mode) ? EPERM : 0, p, ec, "boost::filesystem::file_size")) return static_cast<boost::uintmax_t>(-1); @@ -1223,13 +1220,12 @@ namespace detail WIN32_FILE_ATTRIBUTE_DATA fad; - if (error(::GetFileAttributesExW(p.c_str(), ::GetFileExInfoStandard, &fad)== 0, - p, ec, "boost::filesystem::file_size")) - return static_cast<boost::uintmax_t>(-1); + if (error(::GetFileAttributesExW(p.c_str(), ::GetFileExInfoStandard, &fad)== 0 + ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::file_size")) + return static_cast<boost::uintmax_t>(-1); - if (error((fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!= 0, - error_code(ERROR_NOT_SUPPORTED, system_category()), - p, ec, "boost::filesystem::file_size")) + if (error((fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!= 0 + ? ERROR_NOT_SUPPORTED : 0, p, ec, "boost::filesystem::file_size")) return static_cast<boost::uintmax_t>(-1); return (static_cast<boost::uintmax_t>(fad.nFileSizeHigh) @@ -1243,7 +1239,7 @@ namespace detail # ifdef BOOST_POSIX_API struct stat path_stat; - return error(::stat(p.c_str(), &path_stat)!= 0, + return error(::stat(p.c_str(), &path_stat)!= 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::hard_link_count") ? 0 : static_cast<boost::uintmax_t>(path_stat.st_nlink); @@ -1257,9 +1253,9 @@ namespace detail FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)); return - !error(h.handle == INVALID_HANDLE_VALUE, + !error(h.handle == INVALID_HANDLE_VALUE ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::hard_link_count") - && !error(::GetFileInformationByHandle(h.handle, &info)== 0, + && !error(::GetFileInformationByHandle(h.handle, &info)== 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::hard_link_count") ? info.nNumberOfLinks : 0; @@ -1291,8 +1287,8 @@ namespace detail # else WIN32_FILE_ATTRIBUTE_DATA fad; - if (error(::GetFileAttributesExW(p.c_str(), ::GetFileExInfoStandard, &fad)== 0, - p, ec, "boost::filesystem::is_empty")) + if (error(::GetFileAttributesExW(p.c_str(), ::GetFileExInfoStandard, &fad)== 0 + ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::is_empty")) return false; if (ec != 0) ec->clear(); @@ -1309,7 +1305,7 @@ namespace detail # ifdef BOOST_POSIX_API struct stat path_stat; - if (error(::stat(p.c_str(), &path_stat)!= 0, + if (error(::stat(p.c_str(), &path_stat)!= 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::last_write_time")) return std::time_t(-1); return path_stat.st_mtime; @@ -1321,13 +1317,13 @@ namespace detail FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)); - if (error(hw.handle == INVALID_HANDLE_VALUE, + if (error(hw.handle == INVALID_HANDLE_VALUE ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::last_write_time")) return std::time_t(-1); FILETIME lwt; - if (error(::GetFileTime(hw.handle, 0, 0, &lwt)== 0, + if (error(::GetFileTime(hw.handle, 0, 0, &lwt)== 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::last_write_time")) return std::time_t(-1); @@ -1348,7 +1344,7 @@ namespace detail ::utimbuf buf; buf.actime = path_stat.st_atime; // utime()updates access time too:-( buf.modtime = new_time; - error(::utime(p.c_str(), &buf)!= 0, + error(::utime(p.c_str(), &buf)!= 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::last_write_time"); # else @@ -1358,14 +1354,14 @@ namespace detail FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0)); - if (error(hw.handle == INVALID_HANDLE_VALUE, + if (error(hw.handle == INVALID_HANDLE_VALUE ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::last_write_time")) return; FILETIME lwt; to_FILETIME(new_time, lwt); - error(::SetFileTime(hw.handle, 0, 0, &lwt)== 0, + error(::SetFileTime(hw.handle, 0, 0, &lwt)== 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::last_write_time"); # endif } @@ -1441,7 +1437,7 @@ namespace detail DWORD attr = ::GetFileAttributesW(p.c_str()); - if (error(attr == 0, p, ec, "boost::filesystem::permissions")) + if (error(attr == 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::permissions")) return; if (prms & add_perms) @@ -1453,7 +1449,7 @@ namespace detail else attr |= FILE_ATTRIBUTE_READONLY; - error(::SetFileAttributesW(p.c_str(), attr) == 0, + error(::SetFileAttributesW(p.c_str(), attr) == 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::permissions"); # endif } @@ -1489,7 +1485,7 @@ namespace detail } # elif _WIN32_WINNT < 0x0600 // SDK earlier than Vista and Server 2008 - error(true, error_code(BOOST_ERROR_NOT_SUPPORTED, system_category()), p, ec, + error(BOOST_ERROR_NOT_SUPPORTED, p, ec, "boost::filesystem::read_symlink"); # else // Vista and Server 2008 SDK, or later @@ -1503,13 +1499,14 @@ namespace detail create_file_handle(p.c_str(), GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0)); - if (error(h.handle == INVALID_HANDLE_VALUE, p, ec, "boost::filesystem::read_symlink")) - return symlink_path; + if (error(h.handle == INVALID_HANDLE_VALUE ? BOOST_ERRNO : 0, + p, ec, "boost::filesystem::read_symlink")) + return symlink_path; DWORD sz; if (!error(::DeviceIoControl(h.handle, FSCTL_GET_REPARSE_POINT, - 0, 0, info.buf, sizeof(info), &sz, 0) == 0, p, ec, + 0, 0, info.buf, sizeof(info), &sz, 0) == 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::read_symlink" )) symlink_path.assign( static_cast<wchar_t*>(info.rdb.SymbolicLinkReparseBuffer.PathBuffer) @@ -1526,7 +1523,7 @@ namespace detail { error_code tmp_ec; file_type type = query_file_type(p, &tmp_ec); - if (error(type == status_error, tmp_ec, p, ec, + if (error(type == status_error ? tmp_ec.value() : 0, p, ec, "boost::filesystem::remove")) return false; @@ -1542,7 +1539,7 @@ namespace detail { error_code tmp_ec; file_type type = query_file_type(p, &tmp_ec); - if (error(type == status_error, tmp_ec, p, ec, + if (error(type == status_error ? tmp_ec.value() : 0, p, ec, "boost::filesystem::remove_all")) return 0; @@ -1554,14 +1551,15 @@ namespace detail BOOST_FILESYSTEM_DECL void rename(const path& old_p, const path& new_p, error_code* ec) { - error(!BOOST_MOVE_FILE(old_p.c_str(), new_p.c_str()), old_p, new_p, ec, - "boost::filesystem::rename"); + error(!BOOST_MOVE_FILE(old_p.c_str(), new_p.c_str()) ? BOOST_ERRNO : 0, old_p, new_p, + ec, "boost::filesystem::rename"); } BOOST_FILESYSTEM_DECL void resize_file(const path& p, uintmax_t size, system::error_code* ec) { - error(!BOOST_RESIZE_FILE(p.c_str(), size), p, ec, "boost::filesystem::resize_file"); + error(!BOOST_RESIZE_FILE(p.c_str(), size) ? BOOST_ERRNO : 0, p, ec, + "boost::filesystem::resize_file"); } BOOST_FILESYSTEM_DECL @@ -1770,8 +1768,7 @@ namespace detail if (p.empty() || (ec&&!is_directory(p, *ec))||(!ec&&!is_directory(p))) { - errno = ENOTDIR; - error(true, p, ec, "boost::filesystem::temp_directory_path"); + error(ENOTDIR, p, ec, "boost::filesystem::temp_directory_path"); return p; } @@ -1779,27 +1776,45 @@ namespace detail # else // Windows - std::vector<path::value_type> buf(GetTempPathW(0, NULL)); + const wchar_t* tmp_env = L"TMP"; + const wchar_t* temp_env = L"TEMP"; + const wchar_t* localappdata_env = L"LOCALAPPDATA"; + const wchar_t* userprofile_env = L"USERPROFILE"; + const wchar_t* env_list[] + = {tmp_env, temp_env, localappdata_env, userprofile_env, 0}; - if (buf.empty() || GetTempPathW(buf.size(), &buf[0])==0) + path p; + for (int i = 0; env_list[i]; ++i) { - if(!buf.empty()) ::SetLastError(ENOTDIR); - error(true, ec, "boost::filesystem::temp_directory_path"); - return path(); + std::wstring env = wgetenv(env_list[i]); + if (!env.empty()) + { + p = env; + if (i >= 2) + p /= L"Temp"; + error_code lcl_ec; + if (exists(p, lcl_ec) && !lcl_ec && is_directory(p, lcl_ec) && !lcl_ec) + break; + p.clear(); + } } - - buf.pop_back(); - - path p(buf.begin(), buf.end()); - - if ((ec&&!is_directory(p, *ec))||(!ec&&!is_directory(p))) + + if (p.empty()) { - ::SetLastError(ENOTDIR); - error(true, p, ec, "boost::filesystem::temp_directory_path"); - return path(); + // use vector since in C++03 a string is not required to be contiguous + std::vector<wchar_t> buf(::GetWindowsDirectoryW(NULL, 0)); + + if (buf.empty() + || ::GetWindowsDirectoryW(&buf[0], static_cast<UINT>(buf.size())) == 0) + { + error(::GetLastError(), ec, "boost::filesystem::temp_directory_path"); + return path(); + } + p = &*buf.begin(); // do not depend on buf.size(); see ticket #10388 + p /= L"Temp"; } - return p; + # endif } @@ -1820,7 +1835,7 @@ namespace detail wchar_t* pfn; std::size_t len = get_full_path_name(p, buf_size, buf, &pfn); - if (error(len == 0, p, ec, "boost::filesystem::system_complete")) + if (error(len == 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::system_complete")) return path(); if (len < buf_size)// len does not include null termination character @@ -1828,7 +1843,7 @@ namespace detail boost::scoped_array<wchar_t> big_buf(new wchar_t[len]); - return error(get_full_path_name(p, len , big_buf.get(), &pfn)== 0, + return error(get_full_path_name(p, len , big_buf.get(), &pfn)== 0 ? BOOST_ERRNO : 0, p, ec, "boost::filesystem::system_complete") ? path() : path(big_buf.get()); @@ -2160,7 +2175,7 @@ namespace detail void directory_iterator_construct(directory_iterator& it, const path& p, system::error_code* ec) { - if (error(p.empty(), not_found_error_code, p, ec, + if (error(p.empty() ? not_found_error_code.value() : 0, p, ec, "boost::filesystem::directory_iterator::construct")) return; @@ -2175,7 +2190,7 @@ namespace detail if (result) { it.m_imp.reset(); - error(true, result, p, + error(result.value(), p, ec, "boost::filesystem::directory_iterator::construct"); return; } diff --git a/libs/filesystem/src/path.cpp b/libs/filesystem/src/path.cpp index 784e31a79..22a128545 100644 --- a/libs/filesystem/src/path.cpp +++ b/libs/filesystem/src/path.cpp @@ -36,7 +36,7 @@ # include "windows_file_codecvt.hpp" # include <windows.h> #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \ - || defined(__FreeBSD__) || defined(__OPEN_BSD__) + || defined(__FreeBSD__) || defined(__OPEN_BSD__) || defined(__HAIKU__) # include <boost/filesystem/detail/utf8_codecvt_facet.hpp> #endif @@ -254,6 +254,13 @@ namespace filesystem return *this; } + path& path::remove_trailing_separator() + { + if (!m_pathname.empty() && is_separator(m_pathname[m_pathname.size() - 1])) + m_pathname.erase(m_pathname.size() - 1); + return *this; + } + path& path::replace_extension(const path& new_extension) { // erase existing extension, including the dot, if any @@ -660,11 +667,11 @@ namespace filesystem const path& dot_path() { # ifdef BOOST_WINDOWS_API - static const fs::path dot(L"."); + static const fs::path dot_pth(L"."); # else - static const fs::path dot("."); + static const fs::path dot_pth("."); # endif - return dot; + return dot_pth; } BOOST_FILESYSTEM_DECL @@ -831,7 +838,7 @@ namespace std::locale global_loc = std::locale(); return std::locale(global_loc, new windows_file_codecvt); # elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \ - || defined(__FreeBSD__) || defined(__OpenBSD__) + || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) // "All BSD system functions expect their string parameters to be in UTF-8 encoding // and nothing else." See // http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/FileEncodings.html diff --git a/libs/filesystem/test/issues/10205.cpp b/libs/filesystem/test/issues/10205.cpp new file mode 100644 index 000000000..4cf5e728d --- /dev/null +++ b/libs/filesystem/test/issues/10205.cpp @@ -0,0 +1,17 @@ +// Linux test; before running: export LANG=foo + +#include <locale> +#include <iostream> +#include <string> +#include <boost/filesystem/path.hpp> + +int main() +{ + std::string pathname = "/some/filesystem/path/%%%%"; + + boost::filesystem::path path(pathname); + + std::wcout << path.wstring() << std::endl; + + return 0; +} diff --git a/libs/filesystem/test/issues/3332/test.cpp b/libs/filesystem/test/issues/3332/test.cpp new file mode 100644 index 000000000..9456a7a83 --- /dev/null +++ b/libs/filesystem/test/issues/3332/test.cpp @@ -0,0 +1,37 @@ +#include <boost/filesystem.hpp> +#include <cvt/cp950> +#include <iostream> +#include <string> +#include <locale> + +namespace fs = boost::filesystem; + +int main(void) { + + std::locale global_loc = std::locale(); + std::locale loc(global_loc, new stdext::cvt::codecvt_cp950<wchar_t>); + fs::path::imbue(loc); + + std::cout << + "HEADS UP! PIPE OUTPUT TO FILE AND INSPECT WITH HEX OR CP950 EDITOR.\n" + "WINDOWS COMMAND PROMPT FONTS DON'T SUPPORT CHINESE,\n" + "EVEN WITH CODEPAGE SET AND EVEN AS OF WIN 10 TECH PREVIEW." << std::endl; + + fs::recursive_directory_iterator end; + fs::recursive_directory_iterator iter + ("C:/boost/test-files/utf-8"); + + while (iter != end) + { + if (fs::is_directory(*iter)) + { + std::cout << "[directory] " << iter->path().generic_string() << std::endl; + } + else if (fs::is_regular(*iter)) + { + std::cout << " [file] " << iter->path().generic_string() << std::endl; + } + ++iter; + } + return 0; +} diff --git a/libs/filesystem/test/issues/4329.-basename.cpp b/libs/filesystem/test/issues/4329.-basename.cpp new file mode 100644 index 000000000..a07648b32 --- /dev/null +++ b/libs/filesystem/test/issues/4329.-basename.cpp @@ -0,0 +1,20 @@ +#include <iostream> +#include <boost/filesystem.hpp> +using boost::filesystem::path; + +int main() +{ + std::cout << path("a").stem() << std::endl; + std::cout << path("a/").stem() << std::endl; + std::cout << path("a/b").stem() << std::endl; + std::cout << path("a/b/").stem() << std::endl; + std::cout << path("a/b/c").stem() << std::endl; + std::cout << path("a/b/c/").stem() << std::endl; + std::cout << path("a/b/c/d").stem() << std::endl; + std::cout << path("a/b/c/d/").stem() << std::endl; + std::cout << path("a/b/c/d/e").stem() << std::endl; + std::cout << path("a/b/c/d/e/").stem() << std::endl; + return 0; +} + + diff --git a/libs/filesystem/test/issues/5300-temp-dir-path-130.cpp b/libs/filesystem/test/issues/5300-temp-dir-path-130.cpp new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/libs/filesystem/test/issues/5300-temp-dir-path-130.cpp diff --git a/libs/filesystem/test/issues/boost-no-inspect b/libs/filesystem/test/issues/boost-no-inspect new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/libs/filesystem/test/issues/boost-no-inspect diff --git a/libs/filesystem/test/msvc/boost-no-inspect b/libs/filesystem/test/msvc/boost-no-inspect new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/libs/filesystem/test/msvc/boost-no-inspect diff --git a/libs/filesystem/test/msvc/convenience_test/convenience_test.vcxproj b/libs/filesystem/test/msvc/convenience_test/convenience_test.vcxproj index c9ab76b35..14dfa1757 100644 --- a/libs/filesystem/test/msvc/convenience_test/convenience_test.vcxproj +++ b/libs/filesystem/test/msvc/convenience_test/convenience_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/deprecated_test/deprecated_test.vcxproj b/libs/filesystem/test/msvc/deprecated_test/deprecated_test.vcxproj index 943502c5c..1c5f1b3f6 100644 --- a/libs/filesystem/test/msvc/deprecated_test/deprecated_test.vcxproj +++ b/libs/filesystem/test/msvc/deprecated_test/deprecated_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/file_status/file_status.vcxproj b/libs/filesystem/test/msvc/file_status/file_status.vcxproj index 91721bade..1a746ce8d 100644 --- a/libs/filesystem/test/msvc/file_status/file_status.vcxproj +++ b/libs/filesystem/test/msvc/file_status/file_status.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/filesystem.sln b/libs/filesystem/test/msvc/filesystem.sln index 4be2cfa01..f72b6225e 100644 --- a/libs/filesystem/test/msvc/filesystem.sln +++ b/libs/filesystem/test/msvc/filesystem.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2013 for Windows Desktop -VisualStudioVersion = 12.0.30626.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.22310.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "path_unit_test", "path_unit_test\path_unit_test.vcxproj", "{3C77F610-2E31-4087-9DF2-7CD45198A02D}" EndProject @@ -106,6 +106,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "odr_test", "odr_test\odr_te EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hello_filesystem", "hello_filesystem\hello_filesystem.vcxproj", "{3D74D9C5-31B1-4D5B-B49C-8725E26CF768}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "issue_test", "issue_test\issue_test.vcxproj", "{3B1AF12C-25AB-44F7-A80B-8BBA0D3D08CE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "headers", "headers\headers.vcxproj", "{5FFA4555-E967-4632-A3E6-ED8826E9FDED}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bug-reporting", "bug-reporting\bug-reporting.vcxproj", "{534B6F8A-B899-4C68-A10C-BB98FFCB35D6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -232,6 +238,16 @@ Global {3D74D9C5-31B1-4D5B-B49C-8725E26CF768}.Debug|Win32.Build.0 = Debug|Win32 {3D74D9C5-31B1-4D5B-B49C-8725E26CF768}.Release|Win32.ActiveCfg = Release|Win32 {3D74D9C5-31B1-4D5B-B49C-8725E26CF768}.Release|Win32.Build.0 = Release|Win32 + {3B1AF12C-25AB-44F7-A80B-8BBA0D3D08CE}.Debug|Win32.ActiveCfg = Debug|Win32 + {3B1AF12C-25AB-44F7-A80B-8BBA0D3D08CE}.Debug|Win32.Build.0 = Debug|Win32 + {3B1AF12C-25AB-44F7-A80B-8BBA0D3D08CE}.Release|Win32.ActiveCfg = Release|Win32 + {3B1AF12C-25AB-44F7-A80B-8BBA0D3D08CE}.Release|Win32.Build.0 = Release|Win32 + {5FFA4555-E967-4632-A3E6-ED8826E9FDED}.Debug|Win32.ActiveCfg = Debug|Win32 + {5FFA4555-E967-4632-A3E6-ED8826E9FDED}.Release|Win32.ActiveCfg = Release|Win32 + {534B6F8A-B899-4C68-A10C-BB98FFCB35D6}.Debug|Win32.ActiveCfg = Debug|Win32 + {534B6F8A-B899-4C68-A10C-BB98FFCB35D6}.Debug|Win32.Build.0 = Debug|Win32 + {534B6F8A-B899-4C68-A10C-BB98FFCB35D6}.Release|Win32.ActiveCfg = Release|Win32 + {534B6F8A-B899-4C68-A10C-BB98FFCB35D6}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcxproj b/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcxproj index 98ac7817d..aa19a6e8c 100644 --- a/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcxproj +++ b/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>DynamicLibrary</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> @@ -50,7 +50,7 @@ <ClCompile> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FILESYSTEM_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>BOOST_FILEYSTEM_INCLUDE_IOSTREAM;WIN32;_DEBUG;_WINDOWS;_USRDLL;FILESYSTEM_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>true</MinimalRebuild> <ExceptionHandling>Async</ExceptionHandling> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> diff --git a/libs/filesystem/test/msvc/filesystem_lib/filesystem_lib.vcxproj b/libs/filesystem/test/msvc/filesystem_lib/filesystem_lib.vcxproj index 29eac94df..3aecd33da 100644 --- a/libs/filesystem/test/msvc/filesystem_lib/filesystem_lib.vcxproj +++ b/libs/filesystem/test/msvc/filesystem_lib/filesystem_lib.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -35,14 +35,14 @@ <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/fstream_test/fstream_test.vcxproj b/libs/filesystem/test/msvc/fstream_test/fstream_test.vcxproj index fbd26f28c..dba20e5fd 100644 --- a/libs/filesystem/test/msvc/fstream_test/fstream_test.vcxproj +++ b/libs/filesystem/test/msvc/fstream_test/fstream_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/headers/headers.vcxproj b/libs/filesystem/test/msvc/headers/headers.vcxproj new file mode 100644 index 000000000..952e0c4fa --- /dev/null +++ b/libs/filesystem/test/msvc/headers/headers.vcxproj @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{5FFA4555-E967-4632-A3E6-ED8826E9FDED}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>headers</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="..\..\..\include\boost\filesystem.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\config.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\convenience.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\detail\utf8_codecvt_facet.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\exception.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\fstream.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\operations.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\path.hpp" /> + <ClInclude Include="..\..\..\include\boost\filesystem\path_traits.hpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/filesystem/test/msvc/hello_filesystem/hello_filesystem.vcxproj b/libs/filesystem/test/msvc/hello_filesystem/hello_filesystem.vcxproj index 5a9cc9530..7c42df847 100644 --- a/libs/filesystem/test/msvc/hello_filesystem/hello_filesystem.vcxproj +++ b/libs/filesystem/test/msvc/hello_filesystem/hello_filesystem.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -19,13 +19,13 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> diff --git a/libs/filesystem/test/msvc/issue_test/issue_test.vcxproj b/libs/filesystem/test/msvc/issue_test/issue_test.vcxproj new file mode 100644 index 000000000..8cb90de86 --- /dev/null +++ b/libs/filesystem/test/msvc/issue_test/issue_test.vcxproj @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{3B1AF12C-25AB-44F7-A80B-8BBA0D3D08CE}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>issue_test</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe"</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe"</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectReference Include="..\filesystem_dll\filesystem_dll.vcxproj"> + <Project>{ffd738f7-96f0-445c-81ea-551665ef53d1}</Project> + </ProjectReference> + <ProjectReference Include="..\system_dll\system_dll.vcxproj"> + <Project>{f94ccadd-a90b-480c-a304-c19d015d36b1}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\issues\5300-temp-dir-path-130.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/filesystem/test/msvc/locale_info/locale_info.vcxproj b/libs/filesystem/test/msvc/locale_info/locale_info.vcxproj index 4b9f69e66..66629ab44 100644 --- a/libs/filesystem/test/msvc/locale_info/locale_info.vcxproj +++ b/libs/filesystem/test/msvc/locale_info/locale_info.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/long_path_test/long_path_test.vcxproj b/libs/filesystem/test/msvc/long_path_test/long_path_test.vcxproj index 2cd3b3e17..c8e86dd35 100644 --- a/libs/filesystem/test/msvc/long_path_test/long_path_test.vcxproj +++ b/libs/filesystem/test/msvc/long_path_test/long_path_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/macro_default_test/macro_default_test.vcxproj b/libs/filesystem/test/msvc/macro_default_test/macro_default_test.vcxproj index 17884699e..4a24893c0 100644 --- a/libs/filesystem/test/msvc/macro_default_test/macro_default_test.vcxproj +++ b/libs/filesystem/test/msvc/macro_default_test/macro_default_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/odr_test/odr_test.vcxproj b/libs/filesystem/test/msvc/odr_test/odr_test.vcxproj index c3eb0ffa1..a6ea2534d 100644 --- a/libs/filesystem/test/msvc/odr_test/odr_test.vcxproj +++ b/libs/filesystem/test/msvc/odr_test/odr_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -19,13 +19,13 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> diff --git a/libs/filesystem/test/msvc/operations_test/operations_test.vcxproj b/libs/filesystem/test/msvc/operations_test/operations_test.vcxproj index b5456d71a..b7be12ae3 100644 --- a/libs/filesystem/test/msvc/operations_test/operations_test.vcxproj +++ b/libs/filesystem/test/msvc/operations_test/operations_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/operations_unit_test/operations_unit_test.vcxproj b/libs/filesystem/test/msvc/operations_unit_test/operations_unit_test.vcxproj index f0f46a5dc..67fd0aba4 100644 --- a/libs/filesystem/test/msvc/operations_unit_test/operations_unit_test.vcxproj +++ b/libs/filesystem/test/msvc/operations_unit_test/operations_unit_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/path_test/path_test.vcxproj b/libs/filesystem/test/msvc/path_test/path_test.vcxproj index 5d73634fd..354d35c5f 100644 --- a/libs/filesystem/test/msvc/path_test/path_test.vcxproj +++ b/libs/filesystem/test/msvc/path_test/path_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/path_test_static/path_test_static.vcxproj b/libs/filesystem/test/msvc/path_test_static/path_test_static.vcxproj index 3380d9582..133661bab 100644 --- a/libs/filesystem/test/msvc/path_test_static/path_test_static.vcxproj +++ b/libs/filesystem/test/msvc/path_test_static/path_test_static.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/path_timings/path_timings.vcxproj b/libs/filesystem/test/msvc/path_timings/path_timings.vcxproj index 5b03c7c03..8721fb4be 100644 --- a/libs/filesystem/test/msvc/path_timings/path_timings.vcxproj +++ b/libs/filesystem/test/msvc/path_timings/path_timings.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/path_unit_test/path_unit_test.vcxproj b/libs/filesystem/test/msvc/path_unit_test/path_unit_test.vcxproj index c60500e35..ba86e47d6 100644 --- a/libs/filesystem/test/msvc/path_unit_test/path_unit_test.vcxproj +++ b/libs/filesystem/test/msvc/path_unit_test/path_unit_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/recurse_dir_iter_test/recurse_dir_iter_test.vcxproj b/libs/filesystem/test/msvc/recurse_dir_iter_test/recurse_dir_iter_test.vcxproj index 6fc77948e..f1e7ca978 100644 --- a/libs/filesystem/test/msvc/recurse_dir_iter_test/recurse_dir_iter_test.vcxproj +++ b/libs/filesystem/test/msvc/recurse_dir_iter_test/recurse_dir_iter_test.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -19,13 +19,13 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> diff --git a/libs/filesystem/test/msvc/stems/stems.vcxproj b/libs/filesystem/test/msvc/stems/stems.vcxproj index 1e58b0b92..4687d3b56 100644 --- a/libs/filesystem/test/msvc/stems/stems.vcxproj +++ b/libs/filesystem/test/msvc/stems/stems.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/system_dll/system_dll.vcxproj b/libs/filesystem/test/msvc/system_dll/system_dll.vcxproj index 6415ccfa6..2a5d8555b 100644 --- a/libs/filesystem/test/msvc/system_dll/system_dll.vcxproj +++ b/libs/filesystem/test/msvc/system_dll/system_dll.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -23,12 +23,12 @@ <ConfigurationType>DynamicLibrary</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/system_lib/system_lib.vcxproj b/libs/filesystem/test/msvc/system_lib/system_lib.vcxproj index bf08571c7..0603340c6 100644 --- a/libs/filesystem/test/msvc/system_lib/system_lib.vcxproj +++ b/libs/filesystem/test/msvc/system_lib/system_lib.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut1/tut1.vcxproj b/libs/filesystem/test/msvc/tut1/tut1.vcxproj index 49a628901..95403ce72 100644 --- a/libs/filesystem/test/msvc/tut1/tut1.vcxproj +++ b/libs/filesystem/test/msvc/tut1/tut1.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut2/tut2.vcxproj b/libs/filesystem/test/msvc/tut2/tut2.vcxproj index 7a1e355ce..590dc78fd 100644 --- a/libs/filesystem/test/msvc/tut2/tut2.vcxproj +++ b/libs/filesystem/test/msvc/tut2/tut2.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut3/tut3.vcxproj b/libs/filesystem/test/msvc/tut3/tut3.vcxproj index eb7ed2db4..c53d0ea06 100644 --- a/libs/filesystem/test/msvc/tut3/tut3.vcxproj +++ b/libs/filesystem/test/msvc/tut3/tut3.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut4/tut4.vcxproj b/libs/filesystem/test/msvc/tut4/tut4.vcxproj index 472c23daa..ea22114a6 100644 --- a/libs/filesystem/test/msvc/tut4/tut4.vcxproj +++ b/libs/filesystem/test/msvc/tut4/tut4.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,12 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut5/tut5.vcxproj b/libs/filesystem/test/msvc/tut5/tut5.vcxproj index 0d6848775..4348f29d9 100644 --- a/libs/filesystem/test/msvc/tut5/tut5.vcxproj +++ b/libs/filesystem/test/msvc/tut5/tut5.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut6a/tut6a.vcxproj b/libs/filesystem/test/msvc/tut6a/tut6a.vcxproj index cbd371ef9..17e1498aa 100644 --- a/libs/filesystem/test/msvc/tut6a/tut6a.vcxproj +++ b/libs/filesystem/test/msvc/tut6a/tut6a.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut6b/tut6b.vcxproj b/libs/filesystem/test/msvc/tut6b/tut6b.vcxproj index 3f43c40ff..34efae5bf 100644 --- a/libs/filesystem/test/msvc/tut6b/tut6b.vcxproj +++ b/libs/filesystem/test/msvc/tut6b/tut6b.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/tut6c/tut6c.vcxproj b/libs/filesystem/test/msvc/tut6c/tut6c.vcxproj index c34c3003a..84a129062 100644 --- a/libs/filesystem/test/msvc/tut6c/tut6c.vcxproj +++ b/libs/filesystem/test/msvc/tut6c/tut6c.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/msvc/windows_attributes/windows_attributes.vcxproj b/libs/filesystem/test/msvc/windows_attributes/windows_attributes.vcxproj index 0cf6c6c2c..a2a682991 100644 --- a/libs/filesystem/test/msvc/windows_attributes/windows_attributes.vcxproj +++ b/libs/filesystem/test/msvc/windows_attributes/windows_attributes.vcxproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> @@ -20,14 +20,14 @@ <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> - <PlatformToolset>v120</PlatformToolset> + <PlatformToolset>v140</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> diff --git a/libs/filesystem/test/operations_test.cpp b/libs/filesystem/test/operations_test.cpp index 22a8b8853..444c2810d 100644 --- a/libs/filesystem/test/operations_test.cpp +++ b/libs/filesystem/test/operations_test.cpp @@ -56,19 +56,25 @@ inline std::wstring convert(const char* c) return std::wstring(s.begin(), s.end()); } -inline int setenv(const char* name, const fs::path::value_type* val, int) +// Note: these three setenv* functions are not general solutions for the missing +// setenv* problem on Windows. See Microsoft's _putenv for that need, and ticker #7018 +// for discussion and rationale for returning void for this test program, which needs +// to work for both the MSVC Runtime and the Windows Runtime (which does not support +// _putenv). + +inline void setenv(const char* name, const fs::path::value_type* val, int) { - return SetEnvironmentVariableW(convert(name).c_str(), val); + SetEnvironmentVariableW(convert(name).c_str(), val); } -inline int setenv(const char* name, const char* val, int) +inline void setenv(const char* name, const char* val, int) { - return SetEnvironmentVariableW(convert(name).c_str(), convert(val).c_str()); + SetEnvironmentVariableW(convert(name).c_str(), convert(val).c_str()); } -inline int unsetenv(const char* name) +inline void unsetenv(const char* name) { - return SetEnvironmentVariableW(convert(name).c_str(), 0); + SetEnvironmentVariableW(convert(name).c_str(), 0); } #else @@ -165,20 +171,23 @@ namespace // compile-only two argument "do-the-right-thing" tests // verifies that all overload combinations compile without error - void do_not_call() + void do_the_right_thing_tests(bool call_ = false) { - fs::path p; - std::string s; - const char* a = 0; - fs::copy_file(p, p); - fs::copy_file(s, p); - fs::copy_file(a, p); - fs::copy_file(p, s); - fs::copy_file(p, a); - fs::copy_file(s, s); - fs::copy_file(a, s); - fs::copy_file(s, a); - fs::copy_file(a, a); + if (call_) + { + fs::path p; + std::string s; + const char* a = 0; + fs::copy_file(p, p); + fs::copy_file(s, p); + fs::copy_file(a, p); + fs::copy_file(p, s); + fs::copy_file(p, a); + fs::copy_file(s, s); + fs::copy_file(a, s); + fs::copy_file(s, a); + fs::copy_file(a, a); + } } void bad_file_size() @@ -224,42 +233,42 @@ namespace //------------------------------ debugging aids --------------------------------------// - std::ostream& operator<<(std::ostream& os, const fs::file_status& s) - { - if (s.type() == fs::status_error) { os << "status_error"; } - else if (s.type() == fs::file_not_found) { os << "file_not_found"; } - else if (s.type() == fs::regular_file) { os << "regular_file"; } - else if (s.type() == fs::directory_file) { os << "directory_file"; } - else if (s.type() == fs::symlink_file) { os << "symlink_file"; } - else if (s.type() == fs::block_file) { os << "block_file"; } - else if (s.type() == fs::character_file) { os << "character_file"; } - else if (s.type() == fs::fifo_file) { os << "fifo_file"; } - else if (s.type() == fs::socket_file) { os << "socket_file"; } - else if (s.type() == fs::reparse_file) { os << "reparse_file"; } - else if (s.type() == fs::type_unknown) { os << "type_unknown"; } - else { os << "_detail_directory_symlink"; } - return os; - } - - void dump_tree(const fs::path & root) - { - cout << "dumping tree rooted at " << root << endl; - for (fs::recursive_directory_iterator it (root, fs::symlink_option::recurse); - it != fs::recursive_directory_iterator(); - ++it) - { - for (int i = 0; i <= it.level(); ++i) - cout << " "; - - cout << it->path(); - if (fs::is_symlink(it->path())) - { - cout << " [symlink]" << endl; - } - else - cout << endl; - } - } + //std::ostream& operator<<(std::ostream& os, const fs::file_status& s) + //{ + // if (s.type() == fs::status_error) { os << "status_error"; } + // else if (s.type() == fs::file_not_found) { os << "file_not_found"; } + // else if (s.type() == fs::regular_file) { os << "regular_file"; } + // else if (s.type() == fs::directory_file) { os << "directory_file"; } + // else if (s.type() == fs::symlink_file) { os << "symlink_file"; } + // else if (s.type() == fs::block_file) { os << "block_file"; } + // else if (s.type() == fs::character_file) { os << "character_file"; } + // else if (s.type() == fs::fifo_file) { os << "fifo_file"; } + // else if (s.type() == fs::socket_file) { os << "socket_file"; } + // else if (s.type() == fs::reparse_file) { os << "reparse_file"; } + // else if (s.type() == fs::type_unknown) { os << "type_unknown"; } + // else { os << "_detail_directory_symlink"; } + // return os; + //} + + //void dump_tree(const fs::path & root) + //{ + // cout << "dumping tree rooted at " << root << endl; + // for (fs::recursive_directory_iterator it (root, fs::symlink_option::recurse); + // it != fs::recursive_directory_iterator(); + // ++it) + // { + // for (int i = 0; i <= it.level(); ++i) + // cout << " "; + + // cout << it->path(); + // if (fs::is_symlink(it->path())) + // { + // cout << " [symlink]" << endl; + // } + // else + // cout << endl; + // } + //} // exception_tests() ---------------------------------------------------------------// @@ -447,21 +456,21 @@ namespace BOOST_TEST(ec); dir_itr_exception = false; - try { fs::directory_iterator it("nosuchdirectory"); } + try { fs::directory_iterator itx("nosuchdirectory"); } catch (const fs::filesystem_error &) { dir_itr_exception = true; } BOOST_TEST(dir_itr_exception); ec.clear(); - fs::directory_iterator it2("nosuchdirectory", ec); + fs::directory_iterator it2x("nosuchdirectory", ec); BOOST_TEST(ec); dir_itr_exception = false; try { - error_code ec; - fs::directory_iterator it("nosuchdirectory", ec); - BOOST_TEST(ec); - BOOST_TEST(ec == boost::system::errc::no_such_file_or_directory); + error_code ecx; + fs::directory_iterator itx("nosuchdirectory", ecx); + BOOST_TEST(ecx); + BOOST_TEST(ecx == boost::system::errc::no_such_file_or_directory); } catch (const fs::filesystem_error &) { dir_itr_exception = true; } BOOST_TEST(!dir_itr_exception); @@ -547,14 +556,14 @@ namespace BOOST_TEST(dir_itr->path() != p); // test case reported in comment to SourceForge bug tracker [937606] - fs::directory_iterator it(dir); - const fs::path p1 = (*it++).path(); - BOOST_TEST(it != fs::directory_iterator()); - const fs::path p2 = (*it++).path(); + fs::directory_iterator itx(dir); + const fs::path p1 = (*itx++).path(); + BOOST_TEST(itx != fs::directory_iterator()); + const fs::path p2 = (*itx++).path(); BOOST_TEST(p1 != p2); - ++it; - ++it; - BOOST_TEST(it == fs::directory_iterator()); + ++itx; + ++itx; + BOOST_TEST(itx == fs::directory_iterator()); } // Windows has a tricky special case when just the root-name is given, @@ -563,17 +572,17 @@ namespace if (platform == "Windows") { fs::path root_name_path(fs::current_path().root_name()); - fs::directory_iterator it(root_name_path); - BOOST_TEST(it != fs::directory_iterator()); -// BOOST_TEST(fs::exists((*it).path())); - BOOST_TEST(fs::exists(it->path())); - BOOST_TEST(it->path().parent_path() == root_name_path); + fs::directory_iterator itx(root_name_path); + BOOST_TEST(itx != fs::directory_iterator()); +// BOOST_TEST(fs::exists((*itx).path())); + BOOST_TEST(fs::exists(itx->path())); + BOOST_TEST(itx->path().parent_path() == root_name_path); bool found(false); do { - if (it->path().filename() == temp_dir.filename()) + if (itx->path().filename() == temp_dir.filename()) found = true; - } while (++it != fs::directory_iterator()); + } while (++itx != fs::directory_iterator()); BOOST_TEST(found); } @@ -594,7 +603,7 @@ namespace int walk_tree(bool recursive) { - cout << " walk_tree" << endl; +// cout << " walk_tree" << endl; error_code ec; int d1f1_count = 0; for (fs::recursive_directory_iterator it (dir, @@ -602,7 +611,7 @@ namespace it != fs::recursive_directory_iterator(); it.increment(ec)) { - cout << " " << it->path() << endl; +// cout << " " << it->path() << endl; if (it->path().filename() == "d1f1") ++d1f1_count; } @@ -718,12 +727,12 @@ namespace cout << "create_hard_link_tests..." << endl; fs::path from_ph(dir / "f3"); - fs::path f1(dir / "f1"); + fs::path f1x(dir / "f1"); BOOST_TEST(!fs::exists(from_ph)); - BOOST_TEST(fs::exists(f1)); + BOOST_TEST(fs::exists(f1x)); bool create_hard_link_ok(true); - try { fs::create_hard_link(f1, from_ph); } + try { fs::create_hard_link(f1x, from_ph); } catch (const fs::filesystem_error & ex) { create_hard_link_ok = false; @@ -740,10 +749,10 @@ namespace << " *** For information only ***\n" " create_hard_link() succeeded\n"; BOOST_TEST(fs::exists(from_ph)); - BOOST_TEST(fs::exists(f1)); - BOOST_TEST(fs::equivalent(from_ph, f1)); + BOOST_TEST(fs::exists(f1x)); + BOOST_TEST(fs::equivalent(from_ph, f1x)); BOOST_TEST(fs::hard_link_count(from_ph) == 2); - BOOST_TEST(fs::hard_link_count(f1) == 2); + BOOST_TEST(fs::hard_link_count(f1x) == 2); } // Although tests may be running on a FAT or other file system that does @@ -764,10 +773,10 @@ namespace cout << "create_symlink_tests..." << endl; fs::path from_ph(dir / "f4"); - fs::path f1(dir / "f1"); + fs::path f1x(dir / "f1"); BOOST_TEST(!fs::exists(from_ph)); - BOOST_TEST(fs::exists(f1)); - try { fs::create_symlink(f1, from_ph); } + BOOST_TEST(fs::exists(f1x)); + try { fs::create_symlink(f1x, from_ph); } catch (const fs::filesystem_error & ex) { create_symlink_ok = false; @@ -785,9 +794,9 @@ namespace " create_symlink() succeeded\n"; BOOST_TEST(fs::exists(from_ph)); BOOST_TEST(fs::is_symlink(from_ph)); - BOOST_TEST(fs::exists(f1)); - BOOST_TEST(fs::equivalent(from_ph, f1)); - BOOST_TEST(fs::read_symlink(from_ph) == f1); + BOOST_TEST(fs::exists(f1x)); + BOOST_TEST(fs::equivalent(from_ph, f1x)); + BOOST_TEST(fs::read_symlink(from_ph) == f1x); fs::file_status stat = fs::symlink_status(from_ph); BOOST_TEST(fs::exists(stat)); @@ -880,8 +889,8 @@ namespace { cout << "rename_tests..." << endl; - fs::path f1(dir / "f1"); - BOOST_TEST(fs::exists(f1)); + fs::path f1x(dir / "f1"); + BOOST_TEST(fs::exists(f1x)); // error: rename a non-existent old file BOOST_TEST(!fs::exists(d1 / "f99")); @@ -892,7 +901,7 @@ namespace BOOST_TEST(CHECK_EXCEPTION(n1b, ENOENT)); // error: rename an existing file to "" - renamer n2(f1, ""); + renamer n2(f1x, ""); BOOST_TEST(CHECK_EXCEPTION(n2, ENOENT)); // rename an existing file to an existent file @@ -1217,32 +1226,32 @@ namespace // remove_tests --------------------------------------------------------------------// - void remove_tests(const fs::path& dir) + void remove_tests(const fs::path& dirx) { cout << "remove_tests..." << endl; // remove() file - fs::path f1 = dir / "shortlife"; - BOOST_TEST(!fs::exists(f1)); - create_file(f1, ""); - BOOST_TEST(fs::exists(f1)); - BOOST_TEST(!fs::is_directory(f1)); - BOOST_TEST(fs::remove(f1)); - BOOST_TEST(!fs::exists(f1)); + fs::path f1x = dirx / "shortlife"; + BOOST_TEST(!fs::exists(f1x)); + create_file(f1x, ""); + BOOST_TEST(fs::exists(f1x)); + BOOST_TEST(!fs::is_directory(f1x)); + BOOST_TEST(fs::remove(f1x)); + BOOST_TEST(!fs::exists(f1x)); BOOST_TEST(!fs::remove("no-such-file")); BOOST_TEST(!fs::remove("no-such-directory/no-such-file")); // remove() directory - fs::path d1 = dir / "shortlife_dir"; - BOOST_TEST(!fs::exists(d1)); - fs::create_directory(d1); - BOOST_TEST(fs::exists(d1)); - BOOST_TEST(fs::is_directory(d1)); - BOOST_TEST(fs::is_empty(d1)); - bad_remove_dir = dir; + fs::path d1x = dirx / "shortlife_dir"; + BOOST_TEST(!fs::exists(d1x)); + fs::create_directory(d1x); + BOOST_TEST(fs::exists(d1x)); + BOOST_TEST(fs::is_directory(d1x)); + BOOST_TEST(fs::is_empty(d1x)); + bad_remove_dir = dirx; BOOST_TEST(CHECK_EXCEPTION(bad_remove, ENOTEMPTY)); - BOOST_TEST(fs::remove(d1)); - BOOST_TEST(!fs::exists(d1)); + BOOST_TEST(fs::remove(d1x)); + BOOST_TEST(!fs::exists(d1x)); } // remove_symlink_tests ------------------------------------------------------------// @@ -1288,25 +1297,25 @@ namespace BOOST_TEST(!fs::is_symlink(link)); // remove() symbolic link to file - fs::path f1 = "link_target"; - fs::remove(f1); // remove any residue from past tests - BOOST_TEST(!fs::exists(f1)); - create_file(f1, ""); - BOOST_TEST(fs::exists(f1)); - BOOST_TEST(!fs::is_directory(f1)); - BOOST_TEST(fs::is_regular_file(f1)); + fs::path f1x = "link_target"; + fs::remove(f1x); // remove any residue from past tests + BOOST_TEST(!fs::exists(f1x)); + create_file(f1x, ""); + BOOST_TEST(fs::exists(f1x)); + BOOST_TEST(!fs::is_directory(f1x)); + BOOST_TEST(fs::is_regular_file(f1x)); link = "non_dangling_link"; - fs::create_symlink(f1, link); + fs::create_symlink(f1x, link); BOOST_TEST(fs::exists(link)); BOOST_TEST(!fs::is_directory(link)); BOOST_TEST(fs::is_regular_file(link)); BOOST_TEST(fs::is_symlink(link)); BOOST_TEST(fs::remove(link)); - BOOST_TEST(fs::exists(f1)); + BOOST_TEST(fs::exists(f1x)); BOOST_TEST(!fs::exists(link)); BOOST_TEST(!fs::is_symlink(link)); - BOOST_TEST(fs::remove(f1)); - BOOST_TEST(!fs::exists(f1)); + BOOST_TEST(fs::remove(f1x)); + BOOST_TEST(!fs::exists(f1x)); } // absolute_tests -----------------------------------------------------------------// @@ -1463,40 +1472,40 @@ namespace // copy_file_tests ------------------------------------------------------------------// - void copy_file_tests(const fs::path& f1, const fs::path& d1) + void copy_file_tests(const fs::path& f1x, const fs::path& d1x) { cout << "copy_file_tests..." << endl; - BOOST_TEST(fs::exists(f1)); - fs::remove(d1 / "f2"); // remove possible residue from prior testing - BOOST_TEST(fs::exists(d1)); - BOOST_TEST(!fs::exists(d1 / "f2")); - cout << " copy " << f1 << " to " << d1 / "f2" << endl; - fs::copy_file(f1, d1 / "f2"); + BOOST_TEST(fs::exists(f1x)); + fs::remove(d1x / "f2"); // remove possible residue from prior testing + BOOST_TEST(fs::exists(d1x)); + BOOST_TEST(!fs::exists(d1x / "f2")); + cout << " copy " << f1x << " to " << d1x / "f2" << endl; + fs::copy_file(f1x, d1x / "f2"); cout << " copy complete" << endl; - BOOST_TEST(fs::exists(f1)); - BOOST_TEST(fs::exists(d1 / "f2")); - BOOST_TEST(!fs::is_directory(d1 / "f2")); - verify_file(d1 / "f2", "file-f1"); + BOOST_TEST(fs::exists(f1x)); + BOOST_TEST(fs::exists(d1x / "f2")); + BOOST_TEST(!fs::is_directory(d1x / "f2")); + verify_file(d1x / "f2", "file-f1"); bool copy_ex_ok = false; - try { fs::copy_file(f1, d1 / "f2"); } + try { fs::copy_file(f1x, d1x / "f2"); } catch (const fs::filesystem_error &) { copy_ex_ok = true; } BOOST_TEST(copy_ex_ok); copy_ex_ok = false; - try { fs::copy_file(f1, d1 / "f2", fs::copy_option::fail_if_exists); } + try { fs::copy_file(f1x, d1x / "f2", fs::copy_option::fail_if_exists); } catch (const fs::filesystem_error &) { copy_ex_ok = true; } BOOST_TEST(copy_ex_ok); - create_file(d1 / "f2", "1234567890"); - BOOST_TEST_EQ(fs::file_size(d1 / "f2"), 10U); + create_file(d1x / "f2", "1234567890"); + BOOST_TEST_EQ(fs::file_size(d1x / "f2"), 10U); copy_ex_ok = true; - try { fs::copy_file(f1, d1 / "f2", fs::copy_option::overwrite_if_exists); } + try { fs::copy_file(f1x, d1x / "f2", fs::copy_option::overwrite_if_exists); } catch (const fs::filesystem_error &) { copy_ex_ok = false; } BOOST_TEST(copy_ex_ok); - BOOST_TEST_EQ(fs::file_size(d1 / "f2"), 7U); - verify_file(d1 / "f2", "file-f1"); + BOOST_TEST_EQ(fs::file_size(d1x / "f2"), 7U); + verify_file(d1x / "f2", "file-f1"); } // symlink_status_tests -------------------------------------------------------------// @@ -1563,22 +1572,22 @@ namespace // copy_symlink_tests ---------------------------------------------------------------// - void copy_symlink_tests(const fs::path& f1, const fs::path& d1) + void copy_symlink_tests(const fs::path& f1x, const fs::path& d1x) { cout << "copy_symlink_tests..." << endl; - BOOST_TEST(fs::exists(f1)); - BOOST_TEST(fs::exists(d1)); - fs::path sym1(d1 / "symlink1"); + BOOST_TEST(fs::exists(f1x)); + BOOST_TEST(fs::exists(d1x)); + fs::path sym1(d1x / "symlink1"); fs::remove(sym1); // remove possible residue from prior testing - fs::create_symlink(f1, sym1); + fs::create_symlink(f1x, sym1); BOOST_TEST(fs::exists(sym1)); BOOST_TEST(fs::is_symlink(sym1)); - fs::path sym2(d1 / "symlink2"); + fs::path sym2(d1x / "symlink2"); fs::copy_symlink(sym1, sym2); BOOST_TEST(fs::exists(sym2)); BOOST_TEST(fs::is_symlink(sym2)); - //fs::path sym3(d1 / "symlink3"); + //fs::path sym3(d1x / "symlink3"); //fs::copy(sym1, sym3); //BOOST_TEST(fs::exists(sym3)); //BOOST_TEST(fs::is_symlink(sym3)); @@ -1589,30 +1598,30 @@ namespace BOOST_TEST(copy_ex_ok); copy_ex_ok = false; - try { fs::copy_symlink(f1, "new-symlink2"); } // should fail; f1 not symlink + try { fs::copy_symlink(f1x, "new-symlink2"); } // should fail; f1x not symlink catch (const fs::filesystem_error &) { copy_ex_ok = true; } BOOST_TEST(copy_ex_ok); } // write_time_tests ----------------------------------------------------------------// - void write_time_tests(const fs::path& dir) + void write_time_tests(const fs::path& dirx) { cout << "write_time_tests..." << endl; - fs::path f1 = dir / "foobar2"; - create_file(f1, "foobar2"); - BOOST_TEST(fs::exists(f1)); - BOOST_TEST(!fs::is_directory(f1)); - BOOST_TEST(fs::is_regular_file(f1)); - BOOST_TEST(fs::file_size(f1) == 7); - verify_file(f1, "foobar2"); + fs::path f1x = dirx / "foobar2"; + create_file(f1x, "foobar2"); + BOOST_TEST(fs::exists(f1x)); + BOOST_TEST(!fs::is_directory(f1x)); + BOOST_TEST(fs::is_regular_file(f1x)); + BOOST_TEST(fs::file_size(f1x) == 7); + verify_file(f1x, "foobar2"); // Some file system report last write time as local (FAT), while // others (NTFS) report it as UTC. The C standard does not specify // if time_t is local or UTC. - std::time_t ft = fs::last_write_time(f1); + std::time_t ft = fs::last_write_time(f1x); cout << "\n UTC last_write_time() for a file just created is " << std::asctime(std::gmtime(&ft)) << endl; @@ -1620,15 +1629,15 @@ namespace cout << "\n Year is " << tmp->tm_year << endl; --tmp->tm_year; cout << " Change year to " << tmp->tm_year << endl; - fs::last_write_time(f1, std::mktime(tmp)); - std::time_t ft2 = fs::last_write_time(f1); + fs::last_write_time(f1x, std::mktime(tmp)); + std::time_t ft2 = fs::last_write_time(f1x); cout << " last_write_time() for the file is now " << std::asctime(std::gmtime(&ft2)) << endl; - BOOST_TEST(ft != fs::last_write_time(f1)); + BOOST_TEST(ft != fs::last_write_time(f1x)); cout << "\n Reset to current time" << endl; - fs::last_write_time(f1, ft); - double time_diff = std::difftime(ft, fs::last_write_time(f1)); + fs::last_write_time(f1x, ft); + double time_diff = std::difftime(ft, fs::last_write_time(f1x)); cout << " original last_write_time() - current last_write_time() is " << time_diff << " seconds" << endl; @@ -1800,20 +1809,20 @@ namespace // equivalent_tests ----------------------------------------------------------------// - void equivalent_tests(const fs::path& f1) + void equivalent_tests(const fs::path& f1x) { cout << "equivalent_tests..." << endl; BOOST_TEST(CHECK_EXCEPTION(bad_equivalent, ENOENT)); - BOOST_TEST(fs::equivalent(f1, dir / "f1")); + BOOST_TEST(fs::equivalent(f1x, dir / "f1")); BOOST_TEST(fs::equivalent(dir, d1 / "..")); - BOOST_TEST(!fs::equivalent(f1, dir)); - BOOST_TEST(!fs::equivalent(dir, f1)); + BOOST_TEST(!fs::equivalent(f1x, dir)); + BOOST_TEST(!fs::equivalent(dir, f1x)); BOOST_TEST(!fs::equivalent(d1, d2)); BOOST_TEST(!fs::equivalent(dir, ng)); BOOST_TEST(!fs::equivalent(ng, dir)); - BOOST_TEST(!fs::equivalent(f1, ng)); - BOOST_TEST(!fs::equivalent(ng, f1)); + BOOST_TEST(!fs::equivalent(f1x, ng)); + BOOST_TEST(!fs::equivalent(ng, f1x)); } // temp_directory_path_tests -------------------------------------------------------// @@ -1828,7 +1837,7 @@ namespace bool m_empty; previous_value(const char* name) - : m_string(name) + : m_name(name) , m_empty (true) { if(const char* value = getenv(name)) @@ -1862,6 +1871,40 @@ namespace { cout << "temp_directory_path_tests..." << endl; +#if defined BOOST_WINDOWS_API + + // Test ticket #5300, temp_directory_path failure on Windows with path length > 130. + // (This test failed prior to the fix being applied.) + { + const wchar_t long_name[] = + L"12345678901234567890123456789012345678901234567890" + L"12345678901234567890123456789012345678901234567890" + L"12345678901234567890123456789012345678901234567890#" // total 151 chars + ; + fs::path p (temp_dir); + p /= long_name; + fs::create_directory(p); + + guarded_env_var tmp_guard("TMP", p.wstring().c_str()); + error_code ec; + fs::path tmp_path = fs::temp_directory_path(ec); + cout << "#5300, temp_directory_path() returned " << tmp_path << endl; + BOOST_TEST(!ec); + BOOST_TEST(p == tmp_path); + fs::remove(p); + } + + // Test ticket #10388, null character at end of filesystem::temp_directory_path path + { + guarded_env_var tmp_guard("TMP", fs::initial_path().wstring().c_str()); + + error_code ec; + fs::path tmp_path = fs::temp_directory_path(ec); + cout << "#10388, temp_directory_path() returned " << tmp_path << endl; + BOOST_TEST(tmp_path == fs::initial_path()); + } + +#endif BOOST_TEST(!fs::temp_directory_path().empty()); BOOST_TEST(exists(fs::temp_directory_path())); fs::path ph = fs::temp_directory_path()/"temp_directory_path_test.txt"; @@ -1881,7 +1924,7 @@ namespace BOOST_TEST(!exists(ph)); } - fs::path test_temp_dir = fs::initial_path(); + fs::path test_temp_dir = temp_dir; #if defined BOOST_POSIX_API { @@ -1929,65 +1972,69 @@ namespace #endif #if defined BOOST_WINDOWS_API - { - struct guarded_tmp_vars - { - guarded_env_var m_tmp ; - guarded_env_var m_temp ; - guarded_env_var m_userprofile; - guarded_tmp_vars - ( const fs::path::value_type* tmp - , const fs::path::value_type* temp - , const fs::path::value_type* userprofile - ) - : m_tmp ("TMP" , tmp ) - , m_temp ("TEMP" , temp ) - , m_userprofile("USERPROFILE", userprofile) - {} - }; + struct guarded_tmp_vars + { + guarded_env_var m_tmp ; + guarded_env_var m_temp ; + guarded_env_var m_localappdata; + guarded_env_var m_userprofile; + + guarded_tmp_vars + ( const fs::path::value_type* tmp + , const fs::path::value_type* temp + , const fs::path::value_type* localappdata + , const fs::path::value_type* userprofile + ) + : m_tmp ("TMP" , tmp ) + , m_temp ("TEMP" , temp ) + , m_localappdata ("LOCALAPPDATA" , localappdata) + , m_userprofile ("USERPROFILE" , userprofile ) + {} + }; - // should NEVER throw - the windows directory or current_path always exists - { - guarded_tmp_vars vars(0, 0, 0); - fs::path ph = fs::temp_directory_path(); - - BOOST_TEST(test_temp_dir != ph); - } + // test the GetWindowsDirectoryW()/Temp fallback + { + guarded_tmp_vars vars(0, 0, 0, 0); + error_code ec; + fs::path ph = fs::temp_directory_path(ec); + BOOST_TEST(!ec); + cout << "Fallback test, temp_directory_path() returned " << ph << endl; + } - // should NEVER fail - the windows directory or current_path always exists - { - guarded_tmp_vars vars(0, 0, 0); - error_code ec; - fs::path ph = fs::temp_directory_path(ec); - BOOST_TEST(!ec); - } + { + guarded_tmp_vars vars(test_temp_dir.c_str(), 0, 0, 0); + fs::path ph = fs::temp_directory_path(); + BOOST_TEST(equivalent(test_temp_dir, ph)); + } + { + guarded_tmp_vars vars(0, test_temp_dir.c_str(), 0, 0); + fs::path ph = fs::temp_directory_path(); + BOOST_TEST(equivalent(test_temp_dir, ph)); + } - { - guarded_tmp_vars vars(test_temp_dir.c_str(), 0, 0); - fs::path ph = fs::temp_directory_path(); - BOOST_TEST(equivalent(test_temp_dir, ph)); - } - { - guarded_tmp_vars vars(0, test_temp_dir.c_str(), 0); - fs::path ph = fs::temp_directory_path(); - BOOST_TEST(equivalent(test_temp_dir, ph)); - } - { - guarded_tmp_vars vars(0, 0, test_temp_dir.c_str()); - fs::path ph = fs::temp_directory_path(); - BOOST_TEST(equivalent(test_temp_dir, ph)); - } + fs::create_directory(test_temp_dir / L"Temp"); + { + guarded_tmp_vars vars(0, 0, test_temp_dir.c_str(), 0); + fs::path ph = fs::temp_directory_path(); + BOOST_TEST(equivalent(test_temp_dir/L"Temp", ph)); + cout << "temp_directory_path() returned " << ph << endl; + } + { + guarded_tmp_vars vars(0, 0, 0, test_temp_dir.c_str()); + fs::path ph = fs::temp_directory_path(); + BOOST_TEST(equivalent(test_temp_dir/L"Temp", ph)); + cout << "temp_directory_path() returned " << ph << endl; } #endif } // _tests --------------------------------------------------------------------------// - void _tests() - { - cout << "_tests..." << endl; - } + //void _tests() + //{ + // cout << "_tests..." << endl; + //} } // unnamed namespace @@ -2035,6 +2082,7 @@ int cpp_main(int argc, char* argv[]) cout << "API is " << platform << endl; cout << "initial_path() is " << fs::initial_path() << endl; fs::path ip = fs::initial_path(); + do_the_right_thing_tests(); // compile-only tests, but call anyhow to suppress warnings for (fs::path::const_iterator it = ip.begin(); it != ip.end(); ++it) { @@ -2127,7 +2175,7 @@ int cpp_main(int argc, char* argv[]) // above was added just to simplify testing, but it ended up detecting // a bug (failure to close an internal search handle). cout << "post-test removal complete" << endl; - BOOST_TEST(!fs::exists(dir)); +// BOOST_TEST(!fs::exists(dir)); // nice test, but doesn't play well with TortoiseGit cache } cout << "returning from main()" << endl; diff --git a/libs/filesystem/test/operations_unit_test.cpp b/libs/filesystem/test/operations_unit_test.cpp index 8cedffefd..ce4e7f608 100644 --- a/libs/filesystem/test/operations_unit_test.cpp +++ b/libs/filesystem/test/operations_unit_test.cpp @@ -31,7 +31,6 @@ # error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support # endif -#include <boost/foreach.hpp> #include <boost/system/error_code.hpp> #include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_main.hpp> @@ -160,10 +159,10 @@ namespace } #endif - BOOST_FOREACH(directory_entry& x, directory_iterator(".")) + for (directory_iterator itr("."); itr != directory_iterator(); ++itr) { - CHECK(!x.path().empty()); - //cout << " " << x.path() << "\n"; + CHECK(!itr->path().empty()); + //cout << " " << itr->path() << "\n"; } cout << "directory_iterator_test complete" << endl; @@ -221,10 +220,11 @@ namespace } #endif - BOOST_FOREACH(directory_entry& x, recursive_directory_iterator("..")) + for (recursive_directory_iterator itr(".."); + itr != recursive_directory_iterator(); ++itr) { - CHECK(!x.path().empty()); - //cout << " " << x.path() << "\n"; + CHECK(!itr->path().empty()); + //cout << " " << itr->path() << "\n"; } cout << "recursive_directory_iterator_test complete" << endl; diff --git a/libs/filesystem/test/path_test.cpp b/libs/filesystem/test/path_test.cpp index 406dc9a67..071423048 100644 --- a/libs/filesystem/test/path_test.cpp +++ b/libs/filesystem/test/path_test.cpp @@ -642,27 +642,27 @@ namespace // operator == and != are implemented separately, so test separately - path p1("fe/fi/fo/fum"); - path p2(p1); - path p3("fe/fi/fo/fumm"); - BOOST_TEST(p1.string() != p3.string()); + path p101("fe/fi/fo/fum"); + path p102(p101); + path p103("fe/fi/fo/fumm"); + BOOST_TEST(p101.string() != p103.string()); // check each overload - BOOST_TEST(p1 != p3); - BOOST_TEST(p1 != p3.string()); - BOOST_TEST(p1 != p3.string().c_str()); - BOOST_TEST(p1.string() != p3); - BOOST_TEST(p1.string().c_str() != p3); + BOOST_TEST(p101 != p103); + BOOST_TEST(p101 != p103.string()); + BOOST_TEST(p101 != p103.string().c_str()); + BOOST_TEST(p101.string() != p103); + BOOST_TEST(p101.string().c_str() != p103); - p3 = p2; - BOOST_TEST(p1.string() == p3.string()); + p103 = p102; + BOOST_TEST(p101.string() == p103.string()); // check each overload - BOOST_TEST(p1 == p3); - BOOST_TEST(p1 == p3.string()); - BOOST_TEST(p1 == p3.string().c_str()); - BOOST_TEST(p1.string() == p3); - BOOST_TEST(p1.string().c_str() == p3); + BOOST_TEST(p101 == p103); + BOOST_TEST(p101 == p103.string()); + BOOST_TEST(p101 == p103.string().c_str()); + BOOST_TEST(p101.string() == p103); + BOOST_TEST(p101.string().c_str() == p103); if (platform == "Windows") { @@ -1567,14 +1567,15 @@ namespace PATH_TEST_EQ(path("foo/") / "bar", "foo/bar"); append_test_aux("foo/", "bar", "foo/bar"); - PATH_TEST_EQ(path("foo/") / "/bar", "foo//bar"); - append_test_aux("foo/", "/bar", "foo//bar"); if (platform == "Windows") { PATH_TEST_EQ(path("foo") / "bar", "foo\\bar"); append_test_aux("foo", "bar", "foo\\bar"); + PATH_TEST_EQ(path("foo\\") / "\\bar", "foo\\\\bar"); + append_test_aux("foo\\", "\\bar", "foo\\\\bar"); + // hand created test case specific to Windows PATH_TEST_EQ(path("c:") / "bar", "c:bar"); append_test_aux("c:", "bar", "c:bar"); @@ -1802,10 +1803,10 @@ int cpp_main(int, char*[]) p3 = p2; BOOST_TEST(p1.string() == p3.string()); - path p4("foobar"); - BOOST_TEST(p4.string() == "foobar"); - p4 = p4; // self-assignment - BOOST_TEST(p4.string() == "foobar"); + path p04("foobar"); + BOOST_TEST(p04.string() == "foobar"); + p04 = p04; // self-assignment + BOOST_TEST(p04.string() == "foobar"); construction_tests(); append_tests(); diff --git a/libs/filesystem/test/path_unit_test.cpp b/libs/filesystem/test/path_unit_test.cpp index 67ccb9fac..fe3a42794 100644 --- a/libs/filesystem/test/path_unit_test.cpp +++ b/libs/filesystem/test/path_unit_test.cpp @@ -33,8 +33,7 @@ #include <boost/filesystem/detail/utf8_codecvt_facet.hpp> // for imbue tests #include "test_codecvt.hpp" // for codecvt arg tests -#include <boost/detail/lightweight_test.hpp> -#include <boost/detail/lightweight_main.hpp> +#include <boost/detail/lightweight_test_report.hpp> #include <boost/smart_ptr.hpp> // used constructor tests #include <boost/functional/hash.hpp> @@ -126,9 +125,9 @@ namespace << L"\"\n" ; } - void check(bool ok, const char* file, int line) + void check(bool ok_, const char* file, int line) { - if (ok) return; + if (ok_) return; ++::boost::detail::test_errors(); @@ -827,17 +826,17 @@ namespace void test_overloads() { std::cout << "testing overloads..." << std::endl; - std::string s("hello"); + std::string sto("hello"); const char a[] = "goodbye"; - path p1(s); - path p2(s.c_str()); + path p1(sto); + path p2(sto.c_str()); path p3(a); path p4("foo"); - std::wstring ws(L"hello"); + std::wstring wsto(L"hello"); const wchar_t wa[] = L"goodbye"; - path wp1(ws); - path wp2(ws.c_str()); + path wp1(wsto); + path wp2(wsto.c_str()); path wp3(wa); path wp4(L"foo"); } @@ -1038,7 +1037,7 @@ namespace // // //--------------------------------------------------------------------------------------// -int cpp_main(int, char*[]) +int test_main(int, char*[]) { // document state of critical macros #ifdef BOOST_POSIX_API diff --git a/libs/filesystem/test/test_codecvt.hpp b/libs/filesystem/test/test_codecvt.hpp index 9ce8b75d1..666805ec1 100644 --- a/libs/filesystem/test/test_codecvt.hpp +++ b/libs/filesystem/test/test_codecvt.hpp @@ -44,7 +44,7 @@ wchar_t* to, wchar_t* to_end, wchar_t*& to_next) const { for (; from != from_end && to != to_end; ++from, ++to) - *to = *from + 1; + *to = wchar_t(*from + 1); if (to == to_end) return error; *to = L'\0'; diff --git a/libs/filesystem/tools/publish.bat b/libs/filesystem/tools/publish.bat new file mode 100644 index 000000000..e1ca8a970 --- /dev/null +++ b/libs/filesystem/tools/publish.bat @@ -0,0 +1,8 @@ +copy /y c:\boost\modular\develop\libs\filesystem\doc\*.htm? C:\boost\filesystem-gh-pages +pushd C:\boost\filesystem-gh-pages +git commit -a -m "merge from develop" +git push +popd +rem Copyright Beman Dawes, 2015 +rem Distributed under the Boost Software License, Version 1.0. +rem See www.boost.org/LICENSE_1_0.txt
\ No newline at end of file |