|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59585 - in sandbox/filesystem-v3/libs/filesystem: build doc example example/test src test
From: bdawes_at_[hidden]
Date: 2010-02-08 13:29:20
Author: bemandawes
Date: 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
New Revision: 59585
URL: http://svn.boost.org/trac/boost/changeset/59585
Log:
work-in-progress
Text files modified:
sandbox/filesystem-v3/libs/filesystem/build/Jamfile.v2 | 2
sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html | 80 ++++++++++++++++++++++++++++++++++++++-
sandbox/filesystem-v3/libs/filesystem/example/test/setup.sh | 12 +++---
sandbox/filesystem-v3/libs/filesystem/example/tut5.cpp | 3 -
sandbox/filesystem-v3/libs/filesystem/src/unique_path.cpp | 5 +-
sandbox/filesystem-v3/libs/filesystem/test/Jamfile.v2 | 4 +-
sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp | 19 +++++++--
7 files changed, 103 insertions(+), 22 deletions(-)
Modified: sandbox/filesystem-v3/libs/filesystem/build/Jamfile.v2
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/build/Jamfile.v2 (original)
+++ sandbox/filesystem-v3/libs/filesystem/build/Jamfile.v2 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
@@ -15,7 +15,7 @@
;
SOURCES =
- operations path path_traits portability utf8_codecvt_facet windows_file_codecvt codecvt_error_category ;
+ operations path path_traits portability unique_path utf8_codecvt_facet windows_file_codecvt codecvt_error_category ;
lib boost_filesystem
:
Modified: sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
@@ -626,7 +626,7 @@
decomposition, and query functions, making pathname manipulations easy,
convenient, reliable, and portable.</li>
</ol>
-<p>Let's take a look at how (1) and (2) work. Class path constructors,
+<p>Here is how (1) and (2) work. Class path constructors,
assignments, and appends have member templates for sources. For example, here
are the constructors that take sources:</p>
@@ -636,7 +636,81 @@
<pre>template <class InputIterator>
path(InputIterator begin, InputIterator end);</pre>
</blockquote>
-<p> </p>
+<p>Let's look at a little program that shows off these features:</p>
+
+<table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td style="font-size: 10pt">
+ <pre>tut5.cpp</pre>
+ <blockquote>
+ <pre>#include <boost/filesystem.hpp>
+#include <string>
+#include <list>
+namespace fs = boost::filesystem;
+
+int main()
+{
+ // \u263A is "Unicode WHITE SMILING FACE = have a nice day!"
+ std::string narrow_string ("smile2");
+ std::wstring wide_string (L"smile2\u263A");
+ std::list<char> narrow_list;
+ narrow_list.push_back('s');
+ narrow_list.push_back('m');
+ narrow_list.push_back('i');
+ narrow_list.push_back('l');
+ narrow_list.push_back('e');
+ narrow_list.push_back('3');
+ std::list<wchar_t> wide_list;
+ wide_list.push_back(L's');
+ wide_list.push_back(L'm');
+ wide_list.push_back(L'i');
+ wide_list.push_back(L'l');
+ wide_list.push_back(L'e');
+ wide_list.push_back(L'3');
+ wide_list.push_back(L'\u263A');
+
+ { fs::ofstream f("smile"); }
+ { fs::ofstream f(L"smile\u263A"); }
+ { fs::ofstream f(narrow_string); }
+ { fs::ofstream f(wide_string); }
+ { fs::ofstream f(fs::path(narrow_list.begin(), narrow_list.end())); }
+ { fs::ofstream f(fs::path(wide_list.begin(), wide_list.end())); }
+
+ return 0;
+}</pre>
+ </blockquote>
+ </td>
+ </tr>
+</table>
+
+<p>Testing tut5:</p>
+
+ <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+ <tr>
+ <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+ <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+ </tr>
+ <tr>
+ <td width="50%" style="font-size: 10pt" valign="top">
+ <pre>$ ./tut5
+$ ls smile*
+smile smile☺ smile2 smile2☺ smile3 smile3☺</pre>
+ </td>
+ <td style="font-size: 10pt" valign="top">
+ <pre>>tut5
+>dir /b smile*
+smile
+smile2
+smile2☺
+smile3
+smile3☺
+smile☺</pre>
+ </td>
+ </tr>
+ </table>
+
+<p>Note that the exact appearance of the smiling face will depend on the font,
+font size, and other settings for your command line window.</p>
<p>In addition to handling a variety of types, class path function templates
also handle conversion between the argument's encoding and the internal encoding
required for communication with the operating system. Thus it's no problem to
@@ -953,7 +1027,7 @@
<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 -->04 February 2010<!--webbot bot="Timestamp" endspan i-checksum="40545" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->05 February 2010<!--webbot bot="Timestamp" endspan i-checksum="40547" --></p>
</body>
Modified: sandbox/filesystem-v3/libs/filesystem/example/test/setup.sh
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/example/test/setup.sh (original)
+++ sandbox/filesystem-v3/libs/filesystem/example/test/setup.sh 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
@@ -10,10 +10,10 @@
cp ../tut4.cpp .
cp ../tut5.cpp .
cp ../path_info.cpp .
-rm tut1 2>/dev/nul
-rm tut2 2>/dev/nul
-rm tut3 2>/dev/nul
-rm tut4 2>/dev/nul
-rm tut5 2>/dev/nul
-rm path_info 2>/dev/nul
+rm tut1 2>~/junk
+rm tut2 2>~/junk
+rm tut3 2>~/junk
+rm tut4 2>~/junk
+rm tut5 2>~/junk
+rm path_info 2>~/junk
Modified: sandbox/filesystem-v3/libs/filesystem/example/tut5.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/example/tut5.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/example/tut5.cpp 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
@@ -40,8 +40,5 @@
{ fs::ofstream f(fs::path(narrow_list.begin(), narrow_list.end())); }
{ fs::ofstream f(fs::path(wide_list.begin(), wide_list.end())); }
- { fs::ofstream f("../test/smile-generic"); }
- { fs::ofstream f("..\\test\\smile-windows"); }
-
return 0;
}
Modified: sandbox/filesystem-v3/libs/filesystem/src/unique_path.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/src/unique_path.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/src/unique_path.cpp 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
@@ -21,6 +21,7 @@
# else // BOOST_WINDOWS_API
# include <windows.h>
# include <wincrypt.h>
+# pragma comment(lib, "Advapi32.lib")
# endif
namespace {
@@ -72,12 +73,12 @@
HCRYPTPROV handle;
int errval = 0;
- if (!::CryptAcquireContext(&handle, 0, 0, PROV_RSA_FULL, 0))
+ if (!::CryptAcquireContextW(&handle, 0, 0, PROV_RSA_FULL, 0))
{
errval = ::GetLastError();
if (errval == NTE_BAD_KEYSET)
{
- if (!::CryptAcquireContext(&handle, 0, 0, PROV_RSA_FULL, CRYPT_NEWKEYSET))
+ if (!::CryptAcquireContextW(&handle, 0, 0, PROV_RSA_FULL, CRYPT_NEWKEYSET))
{
errval = ::GetLastError();
}
Modified: sandbox/filesystem-v3/libs/filesystem/test/Jamfile.v2
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/Jamfile.v2 (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/Jamfile.v2 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
@@ -18,9 +18,9 @@
[ run path_unit_test.cpp ]
[ run path_test.cpp ]
[ run operations_unit_test.cpp ]
- [ run operations_unit_test.cpp : : : <link>static : operations_unit_test_static ]
+ # [ run operations_unit_test.cpp : : : <link>static : operations_unit_test_static ]
[ run operations_test.cpp ]
- [ run operations_test.cpp : : : <link>static : operations_test_static ]
+ # [ run operations_test.cpp : : : <link>static : operations_test_static ]
[ run fstream_test.cpp ]
[ run convenience_test.cpp ]
[ run large_file_support_test.cpp ]
Modified: sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp 2010-02-08 13:29:19 EST (Mon, 08 Feb 2010)
@@ -33,6 +33,7 @@
namespace bs = boost::system;
using boost::filesystem::path;
using std::cout;
+using std::endl;
using std::string;
using std::wstring;
@@ -447,10 +448,18 @@
// CHECK(path("").absolute("") == ""); // should assert
// CHECK(path("").absolute("foo") == ""); // should assert
+
+# ifdef BOOST_WINDOWS_PATH
CHECK(path("baa").absolute("c:/") == "c:/baa");
CHECK(path("/baa").absolute("c:/foo").string() == path("c:/baa").string());
CHECK(path("baa/baz").absolute("c:/foo/bar").string()
- == path("c:/foo/bar\\baa/baz").string());
+ == path("c:/foo/bar\\baa/baz").string());
+# else
+ CHECK(path("baa").absolute("/") == "/baa");
+ CHECK(path("/baa").absolute("/foo").string() == path("/baa").string());
+ CHECK(path("baa/baz").absolute("/foo/bar").string()
+ == path("/foo/bar\\baa/baz").string());
+# endif
}
// test_decompositions -------------------------------------------------------------//
@@ -797,16 +806,16 @@
{
// document state of critical macros
#ifdef BOOST_POSIX_API
- cout << "BOOST_POSIX_API\n";
+ cout << "BOOST_POSIX_API" << endl;
#endif
#ifdef BOOST_WINDOWS_API
- cout << "BOOST_WINDOWS_API\n";
+ cout << "BOOST_WINDOWS_API" << endl;
#endif
#ifdef BOOST_POSIX_PATH
- cout << "BOOST_PATH_API\n";
+ cout << "BOOST_PATH_API" << endl;
#endif
#ifdef BOOST_WINDOWS_PATH
- cout << "BOOST_WINDOWS_PATH\n";
+ cout << "BOOST_WINDOWS_PATH" << endl;
#endif
l.push_back('s');
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk